Copilot for llama-server LLMs
A VS Code extension that integrates llama-server LLMs as language model chat providers, enabling local AI-powered coding assistance directly in VS Code.
Note: This extension has no affiliation with llama.cpp or its maintainers. It is an independent third-party extension that provides integration with llama-server.
Quick Start
This extension pack includes the Server Manager, which can download and run llama-server for you automatically.
- Open the Command Palette → Llama Copilot: Run Setup.
- Choose Managed and follow the wizard (binary download → model selection → start).
- Open a chat session — models appear as
model-name@managed.
If you already run your own llama-server, choose Advanced in the wizard or configure llamaCopilot.endpoints in settings (see Endpoints below).
Endpoints
Endpoints tell the extension where to find running llama-server instances. When the managed server is running, a managed endpoint is injected automatically — you only need to configure endpoints for additional or remote servers.
Basic Configuration
{
"llamaCopilot.endpoints": {
"remote": {
"url": "http://192.168.1.100:8080"
}
}
}
Endpoint Identifiers
Each key becomes an @identifier suffix on its models (e.g. my-model@remote). The managed server uses @managed.
Multiple Endpoints
{
"llamaCopilot.endpoints": {
"fast": {
"url": "http://localhost:8013"
},
"remote": {
"url": "http://192.168.1.100:8080",
"apiToken": "your-api-token-here"
}
}
}
API Token Authentication
{
"llamaCopilot.endpoints": {
"secure": {
"url": "https://api.example.com",
"apiToken": "your-bearer-token-here"
}
}
}
The token is sent as Authorization: Bearer <token>.
{
"llamaCopilot.endpoints": {
"local": {
"url": "http://localhost:8013",
"headers": {
"X-Custom-Header": "value"
},
"models": {
"my-model": {
"headers": {
"X-Model-Specific": "value"
}
}
}
}
}
}
Model-level headers override endpoint-level headers.
Parameter Overrides
Generation parameters (temperature, top_p, etc.) can be set at the endpoint level or per model. These are merged into the request body sent to llama-server.
Endpoint-Level
{
"llamaCopilot.endpoints": {
"local": {
"url": "http://localhost:8013",
"requestBody": {
"temperature": 0.7,
"top_p": 0.95,
"top_k": 40,
"min_p": 0.01,
"repeat_penalty": 1.1,
"max_tokens": 2048
}
}
}
}
Model-Level
Model requestBody properties override endpoint-level properties:
{
"llamaCopilot.endpoints": {
"local": {
"url": "http://localhost:8013",
"requestBody": {
"temperature": 0.7,
"top_p": 0.95
},
"models": {
"my-model": {
"requestBody": {
"temperature": 0.6,
"top_k": 40
}
}
}
}
}
}
In this example, my-model uses temperature: 0.6, top_p: 0.95 (inherited), and top_k: 40.
Common Parameters
temperature — randomness (0.0 = deterministic, 2.0 = very creative)
top_p — nucleus sampling threshold (0.0–1.0)
top_k — number of tokens considered
min_p — minimum probability threshold
repeat_penalty — penalty for repeating tokens (1.0 = none)
max_tokens — maximum tokens to generate
See llama-server documentation for the full list.
Per-Model Settings
Context Size
"models": {
"large-model": {
"contextSize": 256000
}
}
Max Output Tokens
"models": {
"my-model": {
"maxOutputTokens": 4096
}
}
Thinking Budget
Reasoning models can consume their entire output budget on thinking. The extension automatically sets thinking_budget_tokens on each request — by default half of max_tokens.
Override with thinkingBudgetFraction per endpoint or per model. Values above 1 disable the budget entirely.
{
"llamaCopilot.endpoints": {
"local": {
"url": "http://localhost:8013",
"thinkingBudgetFraction": 0.5,
"models": {
"qwen3-4b": {
"thinkingBudgetFraction": 0.3
},
"non-reasoning-model": {
"thinkingBudgetFraction": 2
}
}
}
}
}
An explicit thinking_budget_tokens in requestBody always takes precedence. If llama-server was started with --reasoning-budget (other than -1), per-request budgets have no effect.
Capabilities
Capabilities are inferred automatically for models discovered from llama-server:
imageInput: true when the model has --image-min-tokens (add it to your models.ini — see the Server Manager README).
toolCalling: true for chat models by default.
Override per model:
"models": {
"multimodal-model": {
"capabilities": {
"imageInput": true,
"toolCalling": true
}
}
}
toolCalling can also be a number to limit the maximum number of tools.
Request Timeout
Request timeout (seconds) controls how long the extension waits for a server response. Default is 3600 (one hour). Increase it if you see timeouts on large contexts. In managed mode the server is started with --timeout 3600 to match.
Inline Completions (Ghost Text)
The extension can show inline completions using the llama-server /infill endpoint. This requires a FIM-capable model such as Sweep next-edit.
Setup
- Add a FIM model to your server — in managed mode, use the Models Manager; in advanced mode, add it to your
models.ini:
[sweep-next-edit-1.5b]
jinja = true
ctx-size = 0
temp = 0.7
top-p = 0.8
top-k = 20
hf = sweepai/sweep-next-edit-1.5B:latest
- Set Inline completion model in Settings → Llama Copilot to the model ID including the endpoint, e.g.
sweep-next-edit-1.5b@managed. Leave empty to disable.
Settings
| Setting |
Description |
| Inline completion model |
Model ID (e.g. sweep-next-edit-1.5b@managed). Empty = disabled. |
| Inline completion timeout (ms) |
Request timeout; no suggestion shown on timeout. |
| Inline completion debounce (ms) |
Delay before sending an automatic request. |
| Max input bytes |
Maximum input size (prefix + suffix + context) sent to the server. |
| Include context |
Include content from open tabs for better suggestions. |
| Inline completion prompt |
Text sent as the /infill prompt field. Default nudges short completions; clear to omit. |
Cursor Rules Integration
The extension exposes a get-project-rule tool that gives the LLM access to your .cursor/rules/ directory.
How It Works
- All
.md and .mdc files in .cursor/rules/ are discovered.
- Rules with glob patterns are matched against file attachments and messages.
- When a glob matches, the rule becomes available for that chat session.
- The LLM can call
get-project-rule to retrieve rule contents.
Simple markdown (.md) or markdown with frontmatter (.mdc):
---
description: "TypeScript coding standards"
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: false
---
# TypeScript Guidelines
- Use strict mode
- Prefer interfaces over types for object shapes
Glob patterns: * matches within a path segment, ** matches across path separators.
The tool accepts comma-separated rule names with optional rule: prefix and uses fuzzy matching (Levenshtein distance ≤ 8).
Configuration
{
"llamaCopilot.enableCursorRules": true
}
When disabled, rules are not parsed and the tool is not exposed.
Other Settings
| Setting |
Default |
Description |
showAllModels |
false |
Show all server models without filtering slash-IDs. Enable if models are not appearing. |
enableToolLoopDetection |
true |
Detect and break duplicate tool-call loops. |
Debug flags (debug.modelListFetch, debug.completion, debug.tokenization, debug.rulesMatching, debug.toolCalls, debug.inlineCompletion) log to the "Llama Server API" output channel.
Usage
Selecting Models
- Open the Command Palette → "Chat: Start Session" or use the chat panel.
- Pick a model from the list — models appear as
model-name@endpoint-id.
Chat
- Tool calling and image input work automatically when the model supports them.
- Use Open Endpoint Settings to jump to configuration.
Troubleshooting
Models Not Appearing
- Managed mode: ensure the server is running (status bar or Llama Copilot: Start Server).
- Advanced mode: verify the endpoint URL and that llama-server is running (
/models should return data).
- Enable
showAllModels if your model IDs contain slashes.
- Check the "Llama Server API" output channel for errors.
Configuration Errors
- Validate JSON syntax in
settings.json.
- Every endpoint needs a
url field.
- Endpoint identifiers should not contain special characters.
Parameter Overrides Not Working
- Parameter names must match llama-server's API.
- Model-level
requestBody overrides endpoint-level.
- Check the output channel for API request/response details.
Server Issues
For managed server problems (binary download, server crashes, port conflicts, models not loading), see the Server Manager troubleshooting.
Links