llama-server provides a production-ready HTTP API server with OpenAI-compatible endpoints for chat completions, embeddings, and more.
Features
- OpenAI-compatible
/v1/chat/completionsand/v1/embeddingsendpoints - Anthropic Messages API compatibility
- Parallel decoding with multi-user support
- Continuous batching for optimal throughput
- Multimodal support (vision and audio)
- Web UI for interactive testing
- Reranking endpoint
- Function calling / tool use
- Speculative decoding
Quick Start
1
Start the server
Launch llama-server with your model:The server will listen on
http://127.0.0.1:8080 by default.2
Access the Web UI
Open your browser and navigate to:
3
Test the API
Make a request to the chat completions endpoint:
Starting the Server
Basic Configuration
Docker
Docker Compose
For boolean environment variables like
LLAMA_ARG_MMAP, use values: true/1/on/enabled or false/0/off/disabledChat Completions API
OpenAI-compatible endpoint at/v1/chat/completions.
Basic Request
Streaming
With Temperature and Top-P
JSON Mode
Completion API
Non-OpenAI-compatible endpoint at/completion for raw text completion.
With Streaming
Multiple Prompts
Server Configuration
Parallel Processing
Context and Caching
Batch Processing
Authentication
API Key
Making Authenticated Requests
SSL/TLS Configuration
Monitoring Endpoints
Health Check
Slots Monitoring
Prometheus Metrics
Properties
Model Management
Model Aliases
Model Tags
Router Server Mode
Advanced Features
Sleeping on Idle
Slot Prompt Similarity
Context Checkpoints
Slot Persistence
Static File Serving
Utility Endpoints
Tokenization
Detokenization
Apply Chat Template
Code Infill
For code completion models with fill-in-the-middle (FIM) support:With Repository Context
LoRA Adapters
Loading LoRA
Managing LoRA via API
Requests with different LoRA configurations won’t be batched together, which may affect throughput.
Performance Tuning
Threading
GPU Configuration
Memory Management
KV Cache Optimization
Logging
Timeout Configuration
Building from Source
With SSL Support
Common Configurations
High-Throughput Server
Low-Latency Server
Development Server
See Also
CLI Tool
Command-line inference interface
Embeddings
Generate text embeddings
Multimodal
Vision and audio support
Speculative Decoding
Accelerate with draft models

