Copy
Ask AI
"""To use Ollama Cloud, you need to set the OLLAMA_API_KEY environment variable. Host is set to https://ollama.com by default."""
from agno.agent import Agent
from agno.models.ollama import Ollama
# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
agent = Agent(
model=Ollama(id="gpt-oss:120b-cloud"),
)
agent.print_response("What is the capital of France?", stream=True)
# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
pass
Run the Example
Copy
Ask AI
# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/90_models/ollama/chat
# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate
python ollama_cloud.py