Skip to main content

LiteLLM

LiteLLM is an open-source LLM gateway that provides a unified API to 100+ model providers. Route gensparx through LiteLLM to get centralized cost tracking, logging, and the flexibility to switch backends without changing your gensparx config.

Why use LiteLLM with Gensparx?

  • Cost tracking — See exactly what gensparx spends across all models
  • Model routing — Switch between Claude, GPT-4, Gemini, Bedrock without config changes
  • Virtual keys — Create keys with spend limits for Gensparx
  • Logging — Full request/response logs for debugging
  • Fallbacks — Automatic failover if your primary provider is down

Quick start

Via onboarding

Manual setup

  1. Start LiteLLM Proxy:
  1. Point gensparx to LiteLLM:
That’s it. gensparx now routes through LiteLLM.

Configuration

Environment variables

Config file

Virtual keys

Create a dedicated key for gensparx with spend limits:
Use the generated key as LITELLM_API_KEY.

Model routing

LiteLLM can route model requests to different backends. Configure in your LiteLLM config.yaml:
gensparx keeps requesting claude-opus-4-6 — LiteLLM handles the routing.

Viewing usage

Check LiteLLM’s dashboard or API:

Notes

  • LiteLLM runs on http://localhost:4000 by default
  • gensparx connects via the OpenAI-compatible /v1/chat/completions endpoint
  • All gensparx features work through LiteLLM — no limitations

See also