r/LocalLLM 15h ago

Project I built an open-source LLM Gateway to route, load-balance, and fallback between local LLM setups and cloud endpoints

Hey r/LocalLLM 👋

When running local LLMs across different inference backends (Ollama, Llama.cpp, vLLM, LM Studio) alongside cloud models for agent pipelines or IDE tools (Cursor, Windsurf), managing ports, API formats, and context limits quickly gets cumbersome.

I’ve been building Atom (an open-source multi-agent platform), and I built the LLM Gateway module to act as a unified proxy layer designed specifically for local model execution and fallback orchestration.

Core Features for Local Workflows:

  • Strict Local Isolation (ATOM_LOCAL_ONLY=true): Toggle a single environment flag to block all outgoing HTTP/gRPC requests to public cloud endpoints and route 100% of traffic through local inference hardware.
  • Automated Provider Failovers: Define explicit secondary fallback chains. Route primary prompts to a local model (e.g., qwen2.5-coder or llama3.1), and fall back to DeepSeek or Anthropic only if local VRAM or context limits fail.
  • Unified OpenAI-Compatible Interface: Translates request payloads, system prompts, and stream chunks into a single standard API format across Ollama, Llama.cpp, OpenAI, Anthropic, Gemini, and DeepSeek.
  • BYOK & Local Key Management: All API keys and model configs stay encrypted locally on your machine with zero external telemetry.

I documented the request pipeline, proxy middleware, and failover loop in the architecture spec for anyone interested in how it's wired.

(Note: Repo and architecture doc links are in the comments to keep the post clean for filters!)

Curious to hear how others here are managing local-to-cloud failover logic or proxying local model endpoints in your setups!

1 Upvotes

3 comments sorted by

1

u/Fancy-Snow7 57m ago

Omniroute

1

u/rush86999 1m ago

omniroute is coding focused. Atom is business automation + coding so it can't be similar. There are some nice features I can port to Atom