I've been running local LLMs for a while, and one thing kept bothering me: most agent frameworks are heavy. System prompts, tool schemas, function definitions, orchestration logic — by the time the model gets to do anything, half the context is gone.
OpenClaw and similar tools are powerful, but they carry a lot of overhead. My agent is roughly 300x lighter in size (about 1,500 lines of Python, standard library only, no dependencies) and starts far faster in my testing. (Replace with your actual metric if it's memory, startup time, etc.)
This post is about the design, not a pitch.
The idea: cmd blocks instead of the tools API
Instead of the usual function-calling setup, the model just writes commands inside plain cmd blocks. The agent finds them, asks for approval (y/n), and runs them.
Sure, let me check the logs.
tail -n 50 /var/log/syslog
That's the whole protocol. No JSON schemas, no middleware, no big tool definitions.
What it saves
In my old setup, framework overhead was roughly 260 extra tokens per request. On a small local model that adds up fast — every turn re-sends that stuff.
It also helps with KV cache reuse: I run it against Colibri, my OpenAI-compatible local server, which reuses the conversation cache and only processes new tokens. Smaller cache, faster responses, even on models that felt too slow before. It should work with llama.cpp, Ollama, vLLM, or any OpenAI-compatible backend.
The unusual part: roleplay + agent
The project has three modes:
agent — normal CLI agent
rp_agent — roleplay character that can also run commands (supports chara_card_v2)
chat — just conversation, no system access
The rp_agent mode is the part I'm unsure about. You load a character card, and the model works on your system while staying in character — commands are the character's actions, not separate instructions. I don't know yet if that's a good idea or overengineering.
Other bits
Context rotation at 75% — summarizes and archives instead of dropping old messages
/save and /load for sessions
Tmux interface with separate panels
Safety: shell injection guard, command whitelist, permission modes
What I'd like feedback on
Command blocks vs. the tools API — is function calling actually too expensive for local models, or is it just me?
Context summaries + rotation vs. simple truncation — does it hold up over long sessions?
Roleplay + agent — interesting, or should these stay separate?
Repo
https://github.com/Tyv43/colibri-mini-agent-character-assistant
~1,500 lines of Python, standard library only, no pip install. If it breaks, open an issue.
