cloud_router
cloud_router
¶
Direct cloud API router — bypasses the engine system entirely.
Reads API keys from ~/.openjarvis/cloud-keys.env at request time so it works even when the server was started without cloud keys in its environment. 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/openjarvis/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/openjarvis/server/cloud_router.py
list_local_models
async
¶
Return Ollama model names directly from the Ollama API.
Source code in src/openjarvis/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.