Proxy Server Integration
LiteLLM can also be used as an OpenAI-compatible proxy server, allowing you to route requests to different models through a unified API.Starting the Proxy Server
First, install LiteLLM with proxy support:Using the Proxy
TheLiteLLMOpenAI class connects to the LiteLLM proxy using an OpenAI-compatible interface:
Configuration Options
TheLiteLLMOpenAI class accepts the following parameters:
LiteLLMOpenAI is a subclass of the OpenAILike class and has access to the same params.
Examples
Check out these examples in the cookbook:Proxy Examples
View more examples here.