@@ -45,19 +45,27 @@ Configuration values are resolved in this precedence (highest wins):
4545
4646``` go
4747type Config struct {
48- Agents AgentsConfig ` json:"agents"`
49- Channels ChannelsConfig ` json:"channels"`
50- Providers ProvidersConfig ` json:"providers"`
51- Gateway GatewayConfig ` json:"gateway"`
52- Tools ToolsConfig ` json:"tools"`
53- Group GroupConfig ` json:"group"`
54- Orchestrator OrchestratorConfig ` json:"orchestrator"`
55- Scheduler SchedulerConfig ` json:"scheduler"`
56- ER1 ER1Config ` json:"er1"`
57- Observer ObserverConfig ` json:"observer"`
48+ Paths PathsConfig ` json:"paths"`
49+ Model ModelConfig ` json:"model"`
50+ Agents AgentsConfig ` json:"agents"`
51+ Channels ChannelsConfig ` json:"channels"`
52+ Providers ProvidersConfig ` json:"providers"`
53+ Gateway GatewayConfig ` json:"gateway"`
54+ Tools ToolsConfig ` json:"tools"`
55+ Group GroupConfig ` json:"group"`
56+ Orchestrator OrchestratorConfig ` json:"orchestrator"`
57+ Scheduler SchedulerConfig ` json:"scheduler"`
58+ ER1 ER1IntegrationConfig ` json:"er1"`
59+ Observer ObserverMemoryConfig ` json:"observer"`
60+ ContentClassification ContentClassificationConfig ` json:"contentClassification"`
61+ PromptGuard PromptGuardConfig ` json:"promptGuard"`
62+ OutputSanitization OutputSanitizationConfig ` json:"outputSanitization"`
63+ FinOps FinOpsConfig ` json:"finops"`
5864}
5965```
6066
67+ New sections added in this release: ` Model ` , ` Paths ` , ` ContentClassification ` , ` PromptGuard ` , ` OutputSanitization ` , ` FinOps ` . See [ Configuration Keys] ( ../reference/config-keys/ ) for details.
68+
6169### Agent Configuration
6270
6371| Field | Default | Env Var | Description |
@@ -354,7 +362,7 @@ Isolation guarantees:
354362
355363### Provider Architecture
356364
357- All providers use the OpenAI-compatible API format via a single ` OpenAIProvider ` implementation .
365+ KafClaw supports 11 LLM providers through a unified ` LLMProvider ` interface. Most use the OpenAI-compatible API format. Providers are identified by canonical IDs and selected via model strings in the format ` provider-id/model-name ` .
358366
359367``` go
360368type LLMProvider interface {
@@ -363,26 +371,66 @@ type LLMProvider interface {
363371 Speak (ctx, *TTSRequest) (*TTSResponse, error )
364372 DefaultModel () string
365373}
374+ ```
366375
367- type Embedder interface {
368- Embed (ctx, *EmbeddingRequest) (*EmbeddingResponse, error )
369- }
376+ ### Supported Providers
377+
378+ | Provider ID | Auth | Default Base |
379+ | ---| ---| ---|
380+ | ` claude ` | API key | ` https://api.anthropic.com/v1 ` |
381+ | ` openai ` | API key | _ (configured)_ |
382+ | ` gemini ` | API key | Google AI Studio |
383+ | ` gemini-cli ` | OAuth | _ (via Gemini CLI)_ |
384+ | ` openai-codex ` | OAuth | _ (via Codex CLI)_ |
385+ | ` xai ` | API key | ` https://api.x.ai/v1 ` |
386+ | ` scalytics-copilot ` | API key + base | _ (configured)_ |
387+ | ` openrouter ` | API key | ` https://openrouter.ai/api/v1 ` |
388+ | ` deepseek ` | API key | ` https://api.deepseek.com/v1 ` |
389+ | ` groq ` | API key | ` https://api.groq.com/openai/v1 ` |
390+ | ` vllm ` | optional key + base | _ (configured)_ |
391+
392+ For full provider setup, see [ LLM Providers Reference] ( ../reference/providers/ ) .
393+
394+ ### Provider Resolution Order
395+
396+ 1 . Per-agent model (` agents.list[].model.primary ` )
397+ 2 . Task-type routing (` model.taskRouting[category] ` )
398+ 3 . Global model (` model.name ` )
399+ 4 . Legacy OpenAI fallback
400+
401+ ### Managing Credentials
402+
403+ ``` bash
404+ # API key providers
405+ kafclaw models auth set-key --provider claude --key sk-ant-...
406+
407+ # OAuth providers (Gemini, Codex)
408+ kafclaw models auth login --provider gemini
370409```
371410
372- ### Capabilities
411+ See [ Models CLI Reference] ( ../reference/models-cli/ ) for all auth commands.
412+
413+ ### Middleware Chain
414+
415+ A configurable middleware chain runs between the agent loop and the LLM provider:
373416
374- | Capability | Endpoint | Default Model |
375- | ------------| ----------| ---------------|
376- | Chat completion | ` /chat/completions ` | ` anthropic/claude-sonnet-4-5 ` |
377- | Audio transcription | ` /audio/transcriptions ` | ` whisper-1 ` |
378- | Text-to-speech | ` /audio/speech ` | ` tts-1 ` (voice: nova, format: opus) |
379- | Embeddings | ` /embeddings ` | ` text-embedding-3-small ` |
417+ - ** Content Classifier** — sensitivity tagging and model rerouting
418+ - ** Prompt Guard** — PII/secret scanning (warn, redact, or block)
419+ - ** Output Sanitizer** — response redaction and deny pattern filtering
420+ - ** FinOps Recorder** — per-request cost calculation and budget warnings
380421
381- ### API Key Fallback Chain
422+ See [ Chat Middleware Reference ] ( ../reference/middleware/ ) for configuration.
382423
383- 1 . ` cfg.Providers.OpenAI.APIKey ` (config or ` KAFCLAW_OPENAI_API_KEY ` )
384- 2 . ` OPENAI_API_KEY ` environment variable
385- 3 . ` OPENROUTER_API_KEY ` environment variable
424+ ### Token & Cost Tracking
425+
426+ Token usage and cost are tracked per request, per provider, per day in the timeline database.
427+
428+ ``` bash
429+ kafclaw models stats # today's usage
430+ kafclaw models stats --days 7 # 7-day trend
431+ kafclaw status # includes provider info
432+ kafclaw doctor # warns on low rate limits
433+ ```
386434
387435---
388436
0 commit comments