{"repo": "bug-ops/zeph", "files": {"book/src/guides/cloud-provider.md": {"81e234b1d78f3b8d2584e549d4f591c348c1e55a": {"t": 1785674608.2857869, "n": 5375, "h": "f908f6f7b618fe67", "c": "# Use a Cloud Provider\n\nConnect Zeph to Claude, OpenAI, Gemini, or any OpenAI-compatible API instead of local Ollama.\n\n> **Breaking change (v0.17.0):** The old `[llm.cloud]`, `[llm.orchestrator]`, and `[llm.router]` config sections have been removed. Run `zeph --migrate-config` to automatically convert your config file.\n\n## Claude\n\n```bash\nZEPH_CLAUDE_API_KEY=sk-ant-... zeph\n```\n\nOr in config:\n\n```toml\n[llm]\n[[llm.providers]]\ntype = \"claude\"\nmodel = \"claude-sonnet-5\"\nmax_tokens = 4096\n# server_compaction = true # Server-side context compaction (Claude API beta)\n# enable_extended_context = true # 1M token context window (Claude Opus and Sonnet models, not Haiku)\n```\n\nClaude does not support embeddings. Use a multi-provider setup to combine Claude chat with Ollama embeddings, or use OpenAI embeddings.\n\n### Server-Side Compaction\n\nEnable `server_compaction = true` to let the Claude API manage context length on the server side. When the context approaches the model's limit, Claude produces a compact summary in-place. Zeph surfaces the compaction event in the TUI and via the `server_compaction_events` metric.\n\n> **Note:** Server compaction is not supported on Haiku models. When enabled on Haiku, Zeph emits a `WARN` and falls back to client-side compaction automatically.\n\n### 1M Extended Context\n\nFor Claude Opus and Sonnet models (not Haiku), enable `enable_extended_context = true` to unlock the 1M token context window. The `auto_budget` feature scales accordingly. Enable with `--extended-context` CLI flag or in the provider entry in config.\n\n## Gemini\n\n```bash\nZEPH_GEMINI_API_KEY=AIza... zeph\n```\n\nOr in config:\n\n```toml\n[llm]\n[[llm.providers]]\ntype = \"gemini\"\nmodel = \"gemini-2.0-flash\" # or \"gemini-2.5-pro\" for extended thinking\nmax_tokens = 8192\n# embedding_model = \"text-embedding-004\" # enable Gemini-native embeddings\n# thinking_level = \"medium\" # Gemini 2.5+ only: minimal, low, medium, high\n```\n\nGemini supports embeddings natively when `embedding_model` is set — no separate Ollama instance required. See [LLM Providers — Gemini](../concepts/providers.md#gemini) for the full feature matrix.\n\n## OpenAI\n\n```bash\nZEPH_OPENAI_API_KEY=sk-... zeph\n```\n\n```toml\n[llm]\n[[llm.providers]]\ntype = \"openai\"\nbase_url = \"https://api.openai.com/v1\"\nmodel = \"gpt-5.2\"\nmax_tokens = 4096\nembedding_model = \"text-embedding-3-small\"\nreasoning_effort = \"medium\" # optional: low, medium, high (for o3, etc.)\n```\n\nWhen `embedding_model` is set, Qdrant subsystems use it automatically for skill matching and semantic memory.\n\n### o-Series Models (o1, o3, o4)\n\nOpenAI's o-series reasoning models have different configuration requirements from standard LLMs:\n\n```toml\n[[llm.providers]]\ntype = \"openai\"\nmodel = \"o3-mini\"\nmax_completion_tokens = 16000 # Required: cap reasoning token budget (max 100,000)\n# Note: o-series does not support:\n# - max_tokens (use max_completion_tokens instead)\n# - temperature (always 1.0)\n# - top_p (always 1.0)\n# - system prompts (limited support — use sparingly)\n```\n\n**Cost control with reasoning models:**\n\nThe `max_completion_tokens` parameter is critical for o-series models because reasoning tokens are 10–20× more expensive than regular completion tokens. Set a hard cap based on your task complexity:\n\n- **Simple tasks** (math, string manipulation): `max_completion_tokens = 2000`\n- **Moderate tasks** (code analysis, data retrieval): `max_completion_tokens = 8000`\n- **Complex reasoning** (multi-step analysis): `max_completion_tokens = 16000+`\n\nWithout a cap, reasoning models can generate 100,000+ tokens per request, leading to unexpected bills. Start conservatively and increase if the model runs out of tokens mid-reasoning.\n\n**Latency expectations:**\n\nReasoning models typically take 5–30 seconds per request. If you pair o-series with faster models via cascading, configure the cascade to skip o-series for simple queries:\n\n```toml\n[llm]\nrouting = \"cascade\"\n\n[[llm.providers]]\nname = \"fast\"\ntype = \"openai\"\nmodel = \"gpt-4o-mini\"\n\n[[llm.providers]]\nname = \"reasoning\"\ntype = \"openai\"\nmodel = \"o3-mini\"\nmax_completion_tokens = 8000\n```\n\n## Compatible APIs\n\nUse `type = \"compatible\"` with the appropriate `base_url`:\n\n```toml\n[llm]\n[[llm.providers]]\nname = \"groq\"\ntype = \"compatible\"\nbase_url = \"https://api.groq.com/openai/v1\"\nmodel = \"llama-3.3-70b-versatile\"\nmax_tokens = 4096\n```\n\nCommon `base_url` values:\n\n| Provider | `base_url` |\n|---|---|\n| Together AI | `https://api.together.xyz/v1` |\n| Groq | `https://api.groq.com/openai/v1` |\n| Fireworks | `https://api.fireworks.ai/inference/v1` |\n| Local vLLM | `http://localhost:8000/v1` |\n\n## Hybrid Setup\n\nEmbeddings via free local Ollama, chat via paid Claude API:\n\n```toml\n[llm]\nrouting = \"cascade\" # try cheapest provider first\n\n[[llm.providers]]\nname = \"local\"\ntype = \"ollama\"\nmodel = \"qwen3:8b\"\nembedding_model = \"qwen3-embedding\"\nembed = true # use this provider for embeddings\n\n[[llm.providers]]\nname = \"cloud\"\ntype = \"claude\"\nmodel = \"claude-sonnet-5\"\nmax_tokens = 4096\ndefault = true # use this provider for chat by default\n```\n\nSee [Adaptive Inference](../advanced/adaptive-inference.md) for routing strategy options.\n\n## Interactive Setup\n\nRun `zeph init` and select your provider in Step 2. The wizard handles model names, base URLs, and API keys. See [Configuration Wizard](../getting-started/wizard.md).\n"}, "df263531880da41d1224c6b642e7a12e6e29e75e": {"t": 1785846900.9195344, "n": 5375, "h": "f908f6f7b618fe67", "c": "# Use a Cloud Provider\n\nConnect Zeph to Claude, OpenAI, Gemini, or any OpenAI-compatible API instead of local Ollama.\n\n> **Breaking change (v0.17.0):** The old `[llm.cloud]`, `[llm.orchestrator]`, and `[llm.router]` config sections have been removed. Run `zeph --migrate-config` to automatically convert your config file.\n\n## Claude\n\n```bash\nZEPH_CLAUDE_API_KEY=sk-ant-... zeph\n```\n\nOr in config:\n\n```toml\n[llm]\n[[llm.providers]]\ntype = \"claude\"\nmodel = \"claude-sonnet-5\"\nmax_tokens = 4096\n# server_compaction = true # Server-side context compaction (Claude API beta)\n# enable_extended_context = true # 1M token context window (Claude Opus and Sonnet models, not Haiku)\n```\n\nClaude does not support embeddings. Use a multi-provider setup to combine Claude chat with Ollama embeddings, or use OpenAI embeddings.\n\n### Server-Side Compaction\n\nEnable `server_compaction = true` to let the Claude API manage context length on the server side. When the context approaches the model's limit, Claude produces a compact summary in-place. Zeph surfaces the compaction event in the TUI and via the `server_compaction_events` metric.\n\n> **Note:** Server compaction is not supported on Haiku models. When enabled on Haiku, Zeph emits a `WARN` and falls back to client-side compaction automatically.\n\n### 1M Extended Context\n\nFor Claude Opus and Sonnet models (not Haiku), enable `enable_extended_context = true` to unlock the 1M token context window. The `auto_budget` feature scales accordingly. Enable with `--extended-context` CLI flag or in the provider entry in config.\n\n## Gemini\n\n```bash\nZEPH_GEMINI_API_KEY=AIza... zeph\n```\n\nOr in config:\n\n```toml\n[llm]\n[[llm.providers]]\ntype = \"gemini\"\nmodel = \"gemini-2.0-flash\" # or \"gemini-2.5-pro\" for extended thinking\nmax_tokens = 8192\n# embedding_model = \"text-embedding-004\" # enable Gemini-native embeddings\n# thinking_level = \"medium\" # Gemini 2.5+ only: minimal, low, medium, high\n```\n\nGemini supports embeddings natively when `embedding_model` is set — no separate Ollama instance required. See [LLM Providers — Gemini](../concepts/providers.md#gemini) for the full feature matrix.\n\n## OpenAI\n\n```bash\nZEPH_OPENAI_API_KEY=sk-... zeph\n```\n\n```toml\n[llm]\n[[llm.providers]]\ntype = \"openai\"\nbase_url = \"https://api.openai.com/v1\"\nmodel = \"gpt-5.2\"\nmax_tokens = 4096\nembedding_model = \"text-embedding-3-small\"\nreasoning_effort = \"medium\" # optional: low, medium, high (for o3, etc.)\n```\n\nWhen `embedding_model` is set, Qdrant subsystems use it automatically for skill matching and semantic memory.\n\n### o-Series Models (o1, o3, o4)\n\nOpenAI's o-series reasoning models have different configuration requirements from standard LLMs:\n\n```toml\n[[llm.providers]]\ntype = \"openai\"\nmodel = \"o3-mini\"\nmax_completion_tokens = 16000 # Required: cap reasoning token budget (max 100,000)\n# Note: o-series does not support:\n# - max_tokens (use max_completion_tokens instead)\n# - temperature (always 1.0)\n# - top_p (always 1.0)\n# - system prompts (limited support — use sparingly)\n```\n\n**Cost control with reasoning models:**\n\nThe `max_completion_tokens` parameter is critical for o-series models because reasoning tokens are 10–20× more expensive than regular completion tokens. Set a hard cap based on your task complexity:\n\n- **Simple tasks** (math, string manipulation): `max_completion_tokens = 2000`\n- **Moderate tasks** (code analysis, data retrieval): `max_completion_tokens = 8000`\n- **Complex reasoning** (multi-step analysis): `max_completion_tokens = 16000+`\n\nWithout a cap, reasoning models can generate 100,000+ tokens per request, leading to unexpected bills. Start conservatively and increase if the model runs out of tokens mid-reasoning.\n\n**Latency expectations:**\n\nReasoning models typically take 5–30 seconds per request. If you pair o-series with faster models via cascading, configure the cascade to skip o-series for simple queries:\n\n```toml\n[llm]\nrouting = \"cascade\"\n\n[[llm.providers]]\nname = \"fast\"\ntype = \"openai\"\nmodel = \"gpt-4o-mini\"\n\n[[llm.providers]]\nname = \"reasoning\"\ntype = \"openai\"\nmodel = \"o3-mini\"\nmax_completion_tokens = 8000\n```\n\n## Compatible APIs\n\nUse `type = \"compatible\"` with the appropriate `base_url`:\n\n```toml\n[llm]\n[[llm.providers]]\nname = \"groq\"\ntype = \"compatible\"\nbase_url = \"https://api.groq.com/openai/v1\"\nmodel = \"llama-3.3-70b-versatile\"\nmax_tokens = 4096\n```\n\nCommon `base_url` values:\n\n| Provider | `base_url` |\n|---|---|\n| Together AI | `https://api.together.xyz/v1` |\n| Groq | `https://api.groq.com/openai/v1` |\n| Fireworks | `https://api.fireworks.ai/inference/v1` |\n| Local vLLM | `http://localhost:8000/v1` |\n\n## Hybrid Setup\n\nEmbeddings via free local Ollama, chat via paid Claude API:\n\n```toml\n[llm]\nrouting = \"cascade\" # try cheapest provider first\n\n[[llm.providers]]\nname = \"local\"\ntype = \"ollama\"\nmodel = \"qwen3:8b\"\nembedding_model = \"qwen3-embedding\"\nembed = true # use this provider for embeddings\n\n[[llm.providers]]\nname = \"cloud\"\ntype = \"claude\"\nmodel = \"claude-sonnet-5\"\nmax_tokens = 4096\ndefault = true # use this provider for chat by default\n```\n\nSee [Adaptive Inference](../advanced/adaptive-inference.md) for routing strategy options.\n\n## Interactive Setup\n\nRun `zeph init` and select your provider in Step 2. The wizard handles model names, base URLs, and API keys. See [Configuration Wizard](../getting-started/wizard.md).\n"}}, "book/src/guides/config-recipes.md": {"81e234b1d78f3b8d2584e549d4f591c348c1e55a": {"t": 1785674611.25562, "n": 13858, "h": "cacdf6d5aece251d", "c": "# Configuration Recipes\n\nCopy-paste configs for the most common Zeph setups. Each recipe shows only the sections that\ndiffer from the defaults — paste them into a new `config.toml` and run:\n\n```bash\nzeph --config config.toml\n```\n\n> **Tip:** Run `zeph init` for an interactive wizard that generates the config file for you.\n> These recipes are for when you want to start from a known baseline or understand what each\n> setting does.\n\n## Which recipe do I need?\n\n| I want to… | Recipe |\n|---|---|\n| Try Zeph with no accounts or cloud services | [1. Minimal local (Ollama)](#1-minimal-local-ollama) |\n| Use Claude API for best quality | [2. Full cloud — Claude](#2-full-cloud--claude) |\n| Use OpenAI API | [3. Full cloud — OpenAI](#3-full-cloud--openai) |\n| Use Groq, Together, vLLM, or another compatible API | [4. Compatible provider](#4-compatible-provider) |\n| Keep Ollama as primary, fall back to Claude on failure | [5. Hybrid: Ollama + Claude fallback](#5-hybrid-ollama--claude-fallback) |\n| Run multi-step agentic workflows locally | [6. Orchestrator for complex tasks](#6-orchestrator-for-complex-tasks) |\n| Code assistant with LSP and code search | [7. Coding assistant](#7-coding-assistant) |\n| Run a Telegram bot | [8. Telegram bot](#8-telegram-bot) |\n| No internet at all, maximum privacy | [9. Privacy-first (fully local)](#9-privacy-first-fully-local) |\n| Add semantic memory to any of the above | [10. Semantic memory add-on (Qdrant)](#10-semantic-memory-add-on-qdrant) |\n\n---\n\n
ollama serve), models pulled (ollama pull qwen3:8b && ollama pull qwen3-embedding).zeph vault init) with ZEPH_CLAUDE_API_KEY stored (zeph vault set ZEPH_CLAUDE_API_KEY sk-ant-...).zeph vault init) with ZEPH_OPENAI_API_KEY stored (zeph vault set ZEPH_OPENAI_API_KEY sk-...).zeph vault init then zeph vault set ZEPH_COMPATIBLE_<NAME>_API_KEY ...).ZEPH_CLAUDE_API_KEY stored./plan commands.qwen3:8b and qwen3:14b).mcpls (cargo install mcpls).ZEPH_CLAUDE_API_KEY and ZEPH_TELEGRAM_BOT_TOKEN stored.docker run -d -p 6334:6334 qdrant/qdrant.ollama serve), models pulled (ollama pull qwen3:8b && ollama pull qwen3-embedding).zeph vault init) with ZEPH_CLAUDE_API_KEY stored (zeph vault set ZEPH_CLAUDE_API_KEY sk-ant-...).zeph vault init) with ZEPH_OPENAI_API_KEY stored (zeph vault set ZEPH_OPENAI_API_KEY sk-...).zeph vault init then zeph vault set ZEPH_COMPATIBLE_<NAME>_API_KEY ...).ZEPH_CLAUDE_API_KEY stored./plan commands.qwen3:8b and qwen3:14b).mcpls (cargo install mcpls).ZEPH_CLAUDE_API_KEY and ZEPH_TELEGRAM_BOT_TOKEN stored.docker run -d -p 6334:6334 qdrant/qdrant.