Skip to content

LLM Provider Reference

Per-provider configuration for all backends supported by kdeps. Backend and API keys go in ~/.kdeps/config.yaml. See LLM Backends for routing, allowlists, and streaming.

Local Backends

Llamafile (Default)

The file backend is the default: models run as llamafiles - single self-contained binaries that kdeps downloads to ~/.kdeps/models/ and serves locally as an OpenAI-compatible server. No server install, no API key.

yaml
# ~/.kdeps/config.yaml
llm:
  backend: file   # this is the default - the line can be omitted entirely

Model names like llama3.2:1b are registry aliases resolved to Mozilla's HuggingFace llamafiles (kdeps llamafile list shows all; kdeps llamafile update refreshes the registry). The chat.model field also accepts a direct URL or a path to a .llamafile.

When building Docker images, the llamafiles for all chat models are pre-baked into the image - see Docker deployment.

GGUF (llama.cpp)

The gguf backend serves GGUF model files via llama-server (llama.cpp). Full parity with the file backend: alias resolution, URL download with progress bar, shared cache at ~/.kdeps/models/. llama-server is automatically downloaded and cached on first use — no manual install needed. Override with KDEPS_LLAMA_SERVER_BIN for a custom binary.

yaml
# ~/.kdeps/config.yaml
llm:
  backend: gguf
AliasModelQuantSize
qwen3.5-4bQwen3.5 4BQ5_K_S~3.1 GB
qwen3.5-8bQwen3.5 8BQ4_K_M~5.0 GB
llama3.2-3bLlama 3.2 3B InstructQ5_K_M~2.4 GB
llama3.1-8bLlama 3.1 8B InstructQ4_K_M~4.9 GB
phi4-miniPhi-4 MiniQ5_K_M~2.7 GB
gemma3-4bGemma 3 4BQ5_K_M~3.1 GB
mistral-7bMistral 7B v0.3Q4_K_M~4.4 GB
deepseek-r1-7bDeepSeek-R1 Distill 7BQ4_K_M~5.0 GB

The chat.model field also accepts a direct HuggingFace URL, an absolute/relative path to a .gguf, or a bare filename looked up in ~/.kdeps/models/.

Set KDEPS_GGUF_CTX_SIZE to override the context window (default: llama-server default).

Ollama (opt-in)

yaml
# ~/.kdeps/config.yaml
llm:
  backend: ollama
  # base_url: http://custom-ollama:11434   # optional override

When building Docker images, Ollama is installed when backend: ollama is set. The installOllama workflow flag can force or suppress this:

yaml
# workflow.yaml
settings:
  agentSettings:
    installOllama: true  # bake the ollama server into the image

Provider-specific resource options:

FieldTypeDescription
ollamaThinkboolEnable extended thinking (model must support it)
ollamaKeepAlivestringKeep model loaded after request (e.g. "5m", "-1" = forever, "0" = unload immediately)
ollamaPullModelboolAuto-pull model if not present locally
ollamaPullTimeoutstringTimeout for model pull (e.g. "10m")

Cloud Backends

Any API that implements the OpenAI chat completions API works with kdeps.

OpenAI

yaml
# ~/.kdeps/config.yaml
llm:
  backend: openai
  openai_api_key: sk-...
ModelDescription
gpt-4oLatest GPT-4 Omni
gpt-4o-miniSmaller, faster GPT-4
gpt-4-turboGPT-4 Turbo
gpt-3.5-turboFast, cost-effective

Provider-specific resource options:

FieldTypeDescription
openAILegacyMaxTokensboolSend max_tokens instead of max_completion_tokens (for Azure and older-compat servers)

Anthropic (Claude)

yaml
# ~/.kdeps/config.yaml
llm:
  backend: anthropic
  anthropic_api_key: sk-ant-...
ModelDescription
claude-sonnet-4-20250514Latest Claude Sonnet 4
claude-3-5-sonnet-20241022Claude 3.5 Sonnet
claude-3-opus-20240229Most capable Claude 3
claude-3-haiku-20240307Fast, efficient

Provider-specific resource options:

FieldTypeDescription
promptCachingboolAdd prompt-caching-2024-07-31 beta header for server-side caching
anthropicExtendedOutputboolEnable 128K output tokens (adds interleaved-thinking-2025-05-14 header)
anthropicBetaHeaderslistAdditional anthropic-beta header values
scenario[].cacheControlstringSet to "ephemeral" to mark a scenario message as a cache boundary

See LLM Backends - Anthropic for examples.

Google (Gemini / Vertex AI)

yaml
# ~/.kdeps/config.yaml
llm:
  backend: google
  google_api_key: ...   # AI Studio key; omit to use Application Default Credentials for Vertex AI
ModelDescription
gemini-1.5-proLatest Gemini Pro
gemini-1.5-flashFast inference
gemini-proStandard Gemini

Vertex AI: Set googleCloudProject and googleCloudLocation on the chat: resource to route to Vertex AI instead of AI Studio. See LLM Backends - Vertex AI.

Provider-specific resource options:

FieldTypeDescription
googleCachedContentstringName of a Google AI CachedContent resource to attach
googleHarmThresholdintSafety filter level: 0=default, 1=block-none, 2=block-few, 3=block-some, 4=block-most
googleCloudProjectstringVertex AI GCP project ID
googleCloudLocationstringVertex AI region (e.g. us-central1)

Mistral

yaml
# ~/.kdeps/config.yaml
llm:
  backend: mistral
  mistral_api_key: ...
ModelDescription
mistral-large-latestMost capable
mistral-medium-latestBalanced
mistral-small-latestFast, efficient
open-mistral-7bOpen-source 7B
open-mixtral-8x7bMoE model

Groq

Ultra-fast inference with Groq hardware.

yaml
# ~/.kdeps/config.yaml
llm:
  backend: groq
  groq_api_key: ...
ModelDescription
llama-3.1-70b-versatileLlama 3.1 70B
llama-3.1-8b-instantLlama 3.1 8B (fastest)
mixtral-8x7b-32768Mixtral with 32K context
gemma2-9b-itGoogle Gemma 2 9B

Together AI

yaml
# ~/.kdeps/config.yaml
llm:
  backend: together
  together_api_key: ...
ModelDescription
meta-llama/Meta-Llama-3.1-70B-Instruct-TurboLlama 3.1 70B
meta-llama/Meta-Llama-3.1-8B-Instruct-TurboLlama 3.1 8B
mistralai/Mixtral-8x7B-Instruct-v0.1Mixtral 8x7B
Qwen/Qwen2-72B-InstructQwen2 72B

Perplexity

Search-augmented LLM responses.

yaml
# ~/.kdeps/config.yaml
llm:
  backend: perplexity
  perplexity_api_key: ...
ModelDescription
llama-3.1-sonar-large-128k-onlineLarge with web search
llama-3.1-sonar-small-128k-onlineSmall with web search
llama-3.1-sonar-large-128k-chatLarge chat only

Cohere

yaml
# ~/.kdeps/config.yaml
llm:
  backend: cohere
  cohere_api_key: ...
ModelDescription
command-r-plusMost capable
command-rFast and capable
commandStandard
command-lightFast, efficient

DeepSeek

yaml
# ~/.kdeps/config.yaml
llm:
  backend: deepseek
  deepseek_api_key: ...
ModelDescription
deepseek-v4-proFlagship
deepseek-v4-flashFast
deepseek-coderCode generation

xAI (Grok)

yaml
# ~/.kdeps/config.yaml
llm:
  backend: xai
  xai_api_key: xai-...
ModelDescription
grok-2Grok 2
grok-betaGrok beta
grok-vision-betaGrok with vision

OpenRouter

Access 100+ models from multiple providers through a single API.

yaml
# ~/.kdeps/config.yaml
llm:
  backend: openrouter
  openrouter_api_key: sk-or-...

Model names use the provider/model format, e.g. openai/gpt-4o, anthropic/claude-3.5-sonnet, meta-llama/llama-3.1-70b-instruct. See openrouter.ai/models for the full list.

M365 Copilot

Talks to Microsoft 365 Copilot's chat service - a SignalR-over-WebSocket API, not a REST endpoint. kdeps runs a small local OpenAI-compatible server in front of it (m365 backend), so it plugs into the same chat: resource and agent-loop paths as any other provider.

yaml
# ~/.kdeps/config.yaml
llm:
  backend: m365

There is no api_key field - authentication is a signed-in Microsoft 365 account, not an API key.

Agent-loop mode (recommended): sign in through a real browser window. The first time you pick an m365 model (kdeps --model m365-copilot --backend m365, or /model m365-copilot in the REPL) with no cached session yet, kdeps opens a visible Chrome window at the Microsoft login page and waits for you to complete sign-in yourself - password, MFA app, passkey, SSO tile, whatever your tenant requires. Nothing is read from or written to a credentials file for this path; kdeps never sees your password. Once you're in, the resulting session is cached at ~/.config/kdeps/m365/token-cache.json and refreshed silently from then on

  • every later launch goes straight to the model, no browser window. Run /login in the REPL any time to force a fresh sign-in (switch accounts, recover a revoked session).

The Chromium driver itself is installed automatically on first use if it's missing - no manual playwright install chromium step required. Override which browser launches with CHROMIUM_PATH, and the persistent browser profile location with M365_BROWSER_PROFILE.

Linux only: downloading Chromium isn't enough - it also needs a handful of shared libraries the OS doesn't ship by default. On Debian/Ubuntu:

bash
sudo apt-get install -y libnss3 libnspr4 libasound2t64

(On older Debian/Ubuntu releases the package is libasound2 instead of libasound2t64.) If these are missing, kdeps' launch error names the exact package manager command for your distro - Playwright detects it directly from the host, so trust that command over this list if they differ.

Headless hosts (CI, servers with no display): scripted secrets.json fallback. Write ~/.config/kdeps/m365/secrets.json yourself before running kdeps:

json
// ~/.config/kdeps/m365/secrets.json
{
  "email": "you@yourtenant.com",
  "password": "your-password",
  "mfaSecret": "your-TOTP-seed"
}

mfaSecret is the TOTP seed (the same secret you'd scan into an authenticator app), not a one-time code - kdeps generates codes from it itself, so your account needs authenticator-app MFA enrolled (not push/SMS-only). When this file is present, kdeps drives a headless Chromium browser through the Azure AD login form with those credentials instead of opening a visible window, caching the resulting refresh token the same way. Workflow mode's chat: resource has no terminal or display to prompt on, so it always requires this file to already exist.

Override paths with M365_CACHE_FILE, M365_SECRETS_FILE, and M365_BROWSER_PROFILE. Tool calling routes through an auto-provisioned Copilot Studio agent unless the resolved model tone is a Claude_* tone, in which case kdeps stays agent-less to preserve that tone (attaching an agent forces GPT-5).

Reasoning-tone models (think-deeper, *-think-deeper) stream their chain-of-thought summary as live reasoning feedback, same as native extended-thinking models -- visible in the agent-loop REPL automatically (thinking is on by default), or via reasoning_content in the raw OpenAI-compatible response for direct API use.

ModelDescription
m365-copilotDefault - service picks the model
quickFast, lower-latency responses
think-deeperExtended reasoning
claude-sonnetClaude Sonnet via M365
claude-opusClaude Opus via M365
gpt-5.5, gpt-5.4, gpt-5.3, gpt-5.2GPT-5.x family, -quick/-think-deeper variants

Self-Hosted Solutions

kdeps works with any self-hosted solution that implements the OpenAI API: vLLM, Text Generation Inference (TGI), LocalAI, LlamaCpp Server.

yaml
# ~/.kdeps/config.yaml
llm:
  backend: openai
  base_url: http://your-vllm-server:8000/v1

Custom Base URL

Override the default API URL via base_url:

yaml
# Azure OpenAI
llm:
  backend: openai
  base_url: "https://my-resource.openai.azure.com/openai/deployments/my-deployment"
  openai_api_key: ...

See Also

Released under the Apache 2.0 License.