Janus README

The project's README from github.com/Vibra-Ingenn/Janus. As one markdown file: README.md.

Janus logo

Janus — Local LLM Server & OpenAI-Compatible API

Janus is a single Go binary that runs .gguf models on your machine (GPU or CPU) and exposes an OpenAI-compatible API. No Python, no Docker, no Ollama required.

Use it your way: call it from the command line (curl, PowerShell, scripts), wire it into Cursor / Cline / any OpenAI client — same local models, whatever workflow fits you.


What you get


Requirements

Platform What you need
Windows (primary) Windows 10/11, Go 1.25+, Vulkan-capable GPU recommended
Linux Go 1.25+, curl, tar, Vulkan (Mesa/NVIDIA driver; check with vulkaninfo) or CPU
macOS Go 1.25+, CPU backend (Vulkan varies by hardware)

Disk: plan for the model size (often 2–8 GB per model) plus ~50 MB for Janus + llama.dll.


Quick start (Windows)

1. Clone and build

git clone https://github.com/Vibra-Ingenn/Janus.git
cd Janus
.\build.ps1

build.ps1 downloads pre-built llama.cpp Vulkan DLLs and compiles dist\janus.exe.

2. Download a model

Put a .gguf file in the models\ folder. Use the included downloader:

go build -o dist\modelget.exe .\cmd\modelget
.\dist\modelget.exe -repo meta-llama/Llama-3.2-3B-Instruct -file Llama-3.2-3B-Instruct-Q8_0.gguf -out .\models\

Or download any GGUF from Hugging Face.

3. Configure

copy .env.example .env

Edit .env:

INFERENCE_BACKEND=vulkan
JANUS_MODEL_PATH=./models/Llama-3.2-3B-Instruct-Q8_0.gguf
JANUS_MAX_TOKENS=4096
Variable Default Meaning
INFERENCE_BACKEND vulkan vulkan, cpu, or openrouter
JANUS_MODEL_PATH (required) Path to your .gguf file
JANUS_GPU_LAYERS -1 -1 = all layers on GPU, 0 = CPU only
JANUS_VRAM_CEILING_MB 9216 VRAM budget hint (MiB)
JANUS_MAX_TOKENS 4096 Max tokens per reply
JANUS_LISTEN_ADDR 127.0.0.1:8990 Bind address

4. Run

.\dist\janus.exe

Opens http://127.0.0.1:8990 in your browser.

5. Verify

curl http://127.0.0.1:8990/health

Quick start (Linux)

git clone https://github.com/Vibra-Ingenn/Janus.git
cd Janus
./build.sh                      # downloads llama.cpp b11146 (Vulkan) into lib/linux, builds dist/janus
cp .env.example .env
# edit .env — set JANUS_MODEL_PATH (and INFERENCE_BACKEND=cpu if no Vulkan)
./dist/janus

Supported: linux/amd64; arm64/macOS not tested/not supported.

macOS: build with go build -o dist/janus ./cmd/janus and provide libllama.dylib next to the binary (untested).


OpenAI-compatible API

curl http://127.0.0.1:8990/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "local",
    "messages": [{"role": "user", "content": "Hello!"}]
  }'

Base URL: http://127.0.0.1:8990/v1

Endpoints

Method Path Description
GET /health Liveness check (?deep=true for details)
GET /v1/models Model list
POST /v1/chat/completions Chat (streaming supported)
POST /models/load Hot-swap model
GET /models/list Available .gguf files
GET /engine/status VRAM and backend info

Streaming

curl http://127.0.0.1:8990/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"local","stream":true,"messages":[{"role":"user","content":"Tell me a joke"}]}'

Connect to Cursor / Cline / other clients

Base URL:  http://127.0.0.1:8990/v1
API Key:   (leave blank)

Pitfalls (learned the hard way)

Problem What's going on Fix
"It built but my changes aren't there" On Windows, Go can't overwrite a running .exe. Stop all janus.exe in Task Manager, then rebuild.
"Address already in use" A leftover process holds port 8990. Task Manager → end all janus.exe.
Server starts, chat fails JANUS_MODEL_PATH wrong or no .gguf in models/. Set the path in .env, put the file in models/.
"local engine failed to start" Missing llama.dll or GPU driver issue. Run .\build.ps1. Update GPU drivers, or set INFERENCE_BACKEND=cpu.
Wrong URL Default is http://127.0.0.1:8990, not 8080. Bookmark 8990.
First reply takes forever Model loading into VRAM — normal. Wait 10–60s; smaller quants (Q4) load faster.

Project layout

cmd/janus/          Main server (OpenAI-compatible API)
cmd/modelget/       Hugging Face model downloader
internal/engine/    llama.cpp Vulkan/CPU backend
internal/bridge/    DLL loader and FFI bindings
internal/singleton/ Single-instance guard
models/             Put .gguf files here (not committed)
dist/               janus.exe + llama.dll after build

Development

Get-Process -Name "janus" -ErrorAction SilentlyContinue | Stop-Process -Force
go test ./...
go build -o dist\janus.exe .\cmd\janus
.\dist\janus.exe

Or just .\run.ps1. For a full build including llama DLLs, use .\build.ps1.

Contributions welcome — see CONTRIBUTING.md.


License

MIT — see LICENSE.

Janus (Vibra-Ingenn/Janus)

Searching Database…

135 ·GitHub
这是什么?Janus 是一个单一的 Go 二进制文件,可以在你的机器(GPU 或 CPU)上运行本地 .gguf 语言模型,并暴露兼容 OpenAI 的 API,让你无需 Python、Docker 或 Ollama 就能使用本地模型。
这是聊天应用还是本地 API 服务器?它是一个以单个可执行文件(Windows 上为 janus.exe)运行的本地 API 服务器——没有内置聊天界面,你通过 curl、脚本或任何兼容 OpenAI 的客户端与它交互。
怎么把它跑起来?克隆仓库,在 Windows 上运行 build.ps1(或在 Linux 上运行 build.sh)编译出 dist/janus.exe,把一个 .gguf 文件放进 models/ 文件夹,编辑 .env 指向它,然后运行该二进制文件。
构建之前需要装什么?构建需要 Go 1.25+;建议使用支持 Vulkan 的 GPU(AMD/Intel/NVIDIA)来加速,否则会回退到 CPU。
有什么平台或构建上的坑需要知道吗?Linux 仅支持 amd64,macOS/arm64 明确未测试且不受支持;在 Windows 上,重新构建之前必须先在任务管理器中结束正在运行的 janus.exe,否则它会悄悄继续运行旧的二进制文件。
Janus 能和 Cursor 或 Cline 这类编程工具一起用吗?可以。由于它在 /v1/chat/completions 等端点上暴露兼容 OpenAI 的 API,你可以把 Cursor、Cline 或任何兼容 OpenAI 的客户端指向它来使用本地模型。
能不能不重启服务器就切换模型?可以,/models/load 端点可以热切换已加载的 .gguf 模型,无需重启 Janus。
它支持推理(思考)模型吗?支持,Janus 支持思考模型,并把模型的推理过程拆分到响应中单独的 reasoning_content 字段。
为什么不选 Ollama 而选这个?Janus 以单个零依赖的二进制文件发布,无需 Python、Docker 或 Ollama,使用 Vulkan 在 AMD、Intel 和 NVIDIA 显卡上进行 GPU 加速,并能从 GGUF 元数据自动检测聊天模板。
Size
0.7 MB
Stars
135
Updated
CommitOct 08
Age
24d
Commits · 90 Days