Skip to main content

Code

cookbook/11_models/ollama/ollama_cloud.py

Usage

1

Set up your virtual environment

2

Set up Ollama Cloud API Key

Sign up at ollama.com and get your API key, then export it:
3

Install dependencies

4

Run Agent

Key Features

  • No local setup required: Access powerful models instantly without downloading or managing local installations
  • Production-ready: Enterprise-grade infrastructure with reliable uptime and performance
  • Wide model selection: Access to powerful models including GPT-OSS and other optimized cloud models
  • Automatic configuration: When api_key is provided, the host automatically defaults to https://ollama.com