LiteLLM

LiteLLM Provider

For developers using LiteLLM's universal abstraction, MultiRoute's smart LLM/AI router is available via a simple wrapper around the completion and acompletion functions.

Installation

pip install multiroute["litellm"]

Basic Usage

import os
import multiroute.litellm as mrl

# Set your keys
os.environ["MULTIROUTE_API_KEY"] = "your-multiroute-key"

response = mrl.completion(
    model="gpt-4o",
    messages=[{"role": "user", "content": "Hi!"}]
)

print(response.choices[0].message.content)

The smart LLM/AI router works transparently with the LiteLLM interface; on router errors it falls back to direct provider access.