Lion Cipher Lab

Put an LLM gateway in front of your apps with LiteLLM: virtual keys, budgets and rate limits

Why it matters

The fastest way to leak an expensive credential is to put it in every app that wants to talk to a model. The fastest way to get a surprise bill, or to let one runaway loop starve every other team, is to give every app unlimited access. A gateway fixes both by sitting in the middle. Apps get small, revocable virtual keys. Each key carries its own limits. Every request is logged against the key that made it. LiteLLM is an open-source gateway that does this behind an OpenAI-compatible interface, so apps change one URL and one key. You will run it entirely on your laptop, with a free local model,…

What you'll learn

Steps in this lab

  1. Why put a gateway between your apps and the model
  2. Start the gateway and its database
  3. Log in to the Admin UI
  4. Put a local Ollama model behind the gateway
  5. Issue a virtual key and make a first request
  6. Add a rate limit and watch a request get refused
  7. Add a dollar budget, and meet the zero-cost trap
  8. Read the spend: per key and per request
  9. Protect the keys that protect everything
  10. Clean up

Open the full interactive lab →

Keep learning