Skip to main content

Usage

jan launch [PROGRAM] [OPTIONS] [-- PROGRAM_ARGS...]
Start a local model, then launch an AI agent or program with environment variables automatically set to use the local model.

Arguments

program
string
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)
Omit to pick interactively from the list above.
jan launch claude
jan launch openclaw
jan launch  # Pick interactively
program_args
array
Arguments forwarded to the program. Use -- to separate them from jan options.
jan launch claude -- --help
jan launch openclaw -- tui --debug

Options

Model Selection

model
string
Model ID to load. Omit to pick interactively from installed models.
jan launch claude --model qwen3.5-35b-a3b
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
bin
string
Path to the inference binary. Auto-discovered from Jan data folder when omitted.
jan launch claude --model qwen3.5-35b --bin /usr/local/bin/llama-server

Server Configuration

port
number
default:"6767"
Port the model server listens on.
jan launch claude --model qwen3.5-35b --port 8080
api-key
string
default:"jan"
API key for the model server. Exported as OPENAI_API_KEY and ANTHROPIC_AUTH_TOKEN.
jan launch claude --model qwen3.5-35b --api-key my-secret-key

Performance Configuration

n-gpu-layers
number
default:"-1"
GPU layers to offload.
  • -1: All layers (full GPU acceleration)
  • 0: CPU only
  • > 0: Specific number of layers to offload
jan launch claude --model qwen3.5-35b --n-gpu-layers 35
ctx-size
number
default:"4096"
Context window size in tokens.
jan launch claude --model qwen3.5-35b --ctx-size 8192
Setting --ctx-size explicitly disables auto-fit. Omit this option when launching Claude to enable auto-fit by default.
fit
boolean
Auto-fit context to available VRAM.
jan launch claude --model qwen3.5-35b --fit
Default behavior:
  • When launching claude: --fit defaults to true (unless --ctx-size is set explicitly)
  • When launching other programs: --fit defaults to false

Output Control

verbose
boolean
default:"false"
Print full server logs (llama.cpp / mlx output) instead of the loading spinner.
jan launch claude --model qwen3.5-35b --verbose
jan launch claude --model qwen3.5-35b -v

Examples

# Pick agent and model interactively
jan launch

# Launch Claude Code with a specific model
jan launch claude --model qwen3.5-35b-a3b

# Launch OpenClaw
jan launch openclaw --model qwen3.5-35b-a3b

Environment Variables

Depending on the launched agent, Jan sets different environment variables:

For Claude Code & Codex

OPENAI_BASE_URL=http://127.0.0.1:6767/v1
OPENAI_API_KEY=jan
OPENAI_MODEL=qwen3.5-35b-a3b
ANTHROPIC_BASE_URL=http://127.0.0.1:6767
ANTHROPIC_AUTH_TOKEN=jan  # or ANTHROPIC_API_KEY for non-Claude agents
ANTHROPIC_DEFAULT_OPUS_MODEL=qwen3.5-35b-a3b
ANTHROPIC_DEFAULT_SONNET_MODEL=qwen3.5-35b-a3b
ANTHROPIC_DEFAULT_HAIKU_MODEL=qwen3.5-35b-a3b

For OpenClaw

Jan configures OpenClaw via ~/.openclaw/openclaw.json instead of environment variables:
{
  "models": {
    "providers": {
      "jan": {
        "baseUrl": "http://127.0.0.1:6767/v1",
        "apiKey": "jan",
        "api": "openai-completions",
        "models": [
          {
            "id": "qwen3.5-35b-a3b",
            "name": "qwen3.5-35b-a3b",
            "input": ["text"],
            "reasoning": false,
            "contextWindow": 131072,
            "maxTokens": 16384,
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            }
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "jan/qwen3.5-35b-a3b"
      }
    }
  }
}
Provider API keys are cleared to prevent overrides:
  • OPENAI_API_KEY, OPENAI_BASE_URL
  • ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_OAUTH_TOKEN
  • GEMINI_API_KEY, MISTRAL_API_KEY, GROQ_API_KEY
  • XAI_API_KEY, OPENROUTER_API_KEY

Output

Loading

✓ qwen3.5-35b-a3b ready · http://127.0.0.1:6767

  OPENAI_BASE_URL=http://127.0.0.1:6767/v1
  OPENAI_API_KEY=jan
  OPENAI_MODEL=qwen3.5-35b-a3b
  ANTHROPIC_BASE_URL=http://127.0.0.1:6767
  ANTHROPIC_AUTH_TOKEN=jan
  ANTHROPIC_DEFAULT_OPUS_MODEL=qwen3.5-35b-a3b
  ANTHROPIC_DEFAULT_SONNET_MODEL=qwen3.5-35b-a3b
  ANTHROPIC_DEFAULT_HAIKU_MODEL=qwen3.5-35b-a3b

  → Launching: claude
Then Claude Code (or your chosen agent) starts with the local model pre-configured.

For OpenClaw

✓ qwen3.5-35b-a3b ready · http://127.0.0.1:6767

  ~/.openclaw/openclaw.json → jan provider configured
  agents.defaults.model.primary = jan/qwen3.5-35b-a3b

  → Launching: openclaw tui

Workflow

When you run jan launch:
  1. Model Selection: Pick a model (interactively or via --model)
  2. Model Loading: Start the model server with optimized settings
  3. Environment Setup:
    • For Claude/Codex: Set environment variables
    • For OpenClaw: Write ~/.openclaw/openclaw.json
  4. Agent Launch: Execute the chosen program with the local model pre-wired
  5. Cleanup: When the agent exits, stop the model server

Supported Agents

Claude Code

jan launch claude --model qwen3.5-35b-a3b
Launches Anthropic’s Claude Code agent with:
  • ANTHROPIC_AUTH_TOKEN set to your API key (default: jan)
  • ANTHROPIC_BASE_URL pointing 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

jan launch codex --model qwen3.5-35b-a3b
Launches OpenAI’s Codex CLI with:
  • OPENAI_API_KEY set to your API key (default: jan)
  • OPENAI_BASE_URL pointing to local model
  • OPENAI_MODEL set to your local model ID

OpenClaw

jan launch openclaw --model qwen3.5-35b-a3b
Launches the open-source OpenClaw agent with:
  • ~/.openclaw/openclaw.json configured 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

jan launch claude --model qwen3.5-35b
Auto-fit is enabled by default when launching Claude, maximizing the context window based on available VRAM.

Custom Context Size

jan launch claude --model qwen3.5-35b --ctx-size 8192
Setting --ctx-size explicitly disables auto-fit and uses your specified size.

CPU-Only Mode

jan launch claude --model qwen3.5-35b --n-gpu-layers 0

HuggingFace Auto-Download

Download and launch with a HuggingFace model:
jan launch claude --model Qwen/Qwen2.5-35B-Instruct-GGUF
Jan will:
  1. Fetch available GGUF files
  2. Let you pick a quantization
  3. Download the model
  4. Start the model server
  5. Launch Claude Code
For private/gated models:
export HF_TOKEN="your_token_here"
jan launch claude --model meta-llama/Llama-3.3-70B-Instruct-GGUF

Troubleshooting

Agent Not Found

Error launching 'claude': No such file or directory
Solution: Ensure the agent is installed and available in your PATH.
# For Claude Code
which claude

# For OpenClaw
which openclaw

Model Not Found

Error: model not found in data folder
Solution: Download the model using the Jan desktop app, or use a HuggingFace repo ID to auto-download.

Binary Not Found

✗ llama-server binary not found
Solution: Install a backend from Jan’s settings, or specify the binary path with --bin.

OpenClaw Config Override

If OpenClaw still uses a cloud provider instead of Jan: Solution: Check for environment variables that override the config:
env | grep -E '(OPENAI|ANTHROPIC|GEMINI|MISTRAL|GROQ|XAI|OPENROUTER)'
Jan clears these automatically, but they may be set in your shell config (.bashrc, .zshrc, etc.).

See Also

Serve Command

Run models without launching an agent

Commands Reference

Complete reference for all CLI commands

Build docs developers (and LLMs) love