Status: [LIVE] Endpoints found: https://api.openai.com/v1/chat/completions https://api.openai.com/v1/chat Source: https://github.com/yankeguo/nanollm # nanollm [中文运维文档](README.zh.md) A small OpenAI- and Anthropic-compatible LLM reverse proxy. Map one client-facing model name to ordered upstream providers without converting between API protocols. ## Features - OpenAI Chat Completions, Completions, Embeddings, and Responses; Anthropic Messages; Bailian multimodal embeddings; Ollama Chat; and TypeSafe System One - Vendor-host-prefixed routes and protocol-specific provider associations; no cross-protocol body conversion - Cache-preserving failover only on transport failure or HTTP `502`/`503`/`504` - Byte-for-byte SSE and Ollama NDJSON streaming, with SSE keepalive comments - YAML configuration and incoming API-key authentication without forwarding client credentials upstream - Slim MySQL call indexes, with optional S3-compatible request/response archives and content-addressed attachments - Preact admin UI for usage charts, call filtering, and on-demand detail viewing - Graceful SIGINT/SIGTERM shutdown that waits indefinitely for in-flight requests; a second signal terminates ## Quick start Prerequisites: a reachable MySQL 8.x database. Source builds and the password generator require Go 1.27.4+. Generate an admin password hash without putting the password in shell history: ```bash read -rs PASSWORD && printf '%s\n' "$PASSWORD" | go run ./scripts/gen-admin-password ``` ### Config Save this minimal index-only configuration as `config.yaml`, replacing every `REPLACE_ME` value and the example password hash: ```yaml mysql: dsn: nanollm:REPLACE_ME@tcp(127.0.0.1:3306)/nanollm admin: username: admin # Example hash for REPLACE_ME; generate your own with the command above. password_scrypt: $scrypt$ln=15,r=8,p=1$p4ZkkEnbaLrg9W2WeG9V0w$L3AGlLF/mmjVa/qp0WoAh9e8mXHkvOYAaOnkcRTYOMM secret_key: REPLACE_ME api_keys: - name: default value: sk-REPLACE_ME providers: - name: openai headers: Authorization: Bearer sk-REPLACE_ME openai_completions: url: https://api.openai.com/v1/