cloud_router
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.
Classes¶
Functions:¶
get_provider
¶
Return the provider for a model name, or None if it's a local model.
Source code in src/diapason/server/cloud_router.py
is_cloud_model
¶
stream_local
async
¶
stream_local(
model: str,
messages: Sequence[Message],
temperature: float = 0.7,
max_tokens: int = 1024,
) -> AsyncIterator[str]
Stream tokens directly from Ollama, bypassing the engine system.
Source code in src/diapason/server/cloud_router.py
list_local_models
async
¶
Return Ollama model names directly from the Ollama API.
Source code in src/diapason/server/cloud_router.py
stream_cloud
async
¶
stream_cloud(
model: str,
messages: Sequence[Message],
temperature: float = 0.7,
max_tokens: int = 1024,
) -> AsyncIterator[str]
Stream tokens from a cloud provider for the given model.
Raises :class:LocalOnlyError under [privacy] local_only.