Configuration and Secrets

Separate routing from code

Do not hard-code deployment choices into the program. Read model names, base URLs (the starting web address for a provider), timeouts, and API keys from environment variables or a protected configuration file. Check them when the application starts and print only safe details such as provider and model.

Local Ollama needs no secret because it only listens inside the lab. A provider hosted on the internet normally needs an API key. Never put a real key in shell history, process arguments, source control, MLflow parameters, or debug logs.

Scenario: A developer enables an automatic hosted fallback for convenience. During a local outage, private prompts silently leave the machine. Explicit routing rules prevent that surprise.
Warning: A unified client can accidentally route private data to a hosted fallback. Make fallback policy explicit and disabled by default for sensitive workflows.