Skip to content

feat: LiteLLM gateway for unified local + cloud model serving#2

Merged
massimo92 merged 1 commit into
mainfrom
feat/litellm-gateway
May 19, 2026
Merged

feat: LiteLLM gateway for unified local + cloud model serving#2
massimo92 merged 1 commit into
mainfrom
feat/litellm-gateway

Conversation

@massimo92
Copy link
Copy Markdown
Owner

Summary

  • LiteLLM gateway as optional Docker container on the DGX (port 4000), unifying local vLLM models and cloud providers under one OpenAI-compatible API
  • Supported providers: vLLM (auto-wired), OpenRouter, Ollama, Zen/OpenCode, Together AI
  • New spark gateway subcommand: start|stop|status|logs|add|remove for full lifecycle and provider management post-setup
  • Setup wizard improvements: each step now shows a brief description explaining what it does and why, so first-time users understand what they're deciding

Details

During spark setup, after vLLM is configured, users are asked if they want to install the LiteLLM gateway. If yes:

  1. Pulls ghcr.io/berriai/litellm:main-latest on the DGX
  2. Interactive provider selection with API key collection
  3. Saves config to ~/.config/spark/gateway.json
  4. Generates litellm_config.yaml and starts the container

After setup, providers can be added/removed with spark gateway add openrouter / spark gateway remove openrouter. The doctor command also checks gateway health when configured.

Test plan

  • bash -n spark — syntax check passes
  • bash tests/run.sh — 6/6 tests pass
  • spark help — gateway command visible
  • spark gateway — shows usage with all subcommands
  • spark setup on real DGX — LiteLLM prompt appears, image pulls, container starts

🤖 Generated with Claude Code

Add optional LiteLLM gateway that runs as a Docker container on the DGX,
sitting in front of vLLM and cloud providers (OpenRouter, Ollama, Zen/OpenCode,
Together AI) under a single OpenAI-compatible API on port 4000.

- Setup wizard: optional step after vLLM to install and configure gateway
- `spark gateway start|stop|status|logs`: thin Docker wrapper for lifecycle
- `spark gateway add|remove`: manage providers post-setup with API keys
- Auto-wires vLLM as default backend when gateway is enabled
- Config stored in ~/.config/spark/gateway.json, generates litellm_config.yaml
- Doctor check validates gateway status when configured
- Setup descriptions: each step now shows a brief explanation of what it does
@massimo92 massimo92 merged commit 3f0ffbc into main May 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant