4.8 KiB
| summary | read_when | ||
|---|---|---|---|
| Run Clawdbot with jan.ai (local LLM runtime using llama.cpp) |
|
jan.ai
jan.ai is a local LLM runtime built on llama.cpp with OpenAI-compatible API. Clawdbot integrates with jan.ai and can auto-discover available models when you opt in with JAN_API_KEY (or an auth profile) and do not define an explicit models.providers.jan entry.
Quick start
-
Install jan.ai: https://jan.ai
-
Download models using jan.ai's UI or CLI
-
Enable jan.ai for Clawdbot (any value works; jan.ai doesn't require a real key):
# Set environment variable
export JAN_API_KEY="jan-local"
# Or configure in your config file
clawdbot config set models.providers.jan.apiKey "jan-local"
- Use jan.ai models:
{
agents: {
defaults: {
model: { primary: "jan/llama-3.3-70b" }
}
}
}
Model discovery (implicit provider)
When you set JAN_API_KEY (or an auth profile) and do not define models.providers.jan, Clawdbot discovers models from the local jan.ai instance at http://127.0.0.1:1337/v1:
- Queries
/v1/modelsendpoint - Includes all models from jan.ai
- Marks
reasoningwhen model ID contains "r1" or "reasoning" (case-insensitive) - Sets
input: ["text"]for all models (jan.ai primarily supports text models) - Sets
contextWindowto 128000 - Sets
maxTokensto 8192 - Sets all costs to
0(local provider)
This avoids manual model entries while keeping the catalog aligned with your jan.ai installation.
To see what models are available:
clawdbot models list
If you set models.providers.jan explicitly, auto-discovery is skipped and you must define models manually (see below).
Configuration
Basic setup (implicit discovery)
The simplest way to enable jan.ai is via environment variable:
export JAN_API_KEY="jan-local"
Explicit setup (manual models)
Use explicit config when:
- jan.ai runs on another host/port.
- You want to force specific context windows or model lists.
- You want to override default model settings.
{
models: {
providers: {
jan: {
baseUrl: "http://127.0.0.1:1337/v1",
apiKey: "jan-local",
api: "openai-completions",
models: [
{
id: "llama-3.3-70b",
name: "Llama 3.3 70B",
reasoning: false,
input: ["text"],
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
contextWindow: 128000,
maxTokens: 8192
}
]
}
}
}
}
If JAN_API_KEY is set, you can omit apiKey in the provider entry and Clawdbot will fill it for availability checks.
Custom base URL (explicit config)
If jan.ai is running on a different host or port (explicit config disables auto-discovery, so define models manually):
{
models: {
providers: {
jan: {
apiKey: "jan-local",
baseUrl: "http://jan-host:1337/v1",
api: "openai-completions"
}
}
}
}
Model selection
Once configured, all your jan.ai models are available:
{
agents: {
defaults: {
model: {
primary: "jan/llama-3.3-70b",
fallback: ["jan/qwen2.5-coder-32b"]
}
}
}
}
Advanced
Reasoning models
Clawdbot marks models as reasoning-capable when the model ID contains "r1" or "reasoning" (case-insensitive). This includes models like DeepSeek-R1 and other reasoning models.
Model Costs
jan.ai runs locally, so all model costs are set to $0.
Context windows
For auto-discovered models, Clawdbot defaults to a context window of 128000 and maxTokens of 8192. You can override these values in explicit provider config.
Troubleshooting
jan.ai not detected
Make sure jan.ai is running and that you set JAN_API_KEY (or an auth profile), and that you did not define an explicit models.providers.jan entry.
And that the API is accessible:
curl http://localhost:1337/v1/models
No models available
Make sure jan.ai has models downloaded and available. Check the jan.ai UI to ensure models are installed, or download models through jan.ai's interface.
To verify API endpoint accessibility:
curl http://localhost:1337/v1/models
Connection refused
Check that jan.ai is running on the correct port (default 1337):
# Check if jan.ai is running on port 1337
netstat -an | grep 1337
# Or restart jan.ai
# Restart through the jan.ai application or service
See Also
- Model Providers - Overview of all providers
- Model Selection - How to choose models
- Gateway Configuration - Full config reference
- Ollama Provider - Similar local provider for comparison