Skip to content

Custom Provider Support & Agent Loop v2

Choose a tag to compare

@eftalyurtseven eftalyurtseven released this 30 Mar 03:01

What's New

Custom OpenAI-Compatible Providers (#9)

You can now use any OpenAI-compatible API as a provider by setting base_url in your config. This supports Ollama, LM Studio, vLLM, GLM, Minimax, Together AI, and more.

# Ollama (local)
[provider.ollama]
base_url = "http://localhost:11434/v1"
model = "llama3.2"

# Any OpenAI-compatible endpoint
[provider.custom]
api_key = "your-api-key"
base_url = "https://your-endpoint.com/v1"
model = "your-model-name"

Then: klaw chat -p ollama

Agent Loop v2

  • Context compaction — auto-summarizes conversation when approaching token limits
  • Cost tracking — per-model pricing, session budgets, usage reporting
  • Resilient provider — retry with exponential backoff + provider fallback chains
  • Delegate tool — depth-limited sub-agent spawning for parallel tasks
  • Reflection & planning — configurable agent self-reflection and planning prompts
  • Tool approval — per-agent approval requirements for sensitive tools
  • Observability — structured JSON logging + per-session metrics

OpenAI-Compatible HTTP Gateway

  • Serve klaw agents via /v1/chat/completions endpoint
  • Auth, CORS, concurrency limiting, per-model agent/skill mapping
  • Enable with [openai] enabled = true in config

Other

  • Default provider priority changed to Anthropic first
  • Session persistence with debounced saving and resume support
  • Comprehensive test coverage for agent, config, provider, orchestrator, session, and tool packages
  • Updated docs: agent loop, resilience, cost & safety, multi-agent workflows

Install

curl -fsSL https://klaw.sh/install.sh | sh