.env file.
Default: Claude subscription
Out of the box, ollim-bot uses your Claude subscription via Claude Code OAuth. The model you get depends on your subscription tier:
Switch models at runtime with the
/model slash command in Discord:
sonnet
currently maps to Sonnet 4.6, opus to Opus 4.6, haiku to Haiku 4.5.
Claude Code may fall back to Sonnet if you hit your Opus usage threshold
on a subscription plan.
Alternative subscriptions
Don’t want a Claude subscription? Several providers offer their own coding subscriptions with Anthropic Messages API-compatible endpoints. Set two environment variables and ollim-bot uses their models instead — no code changes.
All of these use the same pattern —
ANTHROPIC_BASE_URL and
ANTHROPIC_AUTH_TOKEN in your .env file:
.env (Z.AI example)
Z.AI GLM setup
Z.AI GLM setup
.env
Qwen / Alibaba Cloud setup
Qwen / Alibaba Cloud setup
.env
MiniMax setup
MiniMax setup
.env
Kimi / Moonshot AI setup
Kimi / Moonshot AI setup
.env
Pay-per-token providers
If you prefer paying for what you use instead of a flat subscription:DeepSeek setup
DeepSeek setup
.env
ollama pull deepseek-v3.2).OpenRouter setup
OpenRouter setup
.env
openrouter/free auto-routes to a
compatible free model. The empty ANTHROPIC_API_KEY= prevents
Claude Code from authenticating directly with Anthropic. Only
Claude models are guaranteed to work — non-Claude models require
a translation proxy.Self-hosted models
Run models locally for full data sovereignty — no tokens leave your network. As of early 2026, all three major inference backends natively support the Anthropic Messages API with tool calling. All self-hosted setups use the same.env pattern:
Ollama
Ollama
Ollama (v0.17+) runs open models locally with
a native Anthropic-compatible endpoint, tool calling, and streaming.Pull a model before starting the bot — the bot reports a model
error if it starts before the pull finishes:If you used Docker, prefix commands with Then add these variables to your v0.17 (February 2026) ships a new inference engine with up to 40%
faster prompt processing, improved multi-GPU tensor parallelism, and
better KV cache management for long conversations.Tool use works well with larger models — expect tinkering with
smaller ones. Local inference is still slower than
cloud providers. Not recommended as a primary backend for a bot
that needs sub-second response times.Once your
- Install script
- Docker (recommended)
docker exec ollama:.env:.env
Ollama model names use the Ollama registry format (e.g.,
qwen3.5:2b, qwen3.5:latest) — not HuggingFace model IDs.
Browse available models at ollama.com/search..env is configured, return to
step 6 of the quickstart
to start the bot.vLLM
vLLM
vLLM (v0.16+) exposes a native Anthropic
v0.16 (February 2026) adds async scheduling with pipeline
parallelism for ~31% throughput improvement. See the
vLLM Claude Code integration docs
for full setup.
/v1/messages endpoint with tool calling — the best option for
production multi-GPU deployments:.env
llama.cpp server
llama.cpp server
llama.cpp server
added Anthropic Messages API support in January 2026 — the most
lightweight option for single-GPU setups:Supports tools, vision, streaming, and token counting. Up to 35%
faster with NVFP4/FP8 quantization on NVIDIA GPUs. See the
Hugging Face walkthrough
for setup details.
.env
Bifrost proxy
Bifrost proxy
If your inference server only speaks OpenAI Chat Completions,
route through a Bifrost gateway
— it translates to Anthropic format automatically with sub-millisecond
overhead, load balancing, and a built-in web UI.Bifrost is open source (Apache 2.0) and supports OpenAI, Ollama,
and vLLM backends among others.
.env
Recommended models for self-hosting
Pick based on your hardware. For reliable tool calling, use high-quality quantizations (q8 or fp16 — these preserve the precision models need for structured output like tool calls). Models marked “MoE” (Mixture of Experts) only activate a fraction of their total parameters per request — so an 80B model with 3B active runs on hardware sized for 3B, not 80B.The Ollama name column shows the tag to use with
ollama pull. Models
marked ”—” are not yet available on Ollama — use vLLM or llama.cpp with the
HuggingFace model ID instead. Check ollama.com/search
for current availability.Model version pinning
By default, model aliases (opus, sonnet, haiku) resolve to the latest
version. Pin specific versions with these environment variables:
These also work with alternative providers — set them to the provider’s
model IDs (e.g.
glm-4.7, deepseek-chat, kimi-k2.5).
Claude model IDs by provider
Claude model IDs by provider
.env (Bedrock example)
Per-routine model override
Background routines can override the model in their YAML frontmatter:routines/quick-email-check.md
model field accepts aliases (opus, sonnet, haiku) and only
applies to background routines. See Routines
for all frontmatter fields.
Choosing a model
For most ollim-bot use, Sonnet 4.6 handles tool calling, scheduling, and conversation as well as Opus 4.6 — at 40% of the cost. Opus pulls ahead on deep reasoning and complex multi-step debugging. Haiku 4.5 is ideal for lightweight background routines where speed matters more than depth.Haiku has a 200k context window (vs. 1M for Sonnet and Opus). If your main session exceeds 200k tokens, the bot automatically upgrades interactive forks to sonnet to avoid failures. This makes haiku best suited for short-lived background routines rather than long interactive sessions.
Full agentic benchmark comparison
Full agentic benchmark comparison
All scores use extended/adaptive thinking unless noted. Benchmarks are
selected for relevance to agentic tool-calling bots like ollim-bot.
Key pattern: Sonnet 4.6 matches or beats Opus on practical tool
calling (tau2-bench, MCP Atlas, Finance Agent, GDPval-AA). Opus leads
on deep reasoning (GPQA, ARC-AGI-2, Humanity’s Last Exam) and
long-context retrieval — tasks that matter for complex debugging, not
typical daily bot interactions.Haiku 4.5 achieves 73.3% on SWE-bench Verified — matching Claude
Sonnet 4.5 — at one-third the cost and 4-5x the speed. It reaches ~90%
of Sonnet 4.5’s agentic coding performance per Augment’s evaluation.Sources:
Anthropic Opus 4.6,
Anthropic Sonnet 4.6,
Anthropic Haiku 4.5,
Vellum benchmarks,
Anthropic model overview.
Scores current as of February 2026.
Claude pricing
For most users, a Claude subscription costs less than API pay-as-you-go. The average Claude Code developer uses the equivalent of $130/month in API tokens — covered by a $20 Pro plan.On the Pro plan, Claude Code may fall back from Opus to Sonnet when you
hit a usage threshold. The exact limit is not published. Max plans have
higher thresholds — Max 20x rarely triggers fallback.
API token pricing and breakeven analysis
API token pricing and breakeven analysis
Per million tokens (standard on-demand):$6/day ($130/month) in API-equivalent costs, and the 90th percentile
is under $12/day (~$260/month). Pro at $20/month covers what would be
$130+ on the API — a subscription is the clear winner for regular use.API pay-as-you-go only wins at very low usage (under ~3M tokens/month on
Sonnet) or when you need guaranteed access without rate limit resets.Source: Anthropic API pricing,
Claude Code costs.
Extended thinking tokens are billed at output token rates. Long context
(>200K input) doubles the input cost and adds 50% to the output cost.Breakeven analysis (assuming 3:1 input-to-output ratio):
For context, Anthropic reports the average Claude Code developer uses
Advanced provider options
If you need pay-as-you-go API billing, cloud provider infrastructure, or a custom LLM gateway, these options are available but require more setup.Anthropic API key
Anthropic API key
For pay-as-you-go billing instead of a subscription:This bypasses Claude Code OAuth entirely. You pay per token at
Anthropic’s API rates.
.env
Amazon Bedrock
Amazon Bedrock
Set these environment variables in your Bedrock supports five authentication methods: AWS CLI config, environment
variable access keys, SSO profiles, Management Console credentials, and
Bedrock API keys (
.env file:.env
AWS_BEARER_TOKEN_BEDROCK).IAM permissions required: bedrock:InvokeModel,
bedrock:InvokeModelWithResponseStream, bedrock:ListInferenceProfiles.For full IAM policy details, credential chain options, and guardrail
configuration, see the
Claude Code Bedrock docs.Google Vertex AI
Google Vertex AI
Set these environment variables in your Authenticate with For full GCP setup, region-specific configuration, and credential details,
see the
Claude Code Vertex AI docs.
.env file:.env
gcloud auth application-default login or provide a
service account key via GOOGLE_APPLICATION_CREDENTIALS.IAM role required: roles/aiplatform.userModel access approval on Vertex AI can take 24–48 hours. Not all models
are available in all regions.
Custom LLM gateway
Custom LLM gateway
Point ollim-bot at any endpoint that implements the
Anthropic Messages API —
a Bifrost gateway, vLLM, or
your own gateway.The gateway must expose
.env
/v1/messages and forward the anthropic-beta
and anthropic-version headers. For general LLM gateway setup, see the
Claude Code LLM gateway docs.Cross-provider pricing
Cross-provider pricing
Global endpoint pricing is identical across Anthropic API, Amazon Bedrock,
and Google Vertex AI — no markup. Regional endpoints add a 10% premium
for data residency compliance.Per million tokens (global endpoints):
Feature availability:
Choose based on your infrastructure, not pricing — the per-token cost
is the same. Bedrock and Vertex AI add value through IAM integration,
compliance frameworks, and provisioned throughput for predictable
workloads. The Anthropic API gets new features and models first.Source: Anthropic pricing,
Bedrock pricing,
Vertex AI pricing.
Pricing current as of February 2026.
Next steps
Configuration reference
All environment variables and configuration options.
Self-host ollim-bot
Fork, configure, and deploy your own instance.
Routines
Per-routine model overrides and background fork configuration.
Slash commands
The /model command and other runtime controls.
