Local AI Engine (llama.cpp)
What is llama.cpp?
llama.cpp is the engine that runs AI models locally on your computer. Think of it as the software that takes an AI model file and makes it actually work on your hardware - whether that's your CPU, graphics card, or Apple's M-series chips.
Originally created by Georgi Gerganov and now maintained by the ggml-org/llama.cpp community, llama.cpp is designed to run large language models efficiently on consumer hardware without requiring specialized AI accelerators or cloud connections.
Why This Matters
Privacy: Your conversations never leave your computer Cost: No monthly subscription fees or API costs Speed: No internet required once models are downloaded Control: Choose exactly which models to run and how they behave
Engine version
The llama.cpp engine is built into Jan and updates together with the app, so there is no separate engine version to download or pick. Settings > Model Providers > Llama.cpp shows the version, build and commit; quote them when you report a model that fails to load. To run a model on a different llama.cpp version, run your own llama-server and connect it as a custom endpoint.
Accessing Engine Settings
Open Settings > Model Providers > Llama.cpp. The page includes your local models, bundled engine information, and engine-wide settings.
Model Management
The Models section at the top of the Llama.cpp settings page lets you manage all your local GGUF models.
Download from Hub
Browse and download models directly from the Hub tab in the left sidebar. Downloaded models will appear here automatically.
Import Local Files
Click Import to link a GGUF model file already on your computer. This is useful for models downloaded via your browser from Hugging Face, or models shared with other apps — Jan links to the file in place without copying it.

Delete a Model
Click the trash icon next to any model to remove it. This deletes the model file from Jan's data folder (linked files leave the original intact).
These are advanced settings. You typically only need to adjust them if models aren't working properly or you want to optimize performance for your specific hardware.
Engine Management
| Feature | What It Does | When You Need It |
|---|---|---|
| Engine Version | Shows which version of llama.cpp you're running | Check compatibility with newer models |
| Max Concurrent Models | Maximum models the router keeps loaded at once | Set to 1 if you want strict single-model operation; 0 means unlimited |
Jan v0.8.0 introduced a router that loads and unloads models on demand. Since v0.8.5, the engine ships with Jan and runs in a separate worker process. Old downloaded backends are no longer used; update Jan rather than installing a backend separately.
Hardware Backends
Jan bundles the engine backends with the app:
- Windows and Linux, NVIDIA: CUDA 13 where supported. GPUs or drivers that cannot run CUDA 13 (for example, Pascal/GTX 10-series cards) use Vulkan instead. Install a current driver supported by your GPU; the CUDA Toolkit is not required.
- Windows and Linux, AMD and Intel: Vulkan, with a Vulkan-capable graphics driver. Since v0.8.6, the Linux AppImage uses your system's Vulkan loader.
- Apple Silicon: Metal acceleration, with no separate backend installation.
- Intel Macs: The bundled local engine does not support Intel Macs. See Mac installation for the v0.8.5 remote/custom-provider alternative and its limits.
Under Settings > Hardware > GPUs, enable or disable GPUs with their switches. If a GPU exposes multiple backends, its card lets you select among the available backends (for example, CUDA and Vulkan). These are bundled device choices, not downloads or engine-version selectors. To run without GPU offload on Windows or Linux, turn off the GPU switches.
If a Turing GPU (GTX 16xx or RTX 20xx) reports "the provided PTX was compiled with an unsupported toolchain" on v0.8.5, update Jan to v0.8.6 or later. That release includes native Turing code; the fix does not require a driver update. See the v0.8.6 release notes.
Performance Settings (Engine-wide)
These engine-wide settings are applied to every model the router loads. Per-model overrides (Context Size, GPU Layers, Batch Size, Disable KV Offload, etc.) live on the model's own settings page.
| Setting | What It Does | Default | Impact |
|---|---|---|---|
| Continuous Batching | Process multiple requests at once | Enabled | Keep enabled for multi-tool or multi-conversation workloads |
| Parallel Sequences | Number of parallel sequences to decode | 0 (auto) | Let llama.cpp choose, or set an explicit count; v0.8.6 uses one slot for MTP models when auto is selected |
| Threads | Number of threads to use during generation | -1 (auto) | -1 uses all logical cores |
| Threads (Batch) | Threads for batch and prompt processing | -1 (same as Threads) | Tune separately for prompt-heavy workloads |
| uBatch Size | Physical maximum batch size | 512 | Controls memory usage during batching |
| Devices for Offload | Comma-separated device list (e.g. CUDA0,CUDA1) | empty (auto) | Restrict which GPUs the model can use |
| GPU Split Mode | How to distribute the model across GPUs | Layer | Layer is the common multi-GPU choice |
| Main GPU Index | Primary GPU for processing | 0 | Applies with split mode None or Row; ignored with Layer |
Memory Settings (Engine-wide)
These engine-wide settings control how the router and every loaded model use system and GPU memory.
| Setting | What It Does | Default | When to Change |
|---|---|---|---|
| Flash Attention | Enable Flash Attention kernel | Auto | Force On or Off only if you hit kernel issues |
| Disable mmap | Don't memory-map model files | Disabled | Enable if experiencing crashes or pageouts |
| MLock | Keep model in RAM, prevent swapping | Disabled | Enable if you have enough RAM and want consistent performance |
| Context Shift | Allow trimming the start of the prompt when context fills | Disabled | Enable for very long chats or multiple tool calls |
| KV Cache K Type | KV-cache precision for keys | f16 | Switch to q8_0 / q4_0 to save VRAM |
| KV Cache V Type | KV-cache precision for values | f16 | Switch to q8_0 / q4_0 to save VRAM |
Per-model settings (configured on each model's page, not here): Context Size (ctx_size), GPU Layers (n_gpu_layers), Batch Size (batch_size), Disable KV Offload (no_kv_offload — enable to keep the KV cache on CPU when GPU VRAM is tight), Override Tensor Buffer Type, Chat Template, Chat template options (chat_template_kwargs), and sampling parameters. The router applies engine-wide settings as the [*] defaults in router.preset.ini and lets per-model entries override them.
The default KV cache type was temporarily set to q8_0 in a prior release and has been reverted to f16. This is not automatically migrated — if your models fail to load after updating to v0.8.0, set KV Cache K Type and KV Cache V Type back to f16 manually.
KV Cache Types Explained
- f16: Full 16-bit precision, uses more memory but highest quality
- q8_0: 8-bit quantized, balanced memory usage and quality
- q4_0: 4-bit quantized, uses least memory, slight quality loss
Advanced Settings
These settings are for fine-tuning model behavior and advanced use cases.
Custom Jinja Chat Template, Chat template options, Mirostat Sampling, and the Output Constraints (Grammar / JSON Schema) below are per-model settings, configured on an individual model's page (the gear icon next to the model), not on the engine-wide Settings > Model Providers > Llama.cpp page. Max Tokens to Predict, RoPE, and Cache & Memory Tuning are engine-wide.
Text Generation Control
| Setting | What It Does | Default Value | When to Change |
|---|---|---|---|
| Max Tokens to Predict | Maximum tokens to generate | -1 (infinite) | Set a limit to prevent runaway generation |
| Custom Jinja Chat Template (per-model) | Override model's chat format: a built-in template name, an inline Jinja body, or an absolute path to a .jinja file | Empty | Only if model needs special formatting |
| Chat template options (per-model) | Extra options the model's chat template accepts (sent as chat_template_kwargs, e.g. enable_thinking) | Empty | To toggle template features like reasoning or tool formatting per model |
RoPE (Rotary Position Embedding) Settings
| Setting | What It Does | Default Value | When to Change |
|---|---|---|---|
| RoPE Scaling Method | Context extension method | Model default | For models that support extended context |
| RoPE Frequency Base | Base frequency for RoPE | 0 (auto) | Usually loaded from model |
| RoPE Frequency Scale Factor | Frequency scaling factor | 0 (auto) | Advanced tuning only |
Cache & Memory Tuning
| Setting | What It Does | Default Value | When to Change |
|---|---|---|---|
| Prompt Cache RAM (MiB) | Maximum prompt cache size in MiB (--cache-ram). -1 = unlimited, 0 = disabled | 8192 | Lower to save RAM; -1 removes the cap |
| Cache Reuse | Min chunk size of matching prefix tokens to reuse from cache (--cache-reuse) | 0 (disabled) | Set a positive value to speed up repeated prompts with a shared prefix |
| Full SWA Cache | Use full-size SWA cache (--swa-full) | Disabled | Enable for Gemma / Mistral-family SWA models when you need full-context recall (costs memory) |
| Keep First N Tokens | Tokens from the initial prompt to keep on context shift (--keep, -1 = keep all) | 0 | Increase to preserve more of the system prompt when context fills |
Mirostat Sampling (per-model)
| Setting | What It Does | Default Value | When to Change |
|---|---|---|---|
| Mirostat Mode | Alternative sampling method | Disabled | Try V1 or V2 for more consistent output |
| Mirostat Learning Rate | How fast it adapts | 0.1 | Lower for more stable output |
| Mirostat Target Entropy | Target perplexity | 5 | Higher for more variety |
Output Constraints (per-model)
| Setting | What It Does | Default Value | When to Change |
|---|---|---|---|
| Grammar | Constrain output with a GBNF grammar: an inline grammar body or an absolute path to a .gbnf file | Empty | For structured output (JSON, code, etc.) |
| JSON Schema File | Enforce JSON structure | Empty | When you need specific JSON formats |
Troubleshooting Common Issues
Models won't load:
- In Settings > Hardware, try another available GPU backend or disable GPU offload
- Check if you have enough RAM/VRAM
- Update Jan to get the latest bundled engine
Very slow performance:
- Make sure you're using GPU acceleration (CUDA/Metal/Vulkan backend)
- Increase GPU Layers in model settings
- Close other memory-intensive programs
Out of memory errors:
- Reduce Context Size in model settings
- Switch KV Cache Type to q8_0 or q4_0
- Try a smaller model variant
Random crashes:
- Check the logs; try disabling GPU offload to isolate a GPU issue
- Disable overclocking if you have it enabled
- Update graphics drivers
Quick Setup Guide
For most users:
- Use the engine bundled with Jan
- Keep Jan updated to receive engine fixes
- Leave all performance settings at defaults
- Only adjust if you experience problems
If you have an NVIDIA graphics card:
- Check that your GPU is enabled in Settings > Hardware; Jan uses bundled CUDA or Vulkan
- Leave GPU Layers on automatic unless you need to tune memory usage
- Leave Flash Attention on Auto unless troubleshooting
- Main GPU Index applies only with split mode None or Row; leave it unchanged with the default Layer split mode
If models are too slow:
- Check you're using GPU acceleration (CUDA/Metal/Vulkan backend)
- Keep Continuous Batching enabled
- Increase Batch Size (per-model) and uBatch Size (engine)
- Close other applications using memory
If running out of memory:
- Set Max Concurrent Models to 1 so the router unloads the previous model before loading a new one
- Change KV Cache K/V Type to q8_0 or q4_0
- Reduce Context Size in model settings
- Enable MLock if you have sufficient RAM
- Try a smaller model
For advanced users:
- Experiment with Mirostat sampling for more consistent outputs
- Use Grammar/JSON Schema files for structured generation
- Adjust RoPE settings for models with extended context support
- Fine-tune thread counts based on your CPU
Most users can run Jan successfully without changing any of these settings. The defaults are chosen to work well on typical hardware.