Ollama Cloud
Run an Agno agent against Ollama Cloud's hosted gpt-oss:120b model and stream the response.
Code
from agno.agent import Agent
from agno.models.ollama import Ollama
agent = Agent(
model=Ollama(id="gpt-oss:120b"),
)
agent.print_response("What is the capital of France?", stream=True)Usage
Set up your virtual environment
uv venv --python 3.12
source .venv/bin/activateSet up Ollama Cloud API Key
Sign up at ollama.com and get your API key, then export it:
export OLLAMA_API_KEY=your_api_key_hereInstall dependencies
uv pip install -U ollama agnoRun Agent
Save the code above as ollama_cloud.py, then run:
python ollama_cloud.pyKey Features
- No local setup required: Models run on Ollama's hosted infrastructure.
- Automatic configuration: When
api_keyis set, the host defaults tohttps://ollama.com. - Model selection: See available cloud models in the Ollama library.