# llama.cpp exposes an OpenAI-compatible API when started with llama-server. LLAMA_CPP_BASE_URL=http://localhost:8080/v1 LLAMA_CPP_MODEL=local-model # OpenAI-compatible clients still expect a key. llama.cpp does not validate it # by default, so any non-empty value is fine unless you configure auth. LLAMA_CPP_API_KEY=not-needed # Useful while studying deterministic examples. LLAMA_CPP_TEMPERATURE=0 # Separate llama.cpp embedding server, managed by `llme`. LLAMA_CPP_EMBED_BASE_URL=http://localhost:8082/v1 # Use "auto" to ask the live embedding server which model is loaded. LLAMA_CPP_EMBED_MODEL=auto LLAMA_CPP_EMBED_API_KEY=not-needed # ---- Embedding provider ---- # Pick one: llama_cpp (default), openai_compat, ai_studio. llama_cpp keeps the # legacy LLAMA_CPP_EMBED_* defaults above. openai_compat requires # EMBEDDING_BASE_URL and EMBEDDING_MODEL. EMBEDDING_PROVIDER=llama_cpp EMBEDDING_BASE_URL= EMBEDDING_MODEL= EMBEDDING_API_KEY= # AI Studio embeddings use the official google-genai SDK. # API key fallback order includes AI_STUDIO_EMBED_API_KEY, EMBEDDING_API_KEY, # AI_STUDIO_API_KEY, GEMINI_API_KEY, and GOOGLE_API_KEY. AI_STUDIO_EMBED_MODEL=gemini-embedding-2 AI_STUDIO_EMBED_API_KEY= # For gemini-embedding-2 these choose prompt prefixes; for gemini-embedding-001 # they are sent as the Google task_type. AI_STUDIO_EMBED_DOCUMENT_TASK_TYPE=RETRIEVAL_DOCUMENT AI_STUDIO_EMBED_QUERY_TASK_TYPE=RETRIEVAL_QUERY AI_STUDIO_EMBED_OUTPUT_DIMENSIONALITY= # Leave unset for defaults. For non-llama providers, the Qdrant vector name is # auto-derived from provider/model/dimension. Set to "auto" to force the same # behavior for llama/openai-compatible providers, or set a concrete vector name. # QDRANT_VECTOR_NAME=auto # Local Qdrant vector database. QDRANT_URL=http://localhost:6333 QDRANT_COLLECTION=study_docs QDRANT_DISTANCE=COSINE # Chunking defaults for text/markdown ingestion. RAG_CHUNK_CHARS=900 RAG_CHUNK_OVERLAP=150 # AI-writable knowledge base. Tools are constrained to this root. KB_ROOT=knowledge_base KB_MAX_FILE_CHARS=100000 KB_ALLOWED_SUFFIXES=.md,.txt # summarize_webpage refuses to call the model when extracted page text is larger # than this budget. Rough heuristic: 4 chars ~= 1 token, so 48000 chars is ~12K # tokens before prompt overhead in a 16K context. PAGE_SUMMARY_MAX_CHARS=48000 # Context monitoring/compaction defaults. The agent compacts around 75% so a # 16K llama.cpp context has room for the summary request and the next response. CONTEXT_WINDOW_TOKENS=16000 CONTEXT_COMPACT_TRIGGER_RATIO=0.75 CONTEXT_CHARS_PER_TOKEN=4 CONTEXT_SUMMARY_TARGET_TOKENS=1200 # ---- Multi-vendor LLM provider ---- # Pick one: llama_cpp (default), openai, anthropic, ollama, groq, openrouter, # ai_studio, openai_compat. PROVIDER_MODEL/PROVIDER_TEMPERATURE override the # vendor default. PROVIDER_BASE_URL overrides the vendor's standard URL and is # required when PROVIDER=openai_compat. PROVIDER=llama_cpp PROVIDER_MODEL= PROVIDER_TEMPERATURE=0 PROVIDER_BASE_URL= PROVIDER_API_KEY= # Optional headers, comma-separated key=value pairs (e.g. for OpenRouter). PROVIDER_EXTRA_HEADERS= # Vendor-specific API keys. Only set the ones you actually use. OPENAI_API_KEY= ANTHROPIC_API_KEY= GROQ_API_KEY= OPENROUTER_API_KEY= AI_STUDIO_API_KEY= OLLAMA_BASE_URL=http://localhost:11434/v1 OLLAMA_API_KEY=ollama # AI Studio-specific Gemini/Gemma behavior when PROVIDER=ai_studio. # Options: none (default), minimal, low, medium, high. # Gemini 2.5 Flash can disable thinking with none/budget=0; Gemini 3 can only # reduce it. Gemma 4 can still emit empty or visible thought-channel tags, so # output stripping stays enabled by default. AI_STUDIO_THINKING_LEVEL=none AI_STUDIO_THINKING_BUDGET= AI_STUDIO_INCLUDE_THOUGHTS=false AI_STUDIO_STRIP_THOUGHTS=true # ---- FastAPI server ---- API_HOST=0.0.0.0 API_PORT=8000 # Comma-separated list, or "*" to allow any origin. API_CORS_ORIGINS=* # If set, all /v1/* routes require Authorization: Bearer or X-API-Key. API_AUTH_TOKEN= # Set to "true" to make the FastAPI server use the mock graph (no LLM calls). LANGGRAPH_SERVER_MOCK=false