LiteLLM
Integration with LiteLLM's OpenAI-Compatible Endpoints with Infron AI
Account & API Keys Setup
The first step to start using Infron is to create an account and get your API key.
The second step to start using Google AI Studio is create a project and get your API Key.
Usage - completion
import litellm
import os
response = litellm.completion(
model="openai/<<Model Name>>", # add `openai/` prefix to model so litellm knows to route to OpenAI
api_key="<<API key>>", # api key to your openai compatible endpoint
api_base="https://llm.onerouter.pro/v1", # set API Base of your Custom OpenAI Endpoint
messages=[
{
"role": "user",
"content": "Hey, how's it going?",
}
],
)
print(response.json())Please copy the <<Model name>> at model marketplace.

For example:
Usage - embedding
Usage with LiteLLM Proxy Server
Modify the
config.yaml
Start the proxy

Send Request to LiteLLM Proxy Server
An response example is like below:
Last updated