pk, the TUI for building “coding helpers” - Part 3

Final tweaks before I start learning Rust.

sbx

This 3rd blog post is the follow-up to:

Today, I’m making the final tweaks to my agent before diving into some serious Rust learning.

New model

I decided to try a new local language model, Ornith-1.0-9b from DeepReinforce AI. It looks promising for programming tasks. That said, I’ll run tests with other local language models, and I’ll do a comparison of the results.

[model]
id           = "huggingface.co/deepreinforce-ai/ornith-1.0-9b-gguf:Q4_K_M"
base_url     = "http://localhost:12434/engines/v1"
api_key      = "ignored"
context_size = 32768
thinking     = true
tools_format = "qwen3"

New features

Since those 2 blog posts, I’ve made a few improvements to pk:

I added an ask_user_tool parameter to the pk.toml configuration file so the agent can ask you what you want to do rather than guessing and carrying on by itself.

ask_user_tool = true

You need to disable the thinking_tool_bridge.

I also added two built-in tools for the agent: clear_context and pack_context packing.

These are standard built-in tools, on by default, disable them per agent with [agent] disabled_builtin_tools = ["clear_context", "pack_context"].

Then I added three skills to the agent, that pair clear_context and pack_context packing with a durable record on disk:

Context packing (history compression)

As a conversation grows, its token count climbs toward the model’s context_size. Once it gets full, the oldest exchanges either fall off or the request overflows and the model degrades. Context packing compresses the accumulated history into a compact summary using a dedicated LLM call, then replaces the full history with that summary and resets the token counter. Bob keeps the key facts, file paths, decisions, and code he needs to continue — but stops re-sending every earlier message verbatim.

You can always trigger it by hand with the /pack slash command or the Pack button. Setting auto = true makes pk do it for you.

[context_packing]
system_instruction = "Expert"     # Minimalist | Expert | Effective
compression_prompt = "Structured" # Minimalist | Structured | UltraShort | ContinuityFocus
auto               = true         # pack automatically once the threshold is crossed
threshold_percent  = 75           # pack at 75% of model.context_size (≈24576 tk)

Note: packing here reuses the main model (ornith-1.0-9b) for the compression call. If you ever want a cheaper/faster packer, add model = "…" in this block; it reuses the same endpoint, only the model id changes.

My “coding helper” is ready

So my agent is ready to help me learn to code in Rust. I updated the sbx template and the associated kit with the latest version of pk (v0.4.4). So you can keep coding with the coder web IDE that runs inside sbx. (use the ./start.sh script to launch the sandbox). You’ll find the updated Bob in this part of the repository: https://codeberg.org/we-are-legion/bob/src/branch/main/03-better-teacher.

What’s next?

So, my plan is to build a small project from scratch (in Rust of course) using only small local language models. I’ve planned to test:

and maybe others depending on what I discover.

My project will be a very simple expert system that you’ll be able to follow here: https://codeberg.org/k33g/noesis.

So see you very soon for new adventures 🤓

© 2026 k33g Project | Built with Gu10berg

Subscribe: 📡 RSS | ⚛️ Atom