zkit
zkit
Go packages for building agents: a streaming loop, tool dispatch, guardrails, compaction, and provider adapters.
go get github.com/zarldev/zarlmono/zkitImport what you need. Compose the rest.
What is zkit?
Section titled “What is zkit?”zkit is a set of small Go packages for building agents. Take the pieces you need and ignore the rest. Each package has a narrow interface and no framework ceremony.
The runner is the streaming, tool-calling agent loop. Around it are tools, guardrails, compaction, providers, verified completion, and the foundation packages underneath.
package main
import ( "context" "time"
"github.com/zarldev/zarlmono/zkit/agent/runner" "github.com/zarldev/zarlmono/zkit/ai/llm/anthropic")
func main() { provider, _ := anthropic.NewProvider(apiKey)
r := runner.New(runner.ClientFromProvider(provider), runner.WithPromptText("You are a helpful coding assistant."), runner.WithMaxIterations(20), runner.WithToolTimeout(60*time.Second), )
_, _ = r.Run(context.Background(), runner.TaskSpec{ Prompt: "Refactor the auth package to use context everywhere.", })}Core packages
Runner
Streaming loop with tool calls, steering, compaction hooks, and per-call timeouts.
zkit/aiTools
Registry, two-method Tool interface, reflection schemas, JSON repair, MCP.
zkit/agentGuardrails
Middleware around tool dispatch: schema repair, shell policy, repetition detection, verifier feedback.
zkit/agentCompaction
History-shrinking strategies behind one interface, with budget-driven triggers.
zkit/aiProviders
OpenAI, Anthropic, Gemini, DeepSeek, llama.cpp, Ollama, and OAuth backends behind one contract.
zkit/agentVerified completion
Re-drive attempts against real-world state — tests passing, files present — not the transcript.
Built with zkit
These products share the same repo and the same packages.
zarlcode
A terminal coding agent: runner, guardrails, sandboxed shell, sub-agents, SQLite sessions.
Local assistantzarlai
A local multimodal assistant: speech, vision, home automation, autonomous tasks.
Evaluationswebench-eval
A SWE-bench driver built from the same packages as the TUI.
Where to go next
Section titled “Where to go next”- Getting started — install zkit and run your first agent.
- Architecture — see how the packages layer.
- Runner — understand the loop.