LiteLLM provides a unified interface for 100+ LLM providers. Since Aethon is OpenAI-compatible, you can route requests through LiteLLM using the openai/ prefix with a custom API base.
pip install litellmimport litellm
response = litellm.completion(
model="openai/llama3.1:8b",
api_base="https://api.aethon.ai/v1",
api_key="your-aethon-key",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)import litellm
response = litellm.completion(
model="openai/llama3.1:8b",
api_base="https://api.aethon.ai/v1",
api_key="your-aethon-key",
messages=[{"role": "user", "content": "Write a poem about GPUs"}],
stream=True,
)
for chunk in response:
content = chunk.choices[0].delta.content
if content:
print(content, end="", flush=True)If you're running the LiteLLM proxy server, add Aethon to your config.yaml:
model_list:
- model_name: llama-8b
litellm_params:
model: openai/llama3.1:8b
api_base: https://api.aethon.ai/v1
api_key: your-aethon-key
- model_name: mistral-7b
litellm_params:
model: openai/mistral:7b
api_base: https://api.aethon.ai/v1
api_key: your-aethon-key
- model_name: qwen-7b
litellm_params:
model: openai/qwen2.5:7b
api_base: https://api.aethon.ai/v1
api_key: your-aethon-keyThen start the proxy: litellm --config config.yaml
You can also set the API base and key as environment variables:
export OPENAI_API_BASE=https://api.aethon.ai/v1
export OPENAI_API_KEY=your-aethon-keyimport litellm
# No need to pass api_base/api_key — reads from env
response = litellm.completion(
model="openai/llama3.1:8b",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)openai/ — this tells LiteLLM to use its OpenAI-compatible provider, which works with Aethon's API. Model name goes after the prefix: openai/llama3.1:8b.