llm-router/docs

Integration Examples with LLM Router#

This directory contains example boilerplates that demonstrate how easy it is to integrate popular LLM libraries with the router by simply switching the host.


Available Examples#

Core Principle#

All examples work on the same principle: just change base_url / api_base to the address of your router, and the router will automatically:

  1. ✅ Distribute traffic among available providers
  2. ✅ Perform load balancing
  3. ✅ Provide health checking
  4. ✅ Supply monitoring and metrics
  5. ✅ Handle streaming and non‑streaming responses

Quick Start#

Each example can be run directly:

```shell script

LlamaIndex#

python examples/llamaindex_example.py

LangChain#

python examples/langchain_example.py

OpenAI SDK#

python examples/openai_example.py

LiteLLM#

python examples/litellm_example.py

Haystack#

python examples/haystack_example.py ```


Example Structure#

Each example includes:

  1. Basic configuration – how to point the library at the router
  2. Streaming – handling streaming responses
  3. Non‑streaming – handling full responses
  4. Error handling – managing errors

Full Stack with Local Models#

The quick‑start guides for running the full stack with local models are included in the repository:

  • Gemma 3 12B‑IT – README
  • Bielik 11B‑v2.3‑Instruct – README

These guides walk you through:

  1. Installing vLLM and the respective model.
  2. Setting up LLM‑Router with the provided models-config.json.
  3. Testing the end‑to‑end flow (router → vLLM).

Follow the linked README files for step‑by‑step instructions to launch a complete stack locally.


Additional Information#

Learn more about the router:

llm-router · docs are generated from the repository by tools/build_docs.py 0.7.0 @ 30e2d69