Skip to content

cloud_router

diapason.server.cloud_router

Direct cloud API router — bypasses the engine system entirely.

Reads API keys from the process environment, with a legacy ~/.diapason/cloud-keys.env fallback for non-desktop/manual setups. Uses httpx directly so no cloud SDK packages are required.

get_provider(model)

Return the provider for a model name, or None if it's a local model.

is_cloud_model(model)

Return True if the model is served by a cloud provider.

list_local_models() async

Return Ollama model names directly from the Ollama API.

stream_cloud(model, messages, temperature=0.7, max_tokens=1024) async

Stream tokens from a cloud provider for the given model.

Raises :class:LocalOnlyError under [privacy] local_only.

stream_local(model, messages, temperature=0.7, max_tokens=1024) async

Stream tokens directly from Ollama, bypassing the engine system.