I wanted Claude Code-style workflows without sending code to the cloud, so I built Loki
from aclarke@lemmy.world to selfhosted@lemmy.world on 26 May 18:37
https://lemmy.world/post/47383802

For the longest time, I’ve been trying to figure out a way to “survive” in this new AI age without having to fork over a ton of money just to keep up. I’ve tried using local models via Ollama, and while they definitely work to a degree, they’re (unsurprisingly) not as good as the big model providers.

The local models tend to

So to improve the reliability of fully local, smaller models (and to keep all my data local and in my own network), I created Loki.

It’s a local-first, batteries-included command line tool and runtime for building and running LLM workflows locally. It’s model agnostic and supports things like

A lot of the features it supports are specifically designed to compensate for weaknesses in smaller local models. For example:

It also supports the major cloud providers if you want them (which definitely helped while testing 😄), but my long-term goal is simple:

Get as close as possible to Claude Code-style reliability using fully local models.

I’m always open to feedback, questions, or ideas.

Repo: github.com/Dark-Alex-17/loki

#selfhosted

threaded - newest

helix@feddit.org on 26 May 18:53 next collapse

Looks cool! I really like some aspects of LLMs but cloud hosting always turns me off.

You might want to rethink the name though as Loki already is a well known log server: github.com/grafana/loki

aclarke@lemmy.world on 26 May 19:26 collapse

Yeah… 😅 I originally named it Loki because, well…if you leave LLMs unsupervised they just create mischief. Any ideas of a good rename? I’ve gotten this comment before and I just couldn’t think of anything good.

panda_abyss@lemmy.ca on 26 May 19:39 next collapse

I feel like that well describes a border collie.

Wants to do stuff, but if you don’t attend they’ll find stuff to do.

minticecream@lemmy.world on 26 May 19:39 next collapse

Maybe Coyote? Coyote is the trickster spirit in a lot of Native American mythologies.

aclarke@lemmy.world on 26 May 19:58 next collapse

Ooh I like Coyote! That’s definitely in the running now. Not to mention that’s really a really cool allusion to Native American mythology!

helix@feddit.org on 26 May 23:08 next collapse

Or Coyode (mixture between code and coyote, could be written co[yo]de for extra yo). Only has 4 duckduckgo results so easily searchable and distinguishable.

ChatGPT generated logo example

<img alt="co[yo]de logo: coyote with a hoodie and the aforementioned spelling" src="https://feddit.org/pictrs/image/2287d9db-d8b8-4193-83d0-2dbe7de66c50.png">

aclarke@lemmy.world on 27 May 00:21 collapse

After sitting with Coyote for a while, I’m really liking the name. Before I get too attached, any other ideas? (Just to make sure I stay objective 😛)

jackal@infosec.pub on 27 May 00:33 next collapse

Stop overthinking it and use it. It seems like the consensus is in the approval of your choice.

aclarke@lemmy.world on 27 May 00:40 collapse

Works for me. I’ll refactor that and rename it tomorrow and hopefully have a new minor release sometime this week. It’ll be another baking change release so I’ll need to attach a couple commands to the release notes to make it easy to migrate.

towerful@programming.dev on 27 May 17:30 collapse

“Frank”, it I don’t think that name is in the same ballpark as you are looking for.

MalReynolds@slrpnk.net on 27 May 00:25 collapse

Not to mention road-runners (humans) and ACME (OpenAi, Anthropic etc.) extending the metaphor in a different direction… Wile.E. (coyote, suupergenius) might be another name option.

Ahh, ninja’d, I’ll leave it as another vote.

DrinkMonkey@lemmy.ca on 27 May 00:58 next collapse

Hermes is also the trickster god in Greek mythology, but not sure if the makers of that project were thinking of that, or his role as messenger. Or the one who guides souls to Hades. Dude’s got a lot of jobs…

aclarke@lemmy.world on 27 May 04:55 collapse

Do you have a GitHub and would you be willing to share with me so I could credit you with the name? No worries if not, I can just link to your Lemmy profile instead of you prefer. I just don’t want to change it without giving credit.

MolochAlter@lemmy.world on 26 May 22:21 next collapse

Sounds like some shepherd reference could be good, since it’s herding the agents.

DarkSirrush@piefed.ca on 27 May 01:30 next collapse

Could call it Sylvie as well (the Marvel gender bent Loki)

Einskjaldi@lemmy.world on 27 May 13:04 collapse

Weapons like Gungnir are popular names, Lævateinn is a little hard to spell though.

Blue_Morpho@lemmy.world on 26 May 18:58 next collapse

What local model are you using?

aclarke@lemmy.world on 26 May 19:30 collapse

I’m using a ton of different ones but the main ones I use daily are

  • gemma4:26b
  • deepseek-coder
  • deepseek-r1:32b
  • devstral:24b
  • granite-code:34b
  • openthinker:latest
  • phi4:latest
  • qwen3:30b
  • mixtral:8x22b

I’m also going to use this opportunity to plug an amazing project to help figure out which models will work well on my hardware: github.com/AlexsJones/llmfit Is amazing!

Blue_Morpho@lemmy.world on 26 May 19:35 collapse

Isn’t it a huge delay to swap out to a different ~30b model every few minutes depending on the use case?

aclarke@lemmy.world on 26 May 19:44 collapse

Unfortunately, yes. It’s one reason I’m trying to figure out a good mechanism to maybe do something like multiple ollama hosts. So like: you can specify what model to use specifically in an agent. But if an agent delegates to a sub-agent, it unloads that model and loads the new one. I’m trying to figure out if there’s a way to “alternate” between multiple hosts (say, ollama running locally and one running on your server), so that when a switch happens, it does it on the secondary host while also looking ahead to see what needs to be switched, if anything, on the primary host.

It supports multiple Ollama hosts right now as-is so what I’ve honestly been doing for the time being is specify which model on which host each agent uses so there’s only loading of one model at the beginning of a session. Then there’s no unloading/loading/etc. The other thing I’ve been trying is to see how small I can get the models to be without losing performance. While the tricks implemented in Loki help dramatically, I know there’s still a lot more I can do to improve it further.

CallMeAl@piefed.zip on 26 May 19:04 next collapse

I like that you are so focused on local models but I can’t find any info on setting up local models in the clients setup https://github.com/Dark-Alex-17/loki/wiki/Clients

What am I missing?

Edit: well it seems this post is an entirely fictional origin story. Here is the first time OP posted about his project 6 months ago https://piefed.zip/c/rust/p/663115/loki-an-all-in-one-batteries-included-llm-cli

aclarke@lemmy.world on 26 May 19:24 collapse

So actually, this was the original purpose of it. But all the help I tried to get on it didn’t really have much interest in doing anything outside of the usual big model providers, so I tried advertising a more general use case to attract more input. I can’t deny that agnostic support for even the big providers is helpful when you’re trying to stay current with the rapid advances in LLMs.

After that, I kind of gave up on getting feedback on local-first models. So, instead, I just dove in head-first the way I wanted;Trying new things, building new agents to try and rival Claude Code, adding features as I found them useful and necessary to improve that reliability, etc., and iterating. Then, with the most recent release on Friday, I had done so many changes and improvements specifically for local models that I thought I finally had a strong enough tool to maybe pique enough people’s interest to get some feedback and input. 🙂

Oh, and the config example shows how to add Ollama models here

MalReynolds@slrpnk.net on 27 May 00:31 collapse

Ollama is enshittifying at a rate of knots, have you got a way to use llama-server (or preferably llama-swap) instead ?

aclarke@lemmy.world on 27 May 00:36 next collapse

Looking at Llama-swap, since it says it supports OpenAI-compatible API, it should just work natively already. Just set up the client to be type: openai-compatible and fill in the URL and provide the models. Should work out of the box!

MalReynolds@slrpnk.net on 27 May 00:41 collapse

Hope so, bet it doesn’t without some tweaking though, OpenAI-compatible seldom is, and ollama is bad for that. Still, worth checking out, I’ll have a go at it sometime soonish and perhaps you’ll see a PR (or some doco in the best case scenario).

aclarke@lemmy.world on 27 May 00:46 collapse

Looking forward to it! Heads up in case you missed it: I had settled on renaming it to Coyote, so sometime this week will be a breaking change and release to get that done.

Biggest pains are just going to be updating the repo tokens for Crates.io and renaming the homebrew repo.

MalReynolds@slrpnk.net on 27 May 00:48 collapse

K, I’ll circle back in a week or so…

JollyForeheadRidges@lemmy.zip on 27 May 02:40 collapse

Crap. I was just starting to play with Ollama and thought it might be a good balance between running local models and using one of the proprietary services.

Could you elaborate on what’s happening with them / what to watch out for?

MalReynolds@slrpnk.net on 27 May 07:31 collapse

If it gets you started with local models, by all means go ahead, their onboarding is the easiest and it works. Also a lot of 3rd party stuff uses it as a first class citizen allowing you to try out other things (e.g. Open WebUI) easily as you explore what’s possible. Currently try the Qwen 3.6 and Gemma4 models as best bang for buck, somewhere there’s a does it fit in my machine website that can help (search for it).

That said, basically all roads in local LLM lead to llama.cpp, which gets the innovations first and then others copy their homework. Ollama (looks like they’re angling to go commercial) for a long time used it internally without attribution, now they use a bodged up engine of their own that is less performant and almost certainly a copy (possibly vibe coded) of llama.cpp. They heavily encourage using their own models / quantizations and don’t let you play with a lot of parameters without a lot of friction (possibly because they’re not implemented yet, but who knows, low transparency). You get the picture, wannabe techbros. That’s off the top of my head, search for more authoritative sources.

After you’ve gotten the hang of things, have a look at llama-swap which just wraps llama.cpp, lemonade if you’re on AMD, vLLM for nvidia, LM Studio for mac.

lime@feddit.nu on 26 May 19:09 next collapse

any chance of an lsp server? i know the protocol is clunky as all hell, but local completions in any editor would be big.

aclarke@lemmy.world on 26 May 19:31 collapse

I’ve been thinking about integrating LSP into it but I can’t think of a great way to do it. I’ve been meaning to look at OpenCode and see how they do it. Maybe I’ll work that into the next release!

eager_eagle@lemmy.world on 27 May 01:57 next collapse

afaict they just run the LSP automatically when the agent uses the file edit tool, passing errors/warnings as a response of the tool. Maybe they run it before and after to get only the warnings introduced after the change, maybe they filter by the lines changed, I’m not sure.

lime@feddit.nu on 27 May 05:50 collapse

opencode is a mess. it’s way overcomplicated.

personally i’m not really interested in agents, i want a tool that can automate repetitive tasks and refactoring. people seem to be building things to remove the programming altogether.

i’ve been out of work for the past nine months and looking at the software engineering news has had me feeling like i’m taking crazy pills. it’s like being in a cycling community because you love cycling, then you leave for a while and when you come back they’ve pivoted to cars.

RickyRigatoni@piefed.zip on 26 May 19:22 next collapse

Does it have built-in protections so it doesn’t randomly decide to delete every file it has permissions to?

aclarke@lemmy.world on 26 May 19:47 collapse

Yes it does. By default, any of the execute_command or fs_write/fs_patch/etc. tools all have guards around them that prompt for user confirmation before doing things. They can be disabled via the AUTO_APPROVE environment variable if necessary (like they are when using the sisyphus agent). For bash tools, I’ve included functions that can help do this when you write your own tools. For Python tools, you can use the usual input methods.

RickyRigatoni@piefed.zip on 26 May 19:54 collapse

As usual, leave it to the random developers on the internet to put more care and thought into something than the multibillion dollar companies.

CIA_chatbot@lemmy.world on 26 May 19:27 next collapse

Just an fyi, Loki is also an extremely popular logging system by Grafana, might want a rename if you don’t want to deal with people not finding your project due to having a larger project named the same thing

RobotToaster@mander.xyz on 26 May 19:27 next collapse

Naming an AI tool after a god of mischief seems like tempting the fates. 😆

Natanox@discuss.tchncs.de on 26 May 22:31 next collapse

I can respect the self-awareness though.

Einskjaldi@lemmy.world on 27 May 13:02 collapse

Can it be used with horses?

g0d0fm15ch13f@lemmy.world on 27 May 14:50 collapse

Seems like a great idea to me…

Decronym@lemmy.decronym.xyz on 26 May 19:30 next collapse

Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I’ve seen in this thread:

Fewer Letters More Letters
DNS Domain Name Service/System
IP Internet Protocol
SSL Secure Sockets Layer, for transparent encryption
TLS Transport Layer Security, supersedes SSL

3 acronyms in this thread; the most compressed thread commented on today has 16 acronyms.

[Thread #318 for this comm, first seen 26th May 2026, 19:30] [FAQ] [Full list] [Contact] [Source code]

nimble@lemmy.blahaj.zone on 26 May 19:39 next collapse

I’m confused. You say in post title you don’t want to send code to the cloud but the image you attached shows openai gpt4o. So what’s the deal?

aclarke@lemmy.world on 26 May 19:56 collapse

It was just the one gif I had available and also the model that worked fast enough to fit into a gif without taking forever between prompts so I could demo Loki well. You make a good point though. It’s an old build and is slightly outdated. I’ll update that. Thanks for pointing that out.

homesweethomeMrL@lemmy.world on 26 May 19:54 next collapse

Very cool idea! Going with the Coyote theme maybe name it Wile E?

SnotFlickerman@lemmy.blahaj.zone on 26 May 20:28 collapse

Certified Genius: Have Brain, Will Travel

minfapper@piefed.social on 26 May 21:48 next collapse

I’m a little confused about this thing’s use case.

What does it do differently/better than OpenCode ?

naught@sh.itjust.works on 26 May 23:36 next collapse

Opencode isn’t very fun to set up with local LLMs and I’ve had issues with tool calling, but it’s very doable! That said, OpenCode is my go-to, absolutely love it compared to all alternatives I’ve tried

aclarke@lemmy.world on 27 May 00:19 next collapse

When it comes to writing code, OpenCode is my go-to as well. It’s my ultimate benchmark for how well optimized and reliable I can make local models function in Loki.

Evotech@lemmy.world on 27 May 05:47 next collapse

Opencode needs like 10k tokens just to get started

naught@sh.itjust.works on 27 May 13:34 collapse

Is that included in the token & cost counter? I haven’t really noticed that yet. It’s just the most reliable and best harness i’ve yet used. For context i’ve only otherwise tried claude, gemini, and aider. More if you count non cli apps

Evotech@lemmy.world on 27 May 14:20 collapse

Yes of course. It’s all tools and skills and system stuff

But 10k isn’t much in the grand scope. But it can be a big hurdle if you want to use opencode with local small models

alehc@slrpnk.net on 27 May 07:59 collapse

Haven’t configured much beyond this but what’s wrong with ollama launch opencode <model>? Haven’t had an issue yet.

naught@sh.itjust.works on 27 May 13:30 collapse

yo… what? i was configuring json files n shit with custom sources. granted i used lmstudio as ollama doesn’t support mlx models or something for mac. This is definitely the easy way if you’re using ollama.

aclarke@lemmy.world on 27 May 00:20 next collapse

OpenCode is specific to coding workflows. Loki is built to be a general LLM runtine/workflow engine for any problem domain, not just code. An example use I have for it is a cron job that runs at boot to

  • See if the cause of the reboot was power loss (LLM)
  • If it was, check all services to ensure they’re up and running (tool)
  • If a service isn’t up, then use an LLM to see what happened (LLM)
  • Try out the usual methods for getting that service started (tool + RAG)
  • If none of those work, try figuring out what’s ultimately wrong (LLM)
  • Send me a ntfy notification on my phone to let me know what service isn’t running, and the suspected cause with some context (tool)
Meron35@lemmy.world on 27 May 00:22 collapse

Ditto. I don’t see how this is different/better from existing harnesses such as Opencode, Pi, and even “commercial” open source offerings such as the CLIs for Codex, Copilot, and Gemini, especially once tricked out with plugins and extensions.

trewq@lemmy.world on 27 May 00:14 next collapse

No llama.cpp?

corbindallas@fedinsfw.app on 27 May 00:47 next collapse

did you even try pi or opencode?

qarbone@lemmy.world on 27 May 03:22 collapse

I mean, maybe they just wanted to build something?

corbindallas@fedinsfw.app on 27 May 03:30 next collapse

fair hit.

Buddahriffic@lemmy.world on 27 May 17:39 collapse

Yeah, reinventing the wheel can be fun.

QueenMidna@lemmy.ca on 27 May 07:01 next collapse

I’m curious how well this would work with speckit

napkin2020@sh.itjust.works on 27 May 16:26 next collapse

Tried building something like this myself and it was surprisingly complicated. Sounds exactly what I needed!

merc@sh.itjust.works on 27 May 17:30 next collapse

The demo would be a lot more impressive if the questions you were asking weren’t longer than the extremely simple SQL queries it generates.

silver@das-eck.haus on 27 May 17:42 collapse

Looks sick, gonna check this out