Skip to main content
The SDK spins up a local model server and lets you chat with it using a simple API.

Run a model

Context Managers

The context manager will automatically manage and clean up running models on your behalf.

Manual Management

It’s also possible to manually manage the models run state.
Manual lifecycle
Once the model is serving, you can call the local OpenAI-compatible endpoint yourself.

Download models

Use download() to fetch and cache models before serving. The model identifier controls where the SDK pulls from. Common prefixes include
  • HuggingFace: hf://
  • Ollama: ollama://
  • OCI (any oci image repository): oci://
  • ModelScope: modelscope://
  • File: file://

Instantiating a model

You can pass runtime overrides when creating a model session: