中文文档 | Configuration reference
ModelBridge is a Gin-based LLM API protocol bridge. It accepts requests in the OpenAI Chat, OpenAI Responses, Anthropic Messages, Gemini, or Ollama Chat schemas, converts them through a shared internal representation, and forwards them to one configured upstream. See CONFIG.md for the full environment-variable reference, supported target protocols, model-list routes and conversion notes.
Install:
curl -fsSL https://cdn.bring.cool/cnb/Bring/Project/Series/ModelBridge@main/install.sh | sh
Windows PowerShell:
irm https://cdn.bring.cool/cnb/Bring/Project/Series/ModelBridge@main/install.ps1 | iex
Run against an OpenAI-compatible upstream:
TARGET_PROTOCOL=openai-chat \
TARGET_BASE_URL=https://api.openai.com/v1 \
TARGET_TOKEN="$OPENAI_API_KEY" \
go run ./cmd/server
TARGET_TOKEN may be empty for local or unauthenticated upstreams, or when
client authentication should pass through to the upstream.
Health check:
curl http://localhost:8080/healthz
| Protocol | Route |
|---|---|
| OpenAI Chat | POST /v1/chat/completions |
| OpenAI Responses | POST /v1/responses |
| Claude Messages | POST /v1/messages |
| Gemini | POST /v1beta/models/{model}:generateContent |
| Gemini stream | POST /v1beta/models/{model}:streamGenerateContent |
| Ollama Chat | POST /api/chat |
Model-list routes (GET /v1/models, GET /v1beta/models, GET /api/tags) are
documented in CONFIG.md.
docker run --rm -p 8080:8080 \
-e TARGET_PROTOCOL=openai-chat \
-e TARGET_BASE_URL=https://api.openai.com/v1 \
-e TARGET_TOKEN="$OPENAI_API_KEY" \
docker.cnb.cool/bring/project/series/modelbridge:latest
go test ./...
go test -coverprofile=coverage.out -covermode=atomic ./...
Smoke and benchmark workflows are documented in docs/verification.md.
Licensed under the Apache License 2.0.
Copyright 2026 leun