Connect LiteLLM
Route LiteLLM SDK or proxy requests to the service using its OpenAI-compatible adapter.
https://aelder.dev/v1LOCAL CONFIGURATION
Let my agent set this up
Copy this task to an agent already running on your computer. Enter your API key locally when asked.
Help me connect LiteLLM to AELDER using this guide: https://aelder.dev/docs/litellm/
Service Base URL: https://aelder.dev/v1
First inspect my installed version, active profile and configuration. Explain any mismatch with the guide before changing anything.
Use the documented local configuration or CLI method. Do not automate the GUI, install software or change permissions without asking.
Preserve existing accounts, providers, models, defaults, permissions and unrelated settings. Propose the smallest change, show a redacted diff, and back up any files before editing.
Have me enter my API key locally using the tool's secret storage or an environment variable. Never ask me to paste a key into chat, print it, or include it in a command, diff, log or commit.
Use the exact model ID I choose from my account's model list. Do not invent model IDs or assume every model supports every API format or tool feature.
Validate syntax and configuration loading before making any generation request. If there is no dry-run, say so.
Explain any proposed paid test, the model and what it sends, and ask for approval before running it. Do not send project files or private conversation history as a test.
Finish with the settings changed, checks performed and steps to restore the backup.Use an existing LiteLLM environment. Its openai/ adapter can send OpenAI-compatible Chat Completions requests to the service Base URL above.
1. Set private connection values
In your application’s environment or deployment secret settings, define:
| Variable | Value |
|---|---|
SERVICE_BASE_URL |
The service Base URL above, including /v1 |
SERVICE_API_KEY |
Your service API key |
SERVICE_MODEL |
An exact ID from the authenticated models endpoint |
Enter the key through a private secret field or local secret file excluded from version control. Keep it out of commands, chat messages and source files. Do not append /chat/completions to the Base URL.
2. Use the Python SDK
Merge these connection arguments into your existing LiteLLM call, or save this as a separate check script:
import os
from litellm import completion
response = completion(
model="openai/" + os.environ["SERVICE_MODEL"],
api_base=os.environ["SERVICE_BASE_URL"],
api_key=os.environ["SERVICE_API_KEY"],
messages=[{"role": "user", "content": "Reply with OK."}],
)
print(response.choices[0].message.content)The added openai/ is LiteLLM’s adapter prefix. Everything after it must remain the exact service model ID, including any slash in that ID. It selects the protocol, rather than restricting the connection to OpenAI-branded models.
Running the script sends a paid model request. Check the response and your service dashboard. Configuration and environment changes alone do not prove connectivity.
3. Or add a proxy route
For an existing LiteLLM proxy, append a route to its configuration’s model_list:
model_list:
- model_name: service-chat
litellm_params:
model: openai/YOUR_MODEL_ID
api_base: os.environ/SERVICE_BASE_URL
api_key: os.environ/SERVICE_API_KEYReplace YOUR_MODEL_ID with the exact service ID. Preserve other routes, proxy authentication, budgets and permissions. Restart your existing proxy deployment to load the change. Its clients select the local alias service-chat and continue using the proxy’s own URL and credentials.
A 404 commonly indicates a missing /v1. For model or parameter errors, check the service ID and model capabilities. LiteLLM’s estimates do not replace your service’s billed usage; this recipe does not configure media endpoints or guarantee every agent feature.
See the official OpenAI-compatible endpoint guide and proxy quick start.
Need the key? Open your AELDER dashboard. For direct API calls, see the API reference.

