Production-grade Rust inference server for multimodal models (image + text β streamed text), with OpenAI-compatible APIs and high-throughput GPU scheduling.
Rust
8
4 commits
updated Jan 26, 2026
A high-performance, production-ready Vision-Language Model (VLM) inference server built entirely in Rust
Transform images and text into insights with this OpenAI-compatible inference server powered by real AI models (LLaVA 1.5) and the Candle ML framework.
Modern AI applications need to understand both images and text together - whether it's analyzing medical scans, describing product images, or answering questions about visual data. But deploying vision-language models (VLMs) is challenging:
We built this to solve those problems with a pure Rust implementation that's:
π Read the full story in our deep-dive blog post β
Get up and running in 5 minutes:
# Clone the repository
git clone https://github.com/mixpeek/multimodal-inference-server.git
cd vlm-inference-server
# Build the project (Release mode for best performance)
cargo build --release
# Start the worker (downloads 14GB model on first run)
./target/release/vlm-worker --host 0.0.0.0 --port 50051 &
# Start the gateway (HTTP API)
./target/release/vlm-gateway --host 0.0.0.0 --port 8080 &
# Send a chat completion request
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "vlm-prod",
"messages": [{"role": "user", "content": "Hello, how are you?"}],
"max_tokens": 20
}'
That's it! You now have a VLM inference server running locally.
/healthz and /readyz endpoints for Kubernetesβββββββββββββββ ββββββββββββ βββββββββββββββ
β Client β β Gateway β β Worker β
β (HTTP) βββββββββββΆβ (HTTP) βββββββββββΆβ (gRPC) β
β ββββββββββββ ββββββββββββ β
βββββββββββββββ ββββββββββββ βββββββββββββββ
β β
β βΌ
β βββββββββββββββββββ
β β Candle Engine β
β β βββββββββββββ β
β β β CLIP β β
β β β Vision β β
β β βββββββββββββ β
β β βββββββββββββ β
β β β LLaMA-2 β β
β β β LLM β β
β β βββββββββββββ β
β βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β Observability β
β Metrics, Logs β
ββββββββββββββββββββ
Learn more: Architecture Documentation β
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "vlm-prod",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in simple terms."}
],
"max_tokens": 100,
"temperature": 0.7
}'
curl -N -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "vlm-prod",
"messages": [{"role": "user", "content": "Write a haiku about Rust"}],
"max_tokens": 50,
"stream": true
}'
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "vlm-prod",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What'\''s in this image?"},
{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,/9j/4AAQ..."}}
]
}],
"max_tokens": 100
}'
More examples: examples/
| Endpoint | Method | Description |
|---|---|---|
/v1/chat/completions | POST | Create a chat completion (OpenAI-compatible) |
/healthz | GET | Health check |
/readyz | GET | Readiness check |
/v1/models | GET | List available models |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model identifier (e.g., "vlm-prod") |
messages | array | Yes | - | Conversation messages |
max_tokens | integer | No | 256 | Maximum tokens to generate |
temperature | float | No | 1.0 | Sampling temperature (0.0-2.0) |
top_p | float | No | 1.0 | Nucleus sampling parameter |
stream | boolean | No | false | Enable streaming responses |
stop | string/array | No | - | Stop sequences |
Full API documentation: docs/API.md
Benchmarks on Apple M3 Ultra (192GB RAM, CPU mode):
| Metric | Value |
|---|---|
| Model Loading | ~30s (one-time) |
| Vision Encoding | 100-200ms per image |
| Prefill (256 tokens) | 500ms-1s |
| Decode | 100-200ms per token |
| End-to-End (20 tokens) | 2-5s |
| Memory Usage | ~16GB |
Performance tuning: docs/PERFORMANCE.md
vlm-inference-server/
βββ crates/
β βββ api_types/ # OpenAI-compatible API types
β βββ proto/ # gRPC protocol definitions
β βββ gateway/ # HTTP edge service
β βββ worker/ # Inference worker service
β βββ engine/ # ML engine trait definitions
β βββ engine_adapters/
β β βββ mock_engine/ # Test mock
β β βββ candle_engine/ # Candle ML implementation
β βββ multimodal/ # Image preprocessing
β βββ scheduler/ # Batching & admission control
β βββ kv_cache/ # Key-value cache management
β βββ sampling/ # Token sampling strategies
β βββ common/ # Shared utilities
β βββ observability/ # Tracing & metrics
βββ docs/ # Documentation
βββ examples/ # Usage examples
βββ scripts/ # Helper scripts
# Run all tests
cargo test --workspace
# Run specific crate tests
cargo test --package vlm-candle-engine
# Run with logging
RUST_LOG=debug cargo test
# Run integration tests
cargo test --test '*'
# Debug build (faster compile, slower runtime)
cargo build
# Release build (optimized)
cargo build --release
# With specific features
cargo build --bin vlm-worker --features candle --release
# Check code style
cargo fmt --all -- --check
cargo clippy --all-targets --all-features
# Build image
docker build -t vlm-inference-server .
# Run container
docker run -p 8080:8080 -p 50051:50051 vlm-inference-server
# See k8s/ directory for full manifests
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
# See systemd/ directory for service files
sudo cp systemd/vlm-worker.service /etc/systemd/system/
sudo cp systemd/vlm-gateway.service /etc/systemd/system/
sudo systemctl enable --now vlm-worker vlm-gateway
Deployment guides: docs/DEPLOYMENT.md
We love contributions! Whether you're:
Please read our Contributing Guide first.
git checkout -b feature/amazing-featurecargo test --workspacegit commit -m "Add amazing feature"git push origin feature/amazing-featureA: Yes! The Candle engine supports Metal (Apple Silicon), CUDA (NVIDIA), and CPU. Metal support is enabled by default on macOS.
A: Currently LLaVA 1.5 7B. The modular architecture makes it easy to add other models (see Adding Models).
A: Yes! It handles real inference with proper error handling, health checks, and observability. The main limitation is tokenization (tokens shown as tok{id} instead of decoded text).
A: Minimum 8GB, recommended 16GB+. The 14GB model is memory-mapped, so it doesn't all load into RAM at once.
A: Yes! This project is licensed under Apache 2.0, which permits commercial use.
More questions? Check the full FAQ or open an issue.
See the full roadmap: docs/ROADMAP.md
This project builds on incredible work from the ML and Rust communities:
Special thanks to:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2026 VLM Inference Server Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
If you find this project useful, please consider giving it a star βοΈ
It helps others discover the project and motivates continued development!
Built with β€οΈ using Rust
Quick Start β’ Features β’ Architecture β’ Contributing β’ Blog Post
This README was crafted following best practices from:
4 commits
Rust
99.3%
Production-grade Rust inference server for multimodal models (image + text β streamed text), with OpenAI-compatible APIs and high-throughput GPU scheduling.
Rust
8
4 commits
updated Jan 26, 2026
A high-performance, production-ready Vision-Language Model (VLM) inference server built entirely in Rust
Transform images and text into insights with this OpenAI-compatible inference server powered by real AI models (LLaVA 1.5) and the Candle ML framework.
Modern AI applications need to understand both images and text together - whether it's analyzing medical scans, describing product images, or answering questions about visual data. But deploying vision-language models (VLMs) is challenging:
We built this to solve those problems with a pure Rust implementation that's:
π Read the full story in our deep-dive blog post β
Get up and running in 5 minutes:
# Clone the repository
git clone https://github.com/mixpeek/multimodal-inference-server.git
cd vlm-inference-server
# Build the project (Release mode for best performance)
cargo build --release
# Start the worker (downloads 14GB model on first run)
./target/release/vlm-worker --host 0.0.0.0 --port 50051 &
# Start the gateway (HTTP API)
./target/release/vlm-gateway --host 0.0.0.0 --port 8080 &
# Send a chat completion request
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "vlm-prod",
"messages": [{"role": "user", "content": "Hello, how are you?"}],
"max_tokens": 20
}'
That's it! You now have a VLM inference server running locally.
/healthz and /readyz endpoints for Kubernetesβββββββββββββββ ββββββββββββ βββββββββββββββ
β Client β β Gateway β β Worker β
β (HTTP) βββββββββββΆβ (HTTP) βββββββββββΆβ (gRPC) β
β ββββββββββββ ββββββββββββ β
βββββββββββββββ ββββββββββββ βββββββββββββββ
β β
β βΌ
β βββββββββββββββββββ
β β Candle Engine β
β β βββββββββββββ β
β β β CLIP β β
β β β Vision β β
β β βββββββββββββ β
β β βββββββββββββ β
β β β LLaMA-2 β β
β β β LLM β β
β β βββββββββββββ β
β βββββββββββββββββββ
β
βΌ
ββββββββββββββββββββ
β Observability β
β Metrics, Logs β
ββββββββββββββββββββ
Learn more: Architecture Documentation β
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "vlm-prod",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Explain quantum computing in simple terms."}
],
"max_tokens": 100,
"temperature": 0.7
}'
curl -N -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "vlm-prod",
"messages": [{"role": "user", "content": "Write a haiku about Rust"}],
"max_tokens": 50,
"stream": true
}'
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "vlm-prod",
"messages": [{
"role": "user",
"content": [
{"type": "text", "text": "What'\''s in this image?"},
{"type": "image_url", "image_url": {"url": "data:image/jpeg;base64,/9j/4AAQ..."}}
]
}],
"max_tokens": 100
}'
More examples: examples/
| Endpoint | Method | Description |
|---|---|---|
/v1/chat/completions | POST | Create a chat completion (OpenAI-compatible) |
/healthz | GET | Health check |
/readyz | GET | Readiness check |
/v1/models | GET | List available models |
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | Yes | - | Model identifier (e.g., "vlm-prod") |
messages | array | Yes | - | Conversation messages |
max_tokens | integer | No | 256 | Maximum tokens to generate |
temperature | float | No | 1.0 | Sampling temperature (0.0-2.0) |
top_p | float | No | 1.0 | Nucleus sampling parameter |
stream | boolean | No | false | Enable streaming responses |
stop | string/array | No | - | Stop sequences |
Full API documentation: docs/API.md
Benchmarks on Apple M3 Ultra (192GB RAM, CPU mode):
| Metric | Value |
|---|---|
| Model Loading | ~30s (one-time) |
| Vision Encoding | 100-200ms per image |
| Prefill (256 tokens) | 500ms-1s |
| Decode | 100-200ms per token |
| End-to-End (20 tokens) | 2-5s |
| Memory Usage | ~16GB |
Performance tuning: docs/PERFORMANCE.md
vlm-inference-server/
βββ crates/
β βββ api_types/ # OpenAI-compatible API types
β βββ proto/ # gRPC protocol definitions
β βββ gateway/ # HTTP edge service
β βββ worker/ # Inference worker service
β βββ engine/ # ML engine trait definitions
β βββ engine_adapters/
β β βββ mock_engine/ # Test mock
β β βββ candle_engine/ # Candle ML implementation
β βββ multimodal/ # Image preprocessing
β βββ scheduler/ # Batching & admission control
β βββ kv_cache/ # Key-value cache management
β βββ sampling/ # Token sampling strategies
β βββ common/ # Shared utilities
β βββ observability/ # Tracing & metrics
βββ docs/ # Documentation
βββ examples/ # Usage examples
βββ scripts/ # Helper scripts
# Run all tests
cargo test --workspace
# Run specific crate tests
cargo test --package vlm-candle-engine
# Run with logging
RUST_LOG=debug cargo test
# Run integration tests
cargo test --test '*'
# Debug build (faster compile, slower runtime)
cargo build
# Release build (optimized)
cargo build --release
# With specific features
cargo build --bin vlm-worker --features candle --release
# Check code style
cargo fmt --all -- --check
cargo clippy --all-targets --all-features
# Build image
docker build -t vlm-inference-server .
# Run container
docker run -p 8080:8080 -p 50051:50051 vlm-inference-server
# See k8s/ directory for full manifests
kubectl apply -f k8s/deployment.yaml
kubectl apply -f k8s/service.yaml
# See systemd/ directory for service files
sudo cp systemd/vlm-worker.service /etc/systemd/system/
sudo cp systemd/vlm-gateway.service /etc/systemd/system/
sudo systemctl enable --now vlm-worker vlm-gateway
Deployment guides: docs/DEPLOYMENT.md
We love contributions! Whether you're:
Please read our Contributing Guide first.
git checkout -b feature/amazing-featurecargo test --workspacegit commit -m "Add amazing feature"git push origin feature/amazing-featureA: Yes! The Candle engine supports Metal (Apple Silicon), CUDA (NVIDIA), and CPU. Metal support is enabled by default on macOS.
A: Currently LLaVA 1.5 7B. The modular architecture makes it easy to add other models (see Adding Models).
A: Yes! It handles real inference with proper error handling, health checks, and observability. The main limitation is tokenization (tokens shown as tok{id} instead of decoded text).
A: Minimum 8GB, recommended 16GB+. The 14GB model is memory-mapped, so it doesn't all load into RAM at once.
A: Yes! This project is licensed under Apache 2.0, which permits commercial use.
More questions? Check the full FAQ or open an issue.
See the full roadmap: docs/ROADMAP.md
This project builds on incredible work from the ML and Rust communities:
Special thanks to:
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
Copyright 2026 VLM Inference Server Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
If you find this project useful, please consider giving it a star βοΈ
It helps others discover the project and motivates continued development!
Built with β€οΈ using Rust
Quick Start β’ Features β’ Architecture β’ Contributing β’ Blog Post
This README was crafted following best practices from:
4 commits
Rust
99.3%