Janus is a Rust workspace for local, GPU-accelerated LLM inference with a modular server architecture.
It includes a WebGPU-based engine, an OpenAI-compatible chat API server, deterministic routing, and a set
of composable janus-mod-* modules.
- GPU inference via
wgpu(Vulkan/Metal/DX12 backends) - Model loading from GGUF and Safetensors
- OpenAI-compatible chat endpoint:
POST /v1/chat/completions - Streaming responses via Server-Sent Events (SSE)
- Built-in web chat UI (
GET /chat) and health check (GET /health) - Modular architecture with in-process module plugins via
JanusPluginand pluggablejanus-mod-*crates
Current workspace members in Cargo.toml:
crates/janus-engine- core inference engine, model formats, generationcrates/janus-server- HTTP server and OpenAI-compatible APIcrates/janus-router- deterministic routing primitivescrates/janus-mod-*- modular server plugins (instruct, routing, vision, tts, etc.)
There are also legacy example plugin crates under crates/plugins/ that are not part of the workspace.
- Rust toolchain (workspace uses Rust 2024 edition)
- A supported GPU/runtime for
wgpu(Vulkan, Metal, or DirectX 12) - Model assets:
model.gguformodel.safetensorstokenizer.jsonconfig.json(required for Safetensors)
# Build all crates
cargo build --workspace --release
# Run tests
cargo test --workspace
# Optional lint/format checks
cargo fmt --all -- --check
cargo clippy --workspace -- -D warningsDirectory mode (recommended):
cargo run -p janus-engine --example inference --release -- path/to/model_dir "Hello from Janus"File mode examples are documented in crates/janus-engine/examples/inference.rs.
cargo run -p janus-server --release -- path/to/model_dir --host 0.0.0.0 --port 8080You can also pass a model file directly (.gguf or .safetensors) instead of a directory.
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "model",
"messages": [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is Janus?"}
],
"max_tokens": 128,
"temperature": 0.7
}'For streaming, set "stream": true.
GET /- HTML docs/landing pageGET /chat- interactive browser chat UIGET /health- health + loaded model namePOST /v1/chat/completions- OpenAI-compatible chat completions (streaming and non-streaming)
janus-routerprovides deterministic local/cloud routing heuristics used by serving layers.- Plugins are module-based and compose through
janus_engine::JanusPluginat app startup. janus-servercurrently wires in multiplejanus-mod-*plugins at startup (instruct, router, knowledge, lora, rp, tts, vecmem, vision, vismem, voice, imggen).
doc/ARCHITECTURE.mddoc/SHADER_GUIDE.mddoc/PERFORMANCE_TUNING.mddoc/SUPPORTED_MODELS.mddoc/FP16_IMPLEMENTATION.mddoc/SERVER_README.md
Contributions are welcome. Before opening a PR, please run:
cargo test --workspace
cargo fmt --all
cargo clippy --workspace -- -D warningsLGPL-3.0-or-later. See LICENSE.