Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

23 Commits

Folders and files

Repository files navigation

LlmGateway

Lightweight LLM API gateway with OpenAI and Anthropic Messages support.

Features

  • OpenAI Compatible API - /v1/chat/completions
  • Anthropic Messages API - /v1/messages
  • Multi-Upstream Support - Round-robin load balancing
  • Model Mapping - Map local model names to upstream models
  • Rate Limiting - Per-upstream RPM limiting
  • API Key Authentication
  • Response Validation - Fixes tool_call format issues

Quick Start

# Build
go build -o llm-gateway .

# Run
./llm-gateway

Configuration

Edit config.toml:

[server]
host = "0.0.0.0"
port = 3000

[[upstream]]
name = "nvidia"
base_url = "https://integrate.api.nvidia.com/v1"
api_key = "nv-xxx"
timeout = 120

[ratelimit]
enabled = true
requests_per_minute = 40

[auth]
enabled = true
api_keys = ["sk-test123"]

API Endpoints

Endpoint Description
GET /health Health check
POST /v1/chat/completions OpenAI Chat Completions
POST /v1/responses OpenAI Responses API
POST /v1/messages Anthropic Messages
GET /v1/models List models

Model Mapping

Configure model mappings in config.toml:

[models]
auto_chat = "nvidia/nemotron-3-nano-30b-a3b"

License

MIT

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages