How to Use Jan.ai: Run Private AI Models Locally in 6 Steps

Jan.ai is an open-source desktop app that runs LLMs entirely on your own machine. It ships with a bundled llama.cpp engine and an OpenAI-compatible API server on localhost:1337.

This guide covers a jan.ai local AI setup from install to API: picking a model your hardware can actually hold, the settings to fix before your first chat, and how to call it from code. If you've already called a cloud model from a script, as in our guide to web scraping with Mistral AI, the API part will feel familiar.

Why run Jan.ai instead of a cloud model?

Jan.ai keeps your prompts on your machine and costs nothing per request. That trade is worth it for a few specific reasons:

  • Works offline. Once a model is downloaded, nothing needs a network connection. Useful on flights and in air-gapped environments.
  • Your data stays local. Prompts, threads, and files never leave the machine unless you add a remote provider yourself.
  • No rate limits. Your hardware is the only cap.
  • A free API endpoint. Prototype against an OpenAI-shaped API without burning credits.

The cost is speed and model size. A laptop won't run what a datacenter runs, so the rest of this guide is mostly about matching the model to the machine.

What hardware do you need for a jan.ai local AI setup?

You need a 64-bit CPU with AVX2, at least 8GB of RAM, and about 10GB of free disk. A GPU with 6GB+ of VRAM is optional but changes the experience completely.

Operating system

  • Windows: Windows 10 or newer
  • macOS: 13.6 or newer, Intel and Apple Silicon
  • Linux: most modern distributions, via .deb or AppImage

Jan is Apache 2.0 licensed, which matters if you're rolling it out inside a company rather than on a personal laptop.

CPU and RAM

The CPU needs AVX2: Intel Haswell (2013) or AMD Excavator (2015) and newer. Jan bundles one engine build, and there's no fallback build for older CPUs.

Check for AVX2 before you install:

# Linux: prints "avx2" if supported, nothing if not
grep -o -m1 avx2 /proc/cpuinfo

On Windows, CPU-Z lists AVX2 under Instructions. Any Apple Silicon Mac is fine.

RAM decides which models you can run. These tiers assume quantized GGUF models and a machine you still want to use for other things:

System RAM Model size that fits comfortably Example models
8GB 3B–4B Qwen3-4B, Llama-3.2-3B
16GB 7B–8B Qwen3-8B, Mistral-7B
32GB 12B–14B Qwen3-14B, Mistral-Nemo-12B
64GB 27B–32B Qwen3-32B, Gemma-3-27B

If you keep 40 browser tabs and an IDE open, drop a tier. The most common first-run disappointment is a model that's too big, generating a word every few seconds.

GPU (optional)

  • NVIDIA: 6GB+ VRAM. Jan bundles CUDA 13; cards or drivers that can't run it fall back to Vulkan.
  • AMD and Intel Arc: 6GB+ VRAM, via Vulkan.
  • Apple Silicon: Metal, used automatically. No driver work.

Without a GPU, Jan runs on the CPU. A 3B model on CPU is fine for short questions, but anything bigger feels slow.

Storage

Plan on 10GB minimum for the app and one model. Each 7B model at Q4 is around 4–5GB, so comparing a few fills a small SSD fast.

Step 1: Install Jan.ai

Download the installer for your OS from jan.ai or the GitHub releases page. The current release at the time of writing is v0.8.8.

On macOS you can also use Homebrew:

brew install --cask jan

On Windows, run the .exe. On Linux, take the .deb or the AppImage, depending on your distribution.

Where Jan keeps your data

Jan stores models, threads, and logs in one local data folder:

  • Windows: %APPDATA%\Jan\data
  • macOS: ~/Library/Application Support/Jan/data
  • Linux: ~/.local/share/Jan/data

You can move it under Settings > General > Jan Data Folder. Nothing in that folder is sent anywhere.

If Jan won't open

Jan's docs list three usual launch failures: a corrupt store.json, a second Jan instance already running, or something else using port 1337.

Close any other Jan process first. If that doesn't help, rename store.json in the data folder; that resets preferences but keeps models and chats.

If the app opens but crashes when a model loads, suspect the GPU. Turn it off under Settings > Hardware > GPUs, confirm the model runs on CPU, then turn acceleration back on and see whether it holds.

Step 2: Tune performance before your first chat

Set these before you download anything big. Picking a model while the defaults are wrong leads to blaming the model for a settings problem.

Enable the GPU

Go to Settings > Hardware > GPUs and switch your GPU on. If a card supports both CUDA and Vulkan, pick the backend here.

This is the biggest speed change available. On a 6GB card it's the difference between a 7B model answering at reading pace and one you wait on.

Set GPU layers and context size per model

Click the gear icon next to the selected model in a chat to open its parameters. The two that matter most:

  • GPU Layers: how many layers go to VRAM. More is faster until VRAM runs out.
  • Context Size: how much conversation the model holds. You pay for it in memory up front.

Reasonable starting context sizes:

System RAM Context size
8GB 2,048 tokens
16GB 4,096 tokens
32GB+ 8,192+ tokens

The Fit to Hardware toggle caps context size to what your machine can hold. Leave it on until you know you need more.

Find the GPU Layers ceiling on NVIDIA

Watch VRAM while a model generates:

nvidia-smi -l 1   # refreshes every second

Raise GPU Layers until VRAM sits around 90% during generation. If the model crashes or falls over on long prompts, back off by 5 layers.

Step 3: Download models

Open the Hub tab, click a model, and check its fit label: Fits, May be slow, or Won't fit. Jan reads your hardware for this, so trust it over a model card.

Each model comes in several quantization levels:

  • Q4_K_M: the best balance. Start here.
  • Q5_K_M: a little better quality, more RAM.
  • Q3_K_S: roughly a third smaller than Q5, with a visible quality drop.

The Recommended tag marks the default download for your machine.

Import a GGUF file from Hugging Face

If the Hub doesn't list the model you want, download the GGUF yourself. The hf CLI lets you grab one quantization without pulling the whole repo:

pip install -U huggingface_hub
# Download only the Q4_K_M file from the official Qwen3 GGUF repo
hf download Qwen/Qwen3-8B-GGUF --include "*Q4_K_M.gguf" --local-dir ./models

Then import the file from Settings > Llama.cpp. Jan copies it to llamacpp/models/ in the data folder and writes a model.yml next to it. Don't drop files into that folder by hand.

Step 4: Turn on the local API server

Jan's API server speaks the OpenAI chat completions format at http://127.0.0.1:1337/v1. Any OpenAI client works once you change the base URL.

To start it:

  1. Open Settings > Local API Server.
  2. Pick a model under Default Model Local API Server.
  3. Click Start Server and wait for Server Status to show it's running.

The settings worth knowing:

  • Host: 127.0.0.1 (only your machine) or 0.0.0.0 (your whole network).
  • Port: 1337 by default.
  • API Key: optional. If set, clients must send it as Authorization: Bearer <key>. Empty means no auth.
  • CORS: on by default so browser apps can call it. Turn it off if only scripts use the server.
  • Trusted Hosts: the hostnames allowed to reach the server.

Find your model ID

The model field in every request has to match an ID Jan knows. Ask the server instead of guessing:

curl -s http://127.0.0.1:1337/v1/models \
  -H "Authorization: Bearer jan-local-key" | jq -r '.data[].id'

Copy the ID you want. Wrong IDs are the most common reason a first request fails.

Test the API from Python

This script lists the available models, takes the first one, and sends a chat request. If requests is new to you, our Python requests guide covers the basics.

import requests

BASE = "http://127.0.0.1:1337/v1"
HEADERS = {"Authorization": "Bearer jan-local-key"}  # remove if API Key is empty

# Ask Jan which model IDs it serves instead of hardcoding one
models = requests.get(f"{BASE}/models", headers=HEADERS, timeout=10).json()
model_id = models["data"][0]["id"]

payload = {
    "model": model_id,
    "messages": [
        {"role": "system", "content": "You are a concise assistant."},
        {"role": "user", "content": "Explain what a GGUF file is in one sentence."},
    ],
    "temperature": 0.7,
}
resp = requests.post(f"{BASE}/chat/completions", json=payload, headers=HEADERS, timeout=120)
resp.raise_for_status()
print(resp.json()["choices"][0]["message"]["content"])

The long timeout matters. The first request loads the model into memory, and on a big model that can take most of a minute.

Reach Jan from other devices

To use Jan from your phone or another laptop, put it behind a tunnel:

# Either of these forwards a public URL to your local server
ngrok http 1337
cloudflared tunnel --url http://localhost:1337

Then add the tunnel's hostname to Trusted Hosts, or Jan will reject the requests. Add only the hosts you actually use.

A tunnel URL is reachable by anyone who has it. Always set an API key before you open one.

Step 5: Plug Jan into your dev tools

Because the API is OpenAI-shaped, most tools only need a base URL, a key, and a model ID.

VS Code with Continue

The Continue extension gives you chat and inline edits in VS Code, backed by your local model. Add Jan to ~/.continue/config.yaml:

name: Local models
version: 0.0.1
schema: v1
models:
  - name: Jan Local
    provider: openai
    model: <model-id-from-/v1/models>
    apiBase: http://127.0.0.1:1337/v1
    apiKey: jan-local-key

Use Ctrl/Cmd+L to chat and Ctrl/Cmd+I for inline edits. Note the /v1 on apiBase; leaving it off is the usual cause of 404s.

A one-word AI command in your shell

This function sends a prompt to Jan from any terminal. It builds the JSON with jq, so quotes in your prompt don't break the request:

# Add to ~/.bashrc or ~/.zshrc. Set JAN_MODEL (and JAN_API_KEY if you use one).
ai() {
  local model="${JAN_MODEL:?set JAN_MODEL to an ID from /v1/models}"
  jq -n --arg m "$model" --arg p "$*" \
    '{model: $m, messages: [{role: "user", content: $p}], temperature: 0.7}' |
  curl -s http://127.0.0.1:1337/v1/chat/completions \
    -H "Content-Type: application/json" \
    -H "Authorization: Bearer ${JAN_API_KEY:-}" \
    -d @- | jq -r '.choices[0].message.content'
}

# Usage
ai "Convert this to Python: ls -la | grep .txt"

The ${JAN_MODEL:?...} line fails fast with a readable message instead of sending a request Jan will reject.

Node.js with the OpenAI SDK

The official openai package works unchanged against Jan:

import OpenAI from "openai";

const client = new OpenAI({
  baseURL: "http://127.0.0.1:1337/v1",
  apiKey: process.env.JAN_API_KEY ?? "not-needed", // SDK requires a non-empty string
});

const completion = await client.chat.completions.create({
  model: process.env.JAN_MODEL,
  messages: [{ role: "user", content: "Hello!" }],
});
console.log(completion.choices[0].message.content);

If you set an API key in Jan, JAN_API_KEY must match it exactly. If you didn't, any placeholder string works.

Step 6: Get more out of limited hardware

Most slowdowns come from a model that's too big for memory, not from a missing trick. Fix that first.

When you're out of RAM

  • Lower Context Size before anything else. It's the cheapest memory to give back.
  • Step down a quantization level, from Q5_K_M to Q4_K_M, or Q4 to Q3.
  • Drop to the next model size down. A fast 4B beats a 14B that swaps.

When you're out of VRAM

Lower GPU Layers so part of the model runs on the CPU. A split model is slower than a full GPU load but far faster than pure CPU.

Model mixing strategy

Run a few small specialized models instead of one large general one:

  • Coding: Qwen2.5-Coder-7B for development tasks
  • Writing: Mistral-7B for general text

A local 7B model is good for first drafts, rewording, and summaries. It is weaker on long structured documents, where it loses track of citations and formatting rules halfway through. Academic writing shows this clearly: a 4,000-word research paper with a strict referencing style is exactly where a small model starts to drift. For anything that has to be polished, let the model write the draft and then have a person edit and proofread the final version, whether that’s you or a specialist in IB extended essay writing.

  • Analysis: Qwen3-8B for reasoning
  • Small tasks: Qwen3-4B for quick answers

Switch between them by task. On narrow jobs, a small model that fits in VRAM often beats a bigger one that doesn't.

Troubleshooting

"Model failed to load" or out-of-memory errors

Why: the model plus its context doesn't fit. Fix: lower GPU Layers, lower Context Size, or pick a smaller quantization. Check the Hub's fit label before retrying.

Generation on CPU is painfully slow

Why: the model is too big for CPU inference, or the GPU isn't in use. Fix: confirm the GPU is on under Settings > Hardware > GPUs. If you're CPU-only, stay at 3B–4B with a 2,048-token context.

NVIDIA GPU not detected

Why: usually a driver too old for CUDA 13. Fix: run nvidia-smi to confirm the card is visible, then update the driver. If it still won't run CUDA, select Vulkan under Settings > Hardware > GPUs.

API returns 404 or "model not found"

Why: a missing /v1 in the base URL, or a model ID that doesn't match. Fix: use http://127.0.0.1:1337/v1 and copy the ID from /v1/models.

Build your own local AI stack

Jan is also a free inference backend for the tools around it. Because it speaks the OpenAI format, you can swap it in wherever a project expects an OpenAI key:

  • Chains and agents: LangChain works with Jan as a drop-in OpenAI provider. If it feels heavy, see our roundup of LangChain alternatives.
  • Retrieval: pair Jan with Qdrant for vector search and you have the pieces for a private RAG chatbot.
  • Automation: point n8n's OpenAI node at Jan's base URL to run workflows on a local model. Our n8n integration guide covers the setup side.
  • Team interface: Open WebUI can sit in front of Jan's API so others on your network get a chat UI.

Put together, that's a local AI stack with no per-query cost.

Where Jan.ai doesn't help

A local 8B model isn't a frontier model. For hard multi-step reasoning or long-context analysis, a big cloud model will still win.

Jan also won't make weak hardware fast. If your machine only fits a 3B model, treat it as a fast helper for small jobs, not a ChatGPT replacement.

FAQ

Is Jan.ai free?

Yes. Jan is open source under the Apache 2.0 license and costs nothing to download or use. Your only costs are the hardware and electricity.

Does Jan.ai work without internet?

Yes, once a model is downloaded. You need a connection to download the app and models from the Hub. After that, chats and the local API run fully offline.

Can I use Jan's API with the OpenAI SDK?

Yes. Set the base URL to http://127.0.0.1:1337/v1, pass your Jan API key (or any placeholder if you didn't set one), and use a model ID from /v1/models. The Python and Node SDKs both work unchanged.

What's the difference between Jan and Ollama?

Both run local models on llama.cpp. Jan is a desktop app with a chat UI, a model Hub, and a built-in API server you toggle on. Ollama runs as a background service you drive from the command line.

Why is Jan slow on my computer?

Usually the model is too big for your RAM or VRAM, or the GPU is switched off. Check the Hub's fit label, turn the GPU on under Settings > Hardware, and lower Context Size.

Wrapping up

Start with a model the Hub marks as Fits, at Q4_K_M, with the GPU on. Get the API answering from Python or your shell, then build on it.

New quantized models ship every few weeks, and a working local setup means you can try each one the day it lands. Pick the largest model your hardware runs without swapping, and stay there.