← Catalog

pi-ollama-api

Ollama Cloud provider extension for Pi — connect to Ollama Cloud models via the OpenAI-compatible API

Extension

Install

Install with PiG

pig install npm:pi-ollama-api

Install with Pi

pi install npm:pi-ollama-api
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 1.3.0 (README.md). PiG does not review it.

pi-ollama-api

Ollama Cloud provider extension for Pi — connect your terminal coding agent to 200+ models on Ollama Cloud via the OpenAI-compatible API.

Features

  • Native Ollama API discovery — Queries /api/tags and /api/show for real model metadata (context windows, capabilities, parameter sizes, quantization)
  • Actual context windows — No hardcoded defaults. Every model reports its real context length from Ollama's API (e.g., 1M for DeepSeek V4, 262K for Kimi K2, 128K for GPT-OSS)
  • Capability detection — Vision, reasoning, tools detected from Ollama's capabilities array
  • OpenAI-compatible API — Uses openai-completions streaming (works with all Pi features)
  • Embeddings tool — Generate embeddings via /v1/embeddings for RAG and similarity search
  • Direct chat tool — Send one-off completions for model comparison or testing

Supported Model Families

FamilyModelsHighlights
Llama3.3, 3.2, 3.1, 3, 270B frontier, Vision variants, 405B
Qwen3, 2.5, 2, VL, Coder, Math128K context, Vision, Code, Math variants
DeepSeekR1, V3, V2, Coder V2Reasoning (R1), 671B total
MistralCodestral, Mistral, Nemo, Large, Mixtral256K context Codestral
Gemma3, 2, CodeGemma, ShieldGemmaVision support, 128K context
Phi4, 3.5, 3Microsoft models, 128K context
IBMGranite 3.x, Granite CodeMoE variants, 128K context
CohereCommand R, Aya, Aya ExpanseMultilingual, 128K context
GPT-OSS120B, 20B (Cloud)Cloud-hosted OSS models
+ 30+ moreYi, Falcon, GLM, InternLM, SOLAR, etc.See full list in source

Installation

# Install via pi
pi install npm:pi-ollama-api

# Or install locally
pi install npm:pi-ollama-api -l

Setup

  1. Get an API key from ollama.com/settings
  2. Start Pi and run:
    /ollama-cloud-login
    
    Paste your API key when prompted. It is stored in Pi's ~/.pi/agent/auth.json (same place as /login credentials).
  3. Select a model with /model → pick any ollama-cloud/* model

Authentication

MethodHowWhere stored
Pi /login (recommended)Run /login in Pi → select "Use an API key"~/.pi/agent/auth.json
Environment variableexport OLLAMA_API_KEY=...Shell env

Pi's AuthStorage is used natively — API keys are checked in auth.json first, then the env var is used as a fallback.

Environment Variables

VariableDefaultDescription
OLLAMA_API_KEY—Fallback API key (used if auth.json has no key)
OLLAMA_CLOUD_BASE_URLhttps://ollama.com/v1Override endpoint (for proxies or self-hosted)
OLLAMA_CLOUD_MODELS—Comma-separated list to skip discovery and use static models
OLLAMA_CLOUD_TIMEOUT30000Model discovery timeout in ms

Usage

Select a model

/model

Then pick any ollama-cloud/* model. Examples:

  • ollama-cloud/llama3.3 — Llama 3.3 70B
  • ollama-cloud/qwen3 — Qwen 3 with vision
  • ollama-cloud/deepseek-r1 — DeepSeek R1 with reasoning
  • ollama-cloud/gemma3:27b — Gemma 3 27B with vision

Commands

CommandDescription
/ollama-cloud-statusCheck API key status and model count
/ollama-cloud-refreshRe-fetch live model list from Ollama Cloud API
/ollama-cloud-listPretty-print all models with 🧠/🖼️/💬 badges
/ollama-cloud-pull <id>Show the ollama pull command for a model

Tools (LLM-callable)

ToolPurpose
ollama_list_modelsFilter models by family, vision, or reasoning
ollama_embeddingsGenerate embeddings via /v1/embeddings
ollama_chatDirect chat completion via /v1/chat/completions
ollama_model_infoGet detailed metadata for a specific model

Quick Examples

# Check what models are available
Use ollama_list_models to show all available models

# Get embeddings for a document
Use ollama_embeddings with model "nomic-embed-text" and input "The quick brown fox"

# Compare model outputs
Use ollama_chat with model "llama3.3" and messages [{role: "user", content: "Hello"}]
Use ollama_chat with model "qwen3" and messages [{role: "user", content: "Hello"}]

API Compatibility

This extension uses Ollama's OpenAI-compatible API (/v1/chat/completions), which supports:

  • Chat completions with streaming
  • Vision (multimodal) inputs
  • Tool calling
  • JSON mode
  • Reasoning/thinking control
  • Embeddings (/v1/embeddings)

License

MIT