pi-ollama-cloud 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,24 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [Unreleased]
6
+
7
+ - Fix extension crash on pi 0.80.8+ where `AuthStorage` is no longer exported by `@earendil-works/pi-coding-agent`. Web tools now resolve the API key through the tool execution context's `modelRegistry.getApiKeyForProvider()`, preserving runtime/CLI overrides and the registered `apiKey: "$OLLAMA_API_KEY"` config. Thanks @badlogic for the cross-version analysis (#34, #35, #37).
8
+ - Restore the `OLLAMA_API_KEY` env-var fallback in `ollama_web_search` and `ollama_web_fetch`. Thanks @cawilliamson (#26).
9
+ - Add a 15s timeout to web search/fetch requests and preserve tool-cancellation by extending `fetchJsonWithTimeout` with an external `AbortSignal`.
10
+ - Always target `https://ollama.com` and warn when `OLLAMA_API_BASE` is set to a non-cloud host, instead of silently querying a local Ollama daemon. Thanks @valueforvalue (#32, #33).
11
+ - Add a `glm-5.2` thinking level map exposing `off`, `high`, and `xhigh` (`reasoning_effort: "none"`, `"high"`, `"max"`). Thanks @Thinkscape (#29).
12
+ - Add estimated per-token pricing for Ollama Cloud models so `/cost` shows comparable usage. Prices are generated from [models.dev](https://models.dev) (the same source pi uses) via `scripts/generate-pricing.ts` into `pricing.generated.ts`, not hand-typed, and regenerate with the catalog via `npm run generate-models`. Prices are pinned to the installed package version: `/ollama-cloud-refresh` updates the model list and metadata but does not re-fetch prices, so newly added models register with zero cost until the next release. Not actual subscription charges. Thanks @DxTa (#9).
13
+ - Refresh the generated model catalog from the live Ollama Cloud API. Adds `glm-5.2` (1M context, text-only) and `kimi-k2.7-code` (262K context, text + image). `deepseek-v4-pro` context window is now 524288 (was 1048576).
14
+ - Retire models deprecated per https://docs.ollama.com/cloud#deprecations: July 15, 2026 batch (`deepseek-v3.1:671b`, `deepseek-v3.2`, `devstral-2:123b`, `devstral-small-2:24b`, `ministral-3:14b`, `ministral-3:3b`, `ministral-3:8b`, `gemini-3-flash-preview`, `gemma3:12b`, `gemma3:27b`, `gemma3:4b`, `glm-4.7`, `glm-5`, `minimax-m2.1`, `qwen3-coder-next`, `qwen3-coder:480b`) and June 30 (`rnj-1:8b`). The shipped catalog goes from 30 to 18 models.
15
+ - Bump `@earendil-works/pi-coding-agent` runtime dependency to 0.80.10.
16
+
17
+ ## [0.6.0] - 2026-06-05
18
+
19
+ - Fix `apiKey` registered as a literal string instead of an environment variable reference. Changed `apiKey: "OLLAMA_API_KEY"` to `apiKey: "$OLLAMA_API_KEY"` in `registerProvider`, resolving the deprecation warning emitted by pi v0.77.0+ and making the `OLLAMA_API_KEY` env var work alongside `auth.json` (env var takes priority, falls back to `auth.json`). Thanks @mandusm (#21).
20
+ - Make `scripts/generate-models.ts` produce a stable output: sort models by `id` and each object's keys alphabetically (with `id` and `name` first), so regenerating the catalog produces minimal diffs. Thanks @shyim for the idea (#22).
21
+ - Exclude models announced for retirement (effective 2026-06-16) from the generated `GENERATED_MODELS` list: `kimi-k2-thinking`, `kimi-k2:1t`, `minimax-m2`, `glm-4.6`, `qwen3-next:80b`, `qwen3-vl:235b`, `qwen3-vl:235b-instruct`, `cogito-2.1:671b`. See https://docs.ollama.com/cloud#deprecations. `/ollama-cloud-refresh` will still register them from the live API until Ollama removes them.
22
+
5
23
  ## [0.5.0] - 2026-05-22
6
24
 
7
25
  - Update `peerDependencies` and imports to the new `@earendil-works/*` packages.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pi-ollama-cloud
2
2
 
3
- Ollama Cloud provider plugin for [Pi](https://github.com/badlogic/pi-mono) coding agent.
3
+ Ollama Cloud provider plugin for the [Pi](https://pi.dev) coding agent.
4
4
 
5
5
  Registers Ollama Cloud as a model provider with dynamically fetched models, and provides `ollama_web_search` and `ollama_web_fetch` tools that use the [Ollama Cloud web search API](https://docs.ollama.com/capabilities/web-search) - no local Ollama server required.
6
6
 
@@ -14,7 +14,7 @@ Registers Ollama Cloud as a model provider with dynamically fetched models, and
14
14
  - **`/ollama-cloud-refresh` command** - Re-fetches the model list and updates the cache and provider registration live (no restart needed).
15
15
  - **`ollama_web_search` tool** - Search the web for real-time information using Ollama Cloud's `/api/web_search` endpoint. Returns titles, URLs, and content snippets.
16
16
  - **`ollama_web_fetch` tool** - Fetch and extract text content from a web page URL using Ollama Cloud's `/api/web_fetch` endpoint. Returns page title, content, and links.
17
- - **Zero cost tracking** - All models are registered with zero costs since Ollama Cloud uses a flat subscription model (Free, Pro, Max) rather than per-token billing. Per-request costs don't apply, so Pi's cost tracker always shows zero. See [ollama.com/pricing](https://ollama.com/pricing) for plan details.
17
+ - **Estimated cost tracking** - Models are registered with estimated per-token costs sourced from [models.dev](https://models.dev) (the same catalog pi uses), so Pi's `/cost` shows comparable usage. Ollama Cloud is subscription-billed (Free, Pro, Max), so these are equivalent pay-as-you-go estimates, not actual charges. See [ollama.com/pricing](https://ollama.com/pricing) for plan details.
18
18
 
19
19
  ## Prerequisites
20
20
 
@@ -142,11 +142,11 @@ Model metadata is derived from the cached data:
142
142
  | Field | Source |
143
143
  |---|---|
144
144
  | `reasoning` | `capabilities` includes `"thinking"` |
145
- | `thinkingLevelMap` | [`thinking-levels.ts`](thinking-levels.ts) with 4 maps (DEFAULT, GPT_OSS, QWEN3, NO_OFF) based on API testing |
145
+ | `thinkingLevelMap` | [`thinking-levels.ts`](thinking-levels.ts) with 5 maps (DEFAULT, GPT_OSS, QWEN3, GLM_52, NO_OFF) based on API testing |
146
146
  | `input` | `["text", "image"]` if `capabilities` includes `"vision"`, else `["text"]` |
147
147
  | `contextWindow` | `model_info.*.context_length` (falls back to 128000) |
148
148
  | `maxTokens` | Fixed at 32768 |
149
- | `cost` | All zeros (Ollama Cloud uses subscription plans, not per-token billing - see [pricing](https://ollama.com/pricing)) |
149
+ | `cost` | Estimated per-1M-token prices from [models.dev](https://models.dev), generated by `scripts/generate-pricing.ts` into `pricing.generated.ts`. Ollama Cloud is subscription-billed, so these are equivalent pay-as-you-go estimates, not actual charges. Unmapped models default to zero. Prices are pinned to the installed package version: `/ollama-cloud-refresh` updates the model list and metadata but does not re-fetch prices, so newly added models register with zero cost until the next release. |
150
150
 
151
151
  ### Thinking level mapping
152
152
 
@@ -157,6 +157,7 @@ Pi's thinking levels are mapped to Ollama Cloud's OpenAI-compatible `reasoning_e
157
157
  | `DEFAULT` | Most thinking models | off, low, medium, high, xhigh | `minimal` hidden (duplicate of low) |
158
158
  | `GPT_OSS` | `gpt-oss*` | low, medium, high | Can't disable thinking, no off or xhigh |
159
159
  | `QWEN3` | `qwen3*` (except `qwen3-vl*`) | off, medium | Binary-only (think/nothink), no gradation |
160
+ | `GLM_52` | `glm-5.2` | off, high, xhigh | GLM supports disabled thinking; Ollama's model page confirms `high` and `max` reasoning efforts |
160
161
  | `NO_OFF` | `qwen3-vl*`, `kimi-k2-thinking`, `minimax*` | low, medium, high, xhigh | "none" doesn't disable thinking on these models |
161
162
 
162
163
  See [docs/think-experiment.md](docs/think-experiment.md) for the testing methodology and results.
@@ -182,7 +183,7 @@ Both tools use the same Ollama Cloud API key configured for the provider. No loc
182
183
 
183
184
  | Command | Description |
184
185
  |---|---|
185
- | `/ollama-cloud-refresh` | Fetch models from the Ollama Cloud API, update cache, and re-register the provider |
186
+ | `/ollama-cloud-refresh` | Fetch models from the Ollama Cloud API, update cache, and re-register the provider. Updates the model list and metadata but not estimated prices (those are pinned to the installed package version). |
186
187
  | `/ollama-webtools [on\|off\|enable\|disable]` | Enable or disable the `ollama_web_search` and `ollama_web_fetch` tools. Toggles if no argument given. |
187
188
 
188
189
  ## Development
package/index.ts CHANGED
@@ -46,7 +46,7 @@ function registerProvider(pi: ExtensionAPI, models: ProviderModelConfig[]) {
46
46
  pi.registerProvider("ollama-cloud", {
47
47
  name: "Ollama Cloud",
48
48
  baseUrl: `${OLLAMA_BASE}/v1`,
49
- apiKey: "OLLAMA_API_KEY",
49
+ apiKey: "$OLLAMA_API_KEY",
50
50
  api: "openai-completions",
51
51
  models,
52
52
  });
@@ -124,9 +124,8 @@ export default async function (pi: ExtensionAPI) {
124
124
  // When cache is missing, GENERATED_MODELS serves as the cache —
125
125
  // it is manually generated via `npm run generate-models` and committed to the repo.
126
126
  const needsStartupRefresh = cacheState.status === "stale";
127
- // GENERATED_MODELS ships with the package (36 tool-capable models from
128
- // the build script). Used when no local cache exists. A fresh user cache
129
- // from /ollama-cloud-refresh takes precedence over the generated list.
127
+ // GENERATED_MODELS ships with the package. Used when no local cache exists. A
128
+ // fresh user cache from /ollama-cloud-refresh takes precedence over the generated list.
130
129
  const models = cacheState.status === "missing" ? GENERATED_MODELS : assembleModels(cacheState.models);
131
130
 
132
131
  registerProvider(pi, models);