freshcrate
Skin:/

smg

Engine-agnostic LLM gateway in Rust. Full OpenAI & Anthropic API compatibility across SGLang, vLLM, TRT-LLM, OpenAI, Gemini & more. Industry-first gRPC pipeline, KV cache-aware routing, chat history,

Why this rank:Strong adoptionRecent releaseHealthy release cadence

Description

Engine-agnostic LLM gateway in Rust. Full OpenAI & Anthropic API compatibility across SGLang, vLLM, TRT-LLM, OpenAI, Gemini & more. Industry-first gRPC pipeline, KV cache-aware routing, chat history, tokenization caching, Responses API, embeddings, WASM plugins, MCP, and multi-tenant auth.

README

SMG Logo

Shepherd Model Gateway

Release Docker PyPI License Docs Discord Slack Ask DeepWiki

High-performance model-routing gateway for large-scale LLM deployments. Centralizes worker lifecycle management, balances traffic across HTTP/gRPC/OpenAI-compatible backends, and provides enterprise-ready control over history storage, MCP tooling, and privacy-sensitive workflows.

SMG Architecture

Why SMG?

๐Ÿš€ Maximize GPU Utilization Cache-aware routing understands your inference engine's KV cache stateโ€”whether SGLang, vLLM, or TensorRT-LLMโ€”to reuse prefixes and reduce redundant computation.
๐Ÿ”Œ One API, Any Backend Route to self-hosted models (SGLang, vLLM, TensorRT-LLM) or cloud providers (OpenAI, Anthropic, Gemini, Bedrock, and more) through a single unified endpoint.
โšก Built for Speed Native Rust with gRPC pipelines, sub-millisecond routing decisions, and zero-copy tokenization. Circuit breakers and automatic failover keep things running.
๐Ÿ”’ Enterprise Control Multi-tenant rate limiting with OIDC, WebAssembly plugins for custom logic, and a privacy boundary that keeps conversation history within your infrastructure.
๐Ÿ“Š Full Observability 40+ Prometheus metrics, OpenTelemetry tracing, and structured JSON logs with request correlationโ€”know exactly what's happening at every layer.

API Coverage: OpenAI Chat/Completions/Embeddings, Responses API for agents, Anthropic Messages, and MCP tool execution.

Quick Start

Install โ€” pick your preferred method:

# Docker
docker pull lightseekorg/smg:latest

# Python
pip install smg

# Rust
cargo install smg

Run โ€” point SMG at your inference workers:

# Single worker
smg --worker-urls http://localhost:8000

# Multiple workers with cache-aware routing
smg --worker-urls http://gpu1:8000 http://gpu2:8000 --policy cache_aware

# With high availability mesh
smg --worker-urls http://gpu1:8000 --enable-mesh \
  --mesh-advertise-host 10.0.0.1 --mesh-peer-urls 10.0.0.2:39527

Use โ€” send requests to the gateway:

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

That's it. SMG is now load-balancing requests across your workers.

Supported Backends

Self-Hosted Cloud Providers
vLLM OpenAI
SGLang Anthropic
TensorRT-LLM Google Gemini
Ollama AWS Bedrock
Any OpenAI-compatible server Azure OpenAI

Features

Feature Description
8 Routing Policies cache_aware, round_robin, power_of_two, consistent_hashing, prefix_hash, manual, random, bucket
gRPC Pipeline Native gRPC with streaming, reasoning extraction, and tool call parsing
MCP Integration Connect external tool servers via Model Context Protocol
High Availability Mesh networking with SWIM protocol for multi-node deployments
Chat History Pluggable storage: PostgreSQL, Oracle, Redis, or in-memory
WASM Plugins Extend with custom WebAssembly logic
Resilience Circuit breakers, retries with backoff, rate limiting

Documentation

Getting Started Installation and first steps
Architecture How SMG works
Configuration CLI reference and options
API Reference OpenAI-compatible endpoints
Kubernetes Setup In-cluster discovery and production setup

Contributing

We welcome contributions! See Contributing Guide for details.

Release History

VersionChangesUrgencyDate
v1.13.0# Shepherd Model Gateway v1.13.0 SMG v1.13.0 makes the gRPC serving path faster, lighter and closer to the engines behind it. On the same 18 engines as v1.12.0, it serves **nearly twice the image traffic** and finishes those requests **3.3ร— sooner**, with **38โ€“56% less CPU per request** and **about half the router memory**. It also serves **1.63ร— the image traffic of another open-source router** on the same hosts. The tokenizer, media pipeline and chat templates now produce what the engines' High10/15/2026
v1.12.0# Shepherd Model Gateway v1.12.0 SMG v1.12.0 adds **AMD prefill/decode support contributed by the AMD team** and improves performance across gateway streaming, tokenization, engine services, cache-aware routing, and multimodal processing. It also adds Decisions and System One endpoints and fixes streaming, tool-call, and worker-management issues. This release includes 141 commits from 19 contributors, including 9 first-time contributors. Benchmarks below are reported in the linked PRs. High10/8/2026
v1.11.0## ๐Ÿš€ Shepherd Model Gateway v1.11.0 Released **OpenAI-compatible is no longer the only standard.** Every major frontier vendor now publishes its own protocol contract and ships its own conformance checker to enforce it: Kimi's dynamic tools and fixed sampling parameters, MiniMax's `root` role and streaming rules, z.ai's thinking constraints, DeepSeek's tool-call syntax and usage placement. A gateway that flattens all of them onto the OpenAI baseline breaks each one in a different place. **SMHigh9/24/2026
v1.10.1## ๐Ÿš€ Shepherd Model Gateway v1.10.1 Released Patch release: **TokenSpeed attention-DP rank affinity**, **Qwen4 (experimental) vision support**, routing-path performance follow-ups, and ZMQ fixes from the v1.10.0 rollout. ### ๐ŸŽฏ TokenSpeed: Attention-DP Rank Affinity **Requests can now pin to specific attention-DP ranks on TokenSpeed engines:** **Rank pinning** โ€” Pin field routes a request to a specific attention-DP rank **Residue rooms + capability handshake** โ€” The gateway negotiaMedium8/27/2026
v1.10.0## ๐Ÿš€ Shepherd Model Gateway v1.10.0 Released Our deepest engine integration and biggest efficiency release yet: **direct ZMQ connections to the engine core** for vLLM, TokenSpeed, and SGLang โ€” plus a **25x memory reduction at hundreds of thousands-worker scale**, a **complete service-discovery rewrite**, and **vLLM PD disaggregation in HTTP mode**. ### โšก ZMQ Direct Engine Connections: vLLM, TokenSpeed, SGL **SMG now connects directly to the engine's core over ZMQ โ€” no engine API serverHigh8/25/2026
v1.9.0## ๐Ÿš€ Shepherd Model Gateway v1.9.0 Released A focused release headlined by **Kimi K3 support** and **tenant rate limiting** โ€” extending the multi-tenancy foundation from v1.8.0 โ€” plus **Responses API in PD mode**, batched completion prompts, model aliases, and an engine-version bump across all four backends. ### ๐Ÿค– Kimi K3 Support **Full end-to-end integration for Kimi K3 across text, vision, tools, and reasoning:** - **Dedicated vision processor** โ€” K3 gets its own multimodal imageHigh7/30/2026
v1.8.0## ๐Ÿš€ Shepherd Model Gateway v1.8.0 Released Our biggest multimodal release yet: **EPD (Encode-Prefill-Decode) disaggregation**, **engine-agnostic tensor transport over SHM and RDMA**, and **audio support** (Qwen3 ASR + Omni) โ€” plus **dedicated multimodal + audio support for Thinking Machines' Inkling model**, per-tenant API keys, LoRA adapter management, and a second nightly correctness harness. > โš ๏ธ **Breaking change**: The legacy `smg server` command has been removed. Use `smg launch` oHigh7/18/2026
v1.7.0## ๐Ÿš€ Shepherd Model Gateway v1.7.0 Released This release leads with a correctness milestone. SMG runs the correctness-critical path โ€” tokenization, function-call parsing, and reasoning parsing โ€” natively in Rust, and that path is now proven on par with vLLM on tool-calling quality, validated by a nightly BFCL A/B harness. Plus new PD and engine-load metrics, GLM-5.x support, custom routing keys, and a major dependency sweep. ### ๐ŸŽฏ Rust-Native Correctness, Validated Against vLLM **SMG High6/29/2026
v1.6.0## ๐Ÿš€ Shepherd Model Gateway v1.6.0 Released A performance and production-hardening release: **unified SSE codec across every streaming path**, **KV cache events for vLLM and TokenSpeed**, **routing hot-path optimizations**, **multimodal optimizations**, and **graceful shutdown hardening**. ### โšก Streaming Performance: Unified SSE Codec **Every streaming path now runs through a single shared SSE codec โ€” no more per-router SSE parsing and re-encoding:** **Anthropic Messages** โ€” SharedHigh6/21/2026
v1.5.0## ๐Ÿš€ Shepherd Model Gateway v1.5.0 Released Our biggest release yet: **priority scheduling with preemption**, **two new backends โ€” TokenSpeed and MLX** โ€” bringing SMG to five supported engines, and **complete Responses API protocol coverage**. ### ๐ŸŽ›๏ธ Priority Scheduler **New request scheduler with admission control, prioritization, and preemption:** - **Priority classes** โ€” Configurable request classes with policy-driven admission - **Admission control** โ€” Inflight tracking, queueHigh6/12/2026
v1.4.1## ๐Ÿš€ Shepherd Model Gateway v1.4.1 Released Patch release with **mesh HA stability fix**, **DP rank scheduling**, **reasoning parser fixes**, and engine version bumps. ### Mesh HA Stability Fix **Fixed premature worker removal during rolling deploys:** - Workers synced via mesh with `health: false` were being removed by the health checker before they had a chance to pass local health checks - Fix: health checker now only removes workers whose health check **actually failed this tiHigh4/9/2026
v1.4.0## ๐Ÿš€ Shepherd Model Gateway v1.4.0 Released The biggest SMG release yet -- **Kubernetes-native deployment via Helm**, a **terminal dashboard**, **200x mesh memory reduction**, **7-11x faster multimodal preprocessing**, **native Completion API over gRPC**, and **per-model retry configuration**. ### Kubernetes-Native Deployment with Helm **Production-ready Helm chart for deploying SMG on Kubernetes:** - **One-command deployment** -- `helm install smg oci://ghcr.io/lightseekorg/smg-helHigh4/2/2026
v1.3.3## ๐Ÿš€ Shepherd Model Gateway v1.3.3 Released Major performance release with **7x faster mesh synchronization** and critical bug fixes. ### โšก Mesh Performance Revolution **Switched mesh serialization from JSON to bincode with dramatic performance improvements:** **Benchmark Results** (production workload - 1024 operations, 4000 tokens): - **Serialization**: 7.1x faster (35.5ms โ†’ 5.0ms) - **Deserialization**: 14.8x faster (63.4ms โ†’ 4.3ms) - **Wire size**: 4.3x smaller (67.9MB โ†’ 15.7Low3/21/2026
v1.3.2## ๐Ÿš€ Shepherd Model Gateway v1.3.2 Released Feature release adding **multimodal support to Messages API** and Python mesh bindings. ### ๐ŸŽจ Multimodal Support for Messages API **Complete vision/image support in Messages API gRPC pipeline:** - Native image processing for Messages API requests - Works across all gRPC backends (SGLang, vLLM, TensorRT-LLM) - Full feature parity with Anthropic's Messages API including vision **Impact**: Messages API now supports both text and vision Low3/17/2026
v1.3.1## ๐Ÿš€ Shepherd Model Gateway v1.3.1 Released Minor release with operational improvements and bug fixes. ### ๐Ÿ› ๏ธ New Features **Operational improvements:** - `--remove-unhealthy-workers` flag - Automatically remove workers that fail health checks - `disable_tokenizer_autoload` support - Skip automatic tokenizer loading for custom configurations ### ๐Ÿ› Bug Fixes - **Gateway**: Index external workers by all discovered models (not just primary model) - **CI**: Added VERSION_OVERRLow3/16/2026
v1.3.0## ๐Ÿš€ Shepherd Model Gateway v1.3.0 Released We're excited to announce **Shepherd Model Gateway v1.3.0** โ€“ a major release bringing **native Messages API support** and expanding our agentic workload capabilities. ### ๐ŸŽฏ Messages API: First-Class Implementation **Native Messages API implementation with core protocol support:** credits to @CatherineSue - **True first-class support** โ€” Direct protocol implementation, not a translation layer - **Extended thinking** โ€” Native ThinkingConLow3/15/2026
v1.2.0## ๐Ÿš€ Shepherd Model Gateway v1.2.0 Released! We're thrilled to announce **Shepherd Model Gateway v1.2.0** โ€“ a transformative release featuring **enhanced event-driven cache-aware routing**, **production-ready client SDKs**, **Google Gemini integration**, and **vLLM gRPC server adoption**! ### โšก **Enhanced Event-Driven Cache-Aware Routing** **Inspired by Amazon Dynamo's distributed caching principles**, SMG extends its existing cache-aware routing with real-time KV cache event subscriptLow3/10/2026
v1.1.0## ๐Ÿš€ Shepherd Model Gateway v1.1.0 Released! We're excited to announce **Shepherd Model Gateway v1.1.0** โ€“ a major feature release bringing **universal multimodal support**, **Messages API MCP integration**, and **critical production hardening** across the entire stack! ### ๐ŸŽจ **Universal Multimodal Support** ๐Ÿ”ฅ **Industry-leading multimodal processing across all major inference engines:** - **SGLang gRPC** - Full multimodal pipeline with vision processing - **vLLM gRPC** - Fetch +Low2/23/2026
v1.0.1## ๐ŸŽ‰ Introducing Shepherd Model Gateway v1.0.1! We're thrilled to announce **Shepherd Model Gateway v1.0.1** โ€“ formerly SGLang Model Gateway. This major release marks a new chapter with a complete architectural overhaul, new enterprise features, and production-grade improvements! ### ๐Ÿ‘ **Welcome to Shepherd** **SGLang Model Gateway is now Shepherd Model Gateway (SMG)**. **Truly Engine-Agnostic Architecture**: Shepherd is your universal gateway supporting **all major inference enginLow2/13/2026

Dependencies & License Audit

Loading dependencies...

Similar Packages

DaemoraOpen-source AI agent - any LLM, any MCP server, any channel. Self-hosted, autonomous, multi-tenant.2026.1.0-beta.0
LeanKGLeanKG: Stop Burning Tokens. Start Coding Lean.v0.35.3
oh-my-piโŒฅ AI Coding agent for the terminal โ€” hash-anchored edits, optimized tool harness, LSP, Python, browser, subagents, and morev18.12.6
agentroveYour own Claude Code UI, sandbox, in-browser VS Code, terminal, multi-provider support (Anthropic, OpenAI, GitHub Copilot, OpenRouter), custom skills, and MCP servers.v0.1.64
claw-pilotMulti-agent orchestration runtime with task board, flow engine, budget control, MCP integration and real-time dashboard. Self-hosted on Linux/macOS.v0.84.14

More in MCP Servers

litellmPython SDK, Proxy Server (AI Gateway) to call 100+ LLM APIs in OpenAI (or native) format, with cost tracking, guardrails, loadbalancing and logging. [Bedrock, Azure, OpenAI, VertexAI, Cohere, Anthropi
ruflo๐ŸŒŠ The leading agent orchestration platform for Claude. Deploy intelligent multi-agent swarms, coordinate autonomous workflows, and build conversational AI systems. Features enterprise-grade archit
@claude-flow/cliRuflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code
claude-plugins-officialOfficial, Anthropic-managed directory of high quality Claude Code Plugins.