Usage
Arguments
Agent or program to run after the model is ready.Supported agents:
claude— Claude Code (Anthropic’s AI coding agent)codex— Codex CLI (OpenAI’s coding agent)openclaw— OpenClaw (open-source autonomous AI agent)
Arguments forwarded to the program. Use
-- to separate them from jan options.Options
Model Selection
Model ID to load. Omit to pick interactively from installed models.Can be:
- A model ID from
jan models list(e.g.qwen3.5-35b-a3b) - A HuggingFace repo ID (e.g.
Qwen/Qwen2.5-35B-Instruct-GGUF) — will auto-download
Path to the inference binary. Auto-discovered from Jan data folder when omitted.
Server Configuration
Port the model server listens on.
API key for the model server. Exported as
OPENAI_API_KEY and ANTHROPIC_AUTH_TOKEN.Performance Configuration
GPU layers to offload.
-1: All layers (full GPU acceleration)0: CPU only> 0: Specific number of layers to offload
Context window size in tokens.
Setting
--ctx-size explicitly disables auto-fit. Omit this option when launching Claude to enable auto-fit by default.Auto-fit context to available VRAM.Default behavior:
- When launching
claude:--fitdefaults totrue(unless--ctx-sizeis set explicitly) - When launching other programs:
--fitdefaults tofalse
Output Control
Print full server logs (llama.cpp / mlx output) instead of the loading spinner.
Examples
Environment Variables
Depending on the launched agent, Jan sets different environment variables:For Claude Code & Codex
For OpenClaw
Jan configures OpenClaw via~/.openclaw/openclaw.json instead of environment variables:
OPENAI_API_KEY,OPENAI_BASE_URLANTHROPIC_API_KEY,ANTHROPIC_AUTH_TOKEN,ANTHROPIC_OAUTH_TOKENGEMINI_API_KEY,MISTRAL_API_KEY,GROQ_API_KEYXAI_API_KEY,OPENROUTER_API_KEY
Output
Loading
For OpenClaw
Workflow
When you runjan launch:
- Model Selection: Pick a model (interactively or via
--model) - Model Loading: Start the model server with optimized settings
- Environment Setup:
- For Claude/Codex: Set environment variables
- For OpenClaw: Write
~/.openclaw/openclaw.json
- Agent Launch: Execute the chosen program with the local model pre-wired
- Cleanup: When the agent exits, stop the model server
Supported Agents
Claude Code
ANTHROPIC_AUTH_TOKENset to your API key (default:jan)ANTHROPIC_BASE_URLpointing to local model- All Anthropic model defaults (
OPUS,SONNET,HAIKU) set to your local model - Auto-fit enabled by default for maximum context window
Codex CLI
OPENAI_API_KEYset to your API key (default:jan)OPENAI_BASE_URLpointing to local modelOPENAI_MODELset to your local model ID
OpenClaw
~/.openclaw/openclaw.jsonconfigured with Jan provider- Default model set to
jan/<model_id> - OpenClaw’s TUI automatically started (unless you pass custom args)
Performance Tips
Maximize Context for Claude Code
Custom Context Size
--ctx-size explicitly disables auto-fit and uses your specified size.
CPU-Only Mode
HuggingFace Auto-Download
Download and launch with a HuggingFace model:- Fetch available GGUF files
- Let you pick a quantization
- Download the model
- Start the model server
- Launch Claude Code
Troubleshooting
Agent Not Found
PATH.
Model Not Found
Binary Not Found
--bin.
OpenClaw Config Override
If OpenClaw still uses a cloud provider instead of Jan: Solution: Check for environment variables that override the config:.bashrc, .zshrc, etc.).
See Also
Serve Command
Run models without launching an agent
Commands Reference
Complete reference for all CLI commands