Get Key
Enter the access code you received for your workshop session to get a LiteLLM API key.
How to use the key
The API is OpenAI-compatible. See full documentation for setup guides, spending check, etc. There are two kinds of models:
Cloud (openrouter/*): commercial models served through OpenRouter, for example:
openrouter/openai/gpt-6-luna— fast and cheap, good defaultopenrouter/google/gemini-3.8-flash— strong all-rounderopenrouter/openai/gpt-6-sol— most capable, pricyopenrouter/*— for more see documentation (above)
# 1. Install the library (in your terminal):
# pip install openai
#
# 2. Save this file as llm_demo.py (replace <your key> with your key)
#
# 3. Run it (in your terminal):
# python3 llm_demo.py
from openai import OpenAI
client = OpenAI(api_key="<your key>", base_url="https://litellm.sph-prod.ethz.ch/v1")
response = client.chat.completions.create(
model="openrouter/openai/gpt-6-luna",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)
On-prem:
sph-onprem/qwen3.8-27bsph-onprem/nemotron-3.5-lightning
These run locally on our server. Requests are not retained and stay within the ETH network — they never go to the public internet.
# 1. Install the library (in your terminal):
# pip install openai
#
# 2. Save this file as llm_demo.py (replace <your key> with your key)
#
# 3. Run it (in your terminal):
# python3 llm_demo.py
from openai import OpenAI
client = OpenAI(api_key="<your key>", base_url="https://litellm.sph-prod.ethz.ch/v1")
response = client.chat.completions.create(
model="sph-onprem/qwen3.8-27b",
messages=[{"role": "user", "content": "Hello!"}],
)
print(response.choices[0].message.content)