@nemesis-oss/ollama-sdk 1.17.0 → 1.19.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 +58 -0
- package/README.md +79 -0
- package/dist/{anthropic-AKbXnWJU.d.cts → anthropic-CAvwqIjx.d.ts} +5 -5
- package/dist/{anthropic-CTv2acbj.d.ts → anthropic-DIPnBwlf.d.cts} +5 -5
- package/dist/{compose-CeFbHJeO.d.ts → compose-75UFDzOO.d.ts} +1 -1
- package/dist/{compose-DFkmtUOP.d.cts → compose-C4QxEZOS.d.cts} +1 -1
- package/dist/generated-api.cjs +5 -3
- package/dist/generated-api.cjs.map +1 -1
- package/dist/generated-api.d.cts +9 -9
- package/dist/generated-api.d.ts +9 -9
- package/dist/generated-api.js +5 -3
- package/dist/generated-api.js.map +1 -1
- package/dist/generated-models-schemas.cjs +2 -2
- package/dist/generated-models-schemas.cjs.map +1 -1
- package/dist/generated-models-schemas.js +2 -2
- package/dist/generated-models-schemas.js.map +1 -1
- package/dist/generated-runtime.cjs +24 -6
- package/dist/generated-runtime.cjs.map +1 -1
- package/dist/generated-runtime.d.cts +2 -2
- package/dist/generated-runtime.d.ts +2 -2
- package/dist/generated-runtime.js +24 -6
- package/dist/generated-runtime.js.map +1 -1
- package/dist/index.cjs +132 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +294 -40
- package/dist/index.d.ts +294 -40
- package/dist/index.js +128 -21
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools.json +8 -10
- package/dist/mcp-generated.cjs +5 -3
- package/dist/mcp-generated.cjs.map +1 -1
- package/dist/mcp-generated.d.cts +2 -2
- package/dist/mcp-generated.d.ts +2 -2
- package/dist/mcp-generated.js +5 -3
- package/dist/mcp-generated.js.map +1 -1
- package/dist/{runtime-CdZP-N7j.d.cts → runtime-C28YEAHC.d.cts} +28 -5
- package/dist/{runtime-CFuv7Ifh.d.ts → runtime-DYCxYGG-.d.ts} +28 -5
- package/dist/skills.cjs.map +1 -1
- package/dist/skills.d.cts +3 -3
- package/dist/skills.d.ts +3 -3
- package/dist/skills.js.map +1 -1
- package/dist/{types-DbPnfVh-.d.cts → types-Y3u0FtdN.d.cts} +10 -0
- package/dist/{types-DbPnfVh-.d.ts → types-Y3u0FtdN.d.ts} +10 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,63 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [1.19.0] — System One cloud launch contract refresh: dual request-size cap, 402 taxonomy, re-pin d9b8601
|
|
4
|
+
|
|
5
|
+
The scheduled upstream snapshot freshness check (offered after the Task 24 docs fix, accepted) found upstream `openapi.yaml@main` had moved from `2a9ffe3` to `d9b8601` with the **System One cloud launch** — audited point-by-point against the pinned snapshot before any change, per house discipline (see [ADR 0034](./docs/adr/0034-systemone-cloud-launch-contract-refresh.md)). Upstream now declares `/v1/systemone` with local **and cloud** servers (`https://ollama.com`, optional `bearerAuth`), the `model` field accepts cloud models (`clef:cloud`, requiring Ollama >= 0.40.5 or the hosted endpoint), the local byte caps were **clarified from an either/or reading to a dual bound**, and 401/402 joined the documented response set. A second discovery retired an old deviation: the "corrupted Usage enum literals" the 2026-10-07 pin repaired were our own Bash display artifact eating `[24h`/`[h` CSI-style sequences — upstream serves them clean inline, so the repair deviation is retired. All changes additive or contract-aligning; no breaking API changes. 1047 pre-existing tests stay green, 10 net-new tests added (5 rewritten onto the new semantics).
|
|
6
|
+
|
|
7
|
+
### System One in Ollama's cloud (environment guard flip)
|
|
8
|
+
|
|
9
|
+
- The systemone overlay's `environment.cloud` flipped to `supported`, flowing through the IR to the generated operations metadata and the MCP tool description. A client pointed at a cloud host no longer gets `unsupported_capability` from `client.systemOne()` — the request rides the client's configured host, exactly like every other native operation. A local-mode client can equally send `clef:cloud` through the local server (which fronts cloud models and answers 401 with a `signin_url` in the body when not signed in). No special cloud routing was introduced.
|
|
10
|
+
- The `unsupported_capability` environment guard itself stays, still firing for genuinely local-only operations (model management: pull, push, copy, create, delete, blobs) — test coverage moved onto `pull`.
|
|
11
|
+
- Declined with reasoning in ADR 0034: client-side enforcement of the cloud limits (13 MiB request cap, 64-question/100-char naming, 4-image budgets, 65,536-token context). The runtime cannot reliably classify a request as "cloud" without inventing a `:cloud`-suffix heuristic the contract doesn't specify; the server enforces these limits and the SDK surfaces the typed failures instead.
|
|
12
|
+
|
|
13
|
+
### Dual request-size cap (upstream clarification, behavior tightening)
|
|
14
|
+
|
|
15
|
+
- The runtime's request-size guard now checks **both bounds on every request**: the text-and-schema portion (images excluded, via the new `serializeWithoutImages()`) against `maxRequestBytes` (64 KiB), and the whole serialized request against `maxRequestBytesWithImages` (32 MiB). Previously the presence of images selected the higher cap alone, letting a multi-MiB text+schema payload through the client guard into a guaranteed server 413 ("text and schema must not exceed 64 KiB" — the upstream example message). The only behavior change: image-bearing requests whose non-image portion exceeds 64 KiB now fail client-side, without the round-trip.
|
|
16
|
+
- `estimateSystemOneRequestBytes(request, { excludeImages: true })` — new option mirroring the runtime guard, so pre-flight checks can measure the text-and-schema half of the dual cap. `MAX_SYSTEM_ONE_IMAGES_BYTES`/`MAX_SYSTEM_ONE_REQUEST_BYTES` JSDoc rewritten to the dual-cap semantics (whole-request cap / text-and-schema cap).
|
|
17
|
+
- Cloud 413 semantics documented: cloud requests exceeding 13 MiB or the model's context window are a server-side 413 (local rendered-prompt context overflow remains a 400).
|
|
18
|
+
|
|
19
|
+
### `OllamaPaymentRequiredError` (HTTP 402)
|
|
20
|
+
|
|
21
|
+
- New root-exported error class — `code: 'payment_required'`, `retryable: false`, `status: 402` — mapped in `statusToError` per the one-typed-error-per-documented-status pattern (502/503 precedent). 402 is billing, not credentials: the cloud model isn't in the Free plan, usage credits are needed, or a payment failed. Deliberately distinct from `OllamaAuthError` (401/403) so callers branch to an upgrade/add-credits flow instead of re-prompting for an API key. Previously 402 fell through to `OllamaGenericClientError`.
|
|
22
|
+
|
|
23
|
+
### Contract refresh mechanics
|
|
24
|
+
|
|
25
|
+
- Pinned snapshot re-pinned at upstream `d9b8601` (content hash `b03e073683d54515`); the 2026-10-07 enum-repair deviation retired (upstream fixed the literals inline — the historical "corruption" was a display artifact); the `ModelSummary.details.families` `[array, null]` deviation re-applied and re-documented. IR regenerated: `model` and `questions` schema descriptions now carry the cloud wording; `systemOne` notes carry the dual cap, cloud limits, and 401/402 semantics.
|
|
26
|
+
- Docs synced everywhere the old claims lived: `docs-site/guide/system-one.md` (warning box + error table), `api/decision.md`, `api/client.md`, `api/native-api.md`, `api/errors.md` (new class section + quick-reference row), `README.md`, and the `client.ts`/`system-one.ts`/`errors.ts` JSDoc. Every "Local-only / Ollama Cloud rejects /v1/systemone" statement and every "64 KiB without images, 32 MiB with" either/or cap wording is gone.
|
|
27
|
+
|
|
28
|
+
## [1.18.0] — Pull/push progress with speed & ETA, decision confidence gates, abort-safety pin, System One score 26→10 refresh
|
|
29
|
+
|
|
30
|
+
The October 15 digest ("Structured Output Type Inference, Stream Cancellation Memory Barriers, Model Pull/Push Progress Multiplexing") plus its morning upstream-specs companion (System One confidence calibration, a claimed zero-truncation 413 rule) were audited against the codebase before any implementation (see [ADR 0033](./docs/adr/0033-progress-speed-decision-gates-abort-pin-systemone-refresh.md)). Verdicts: the structured-output claim was stale (`chatWithSchema`/`generateWithSchema` already ship full Zod inference + validation + markdown-JSON extraction — the proposed `structured?: T` field injection was declined as both weaker and contract-breaking); the stream-abort claim was stale as a defect (every teardown seam is guarded — most load-bearingly, `holdUntil` attaches a catch handler to every client stream's `finalResult` before the stream is returned) but the invariant is now pinned by real-wire tests; and the pull/push claim was half right — `onProgress()` with a pre-computed `percent` existed internally with 13 tests but was **not exported from the root entry**, and transfer speed didn't exist at all. The morning digest's 413/2-token scoring-head specification appears nowhere upstream (the real `/v1/systemone` 413 is the request-byte cap the SDK has enforced client-side since the System One waves); its one honest catch — taken from its own "OpenAPI Parity Inspection" focus item — is real: upstream tightened System One score criteria from 2–26 to 2–10 levels. All additive, no breaking changes. 1024 pre-existing tests stay green, 23 new tests added.
|
|
31
|
+
|
|
32
|
+
### Model pull & push progress, with speed and ETA (OPR-01)
|
|
33
|
+
|
|
34
|
+
- **`onProgress(stream, callback)` is now root-exported** — it was fully implemented (typed `PullProgressEvent` with a clamped two-decimal `percent`, `computeProgressPercent()`, `toPullProgressEvent()`, 13 tests) but absent from `src/index.ts`, so npm consumers couldn't import any of it. All four functions and the three types are public now.
|
|
35
|
+
- **`createProgressSpeedTracker()`** — the stateful per-layer byte counter the digest correctly said consumers were forced to hand-roll: feed it every raw progress chunk and it returns `bytesPerSecond` + `etaSeconds` for that chunk's layer. Semantics chosen for stable progress bars: a **cumulative average** since the layer's first byte-bearing frame (instantaneous frame-to-frame rates jitter wildly), **per-layer epochs** (the tracker resets whenever `digest` changes or `completed` regresses, so a multi-layer pull never averages across layers — the classic hand-rolled-counter bug), `performance.now()` monotonic timing, and guards for zero-elapsed, zero-transfer, and missing-total frames (ETA `undefined`, never `NaN` or fake `0`).
|
|
36
|
+
- `onProgress` wires the tracker in: every callback event now carries `bytesPerSecond`/`etaSeconds` alongside `percent` once two byte-bearing frames of a layer have arrived. The pure wrapper (`toPullProgressEvent`) never measures time — deterministic tests mock `performance.now()` with an exact manually-advanced clock.
|
|
37
|
+
- Declined: a `client.pullWithProgress()` method or progress-multiplexer object — the typed dual-mode stream already _is_ the multiplexed channel; a callback helper composes over it without forking the request path (ADR 0033).
|
|
38
|
+
|
|
39
|
+
### System One decision confidence gates (morning-digest kernel)
|
|
40
|
+
|
|
41
|
+
- The six `client.decision` helpers now take **opt-in** calibration gates for autonomous flows — the digest's real concern (an agent acting on a 0.51 coin-flip `true` it never inspected):
|
|
42
|
+
- `choice()` / `score()` / `route()` / `rank()` accept `minConfidence` (inclusive lower bound in (0, 1]; `RangeError` otherwise, validated **before** any request is sent) and flag results with `isConfident: confidence >= minConfidence`. The value is still returned — the caller decides whether to act.
|
|
43
|
+
- `noul()` / `verify()` accept `minProbability`, which raises the bar their derived boolean must clear (default 0.5 unchanged). Noul answers carry no separate confidence field, so the threshold _is_ the boolean bar — a redundant `isConfident` would always equal `bool`.
|
|
44
|
+
- Without the options, every result shape and default behavior is byte-identical — gates are purely additive, and `isConfident` is present only when configured.
|
|
45
|
+
- Declined with reasoning in ADR 0033: the `SystemOneDecisionHelper.evaluateDecisions` wrapper class (zero config around one map iteration) and the `ContextBudgetGuard` token estimator (a pre-flight guard against a spec that doesn't exist — the claimed HTTP-413-on-context-overflow and two-token scoring-head reservation appear in neither the official decision docs nor the OpenAPI; inventing an estimation formula for undocumented server behavior manufactures false confidence).
|
|
46
|
+
|
|
47
|
+
### Stream abort safety (STR-03 — stale defect, invariant pinned)
|
|
48
|
+
|
|
49
|
+
- The digest's claimed unhandled-rejection race is guarded at every seam: `requestStream` wires the caller signal to an `AbortController` with listener cleanup in the generator's `finally`; `parseNdjsonStream` runs under `await using disposableReader` (cancel rejections swallowed, lock released); `OllamaStream.abort()` cancels the source before rejecting `finalResult`; and `executeWithFailover` attaches `void holdUntil(stream).catch(() => undefined)` to every client-produced stream's `finalResult` **synchronously, before the stream is returned** — the internally-held promise can never surface as a process-level `unhandledRejection`. The digest's `guardedStreamReader` sketch re-implements this stack with weaker structure.
|
|
50
|
+
- The invariant is now pinned (BUF-01 precedent): `test/stream-abort-mid-read.test.ts` aborts a real wire stream with the next frame genuinely in flight (public mock server, 50 ms chunk delays) in both iterator and events mode — asserting the mapped `OllamaAbortError` is delivered to the consumer, zero process-level `unhandledRejection` events fire after the rejection chains settle, the endpoint slot releases (`activeRequests` back to 0 under `maxConcurrentPerEndpoint: 1`), and a follow-up request on that single-slot client completes immediately.
|
|
51
|
+
|
|
52
|
+
### System One contract refresh (score criteria 2–26 → 2–10)
|
|
53
|
+
|
|
54
|
+
- Upstream's `docs/openapi.yaml` now natively carries the System One schemas (the SDK pin previously hand-assembled them from the rendered docs) and tightens **score criteria to `maxItems: 10`** (answer scale `maximum: 9`), drops the noul criteria's hardcoded `'Yes'`/`'No'` defaults ("omitted entries use model-specific defaults"), and simplifies the model/images descriptions. The pin was hand-refreshed in its cleaned style (running `contract:fetch` verbatim would clobber its documented intentional deviations) and the contract regenerated: IR, `SystemOneScoreQuestion`/`SystemOneScoreAnswer` models + Zod schemas (`score: z.number().min(0).max(9)`), and MCP tool descriptors. Boundary tests updated (11-criteria requests now rejected client-side before the round-trip; 10-criteria accepted at the new boundary) with the upstream change date recorded.
|
|
55
|
+
- `decision.ts`'s score JSDoc and the README examples now say 2–10.
|
|
56
|
+
|
|
57
|
+
### Structured outputs (TYP-04 — stale, documented)
|
|
58
|
+
|
|
59
|
+
- `chatWithSchema<T>(req, zodSchema)` / `generateWithSchema<T>(req, zodSchema)` already deliver exactly what the digest asked for — inferred `T` returns, runtime validation (`OllamaToolValidationError` with Zod issues when the model's JSON drifts from the schema), and resilient extraction from markdown-fenced output — all root-exported and README-documented since the Zod waves. The digest's redesign (a `structured?: T` field on the response message, populated by a blind `JSON.parse(...) as T`) was declined: no runtime validation is precisely the unsafety the finding complains about, and injecting SDK-computed fields into wire-contract response types breaks the contract-parity discipline (ADR 0033).
|
|
60
|
+
|
|
3
61
|
## [1.17.0] — Streaming blob uploads (`duplex:'half'`, two-pass file upload), typed-array view-safety pins, tracing-header verdicts
|
|
4
62
|
|
|
5
63
|
The October 14 digest ("Raw Model Blob Ingestion Streaming Backpressure, W3C Distributed Tracing Baggage Injection, Defensive Serialization for Typed Arrays") targeted heavy binary asset streaming, operational provenance, and low-level buffer safety. Audited against the codebase first (see [ADR 0032](./docs/adr/0032-streaming-blob-uploads-tracing-verdicts-view-safety.md)): the heap-exhaustion claim was real on the blob path — `createBlobFromFile` bulk-read the whole file (`fs.readFile`) before uploading, and the `ReadableStream` member of `BinaryBody` was a promise the transport couldn't keep (Node 18+ `fetch` rejects stream bodies without `duplex: 'half'`) — though the `/api/create` framing was misdirected (its request body is a small JSON digest map, not a stream). The tracing claim was stale (client-level `headers`, per-request headers, and the middleware seam already forward any W3C headers verbatim — nothing is stripped). The typed-array claim was stale as a defect (`src/` has zero `Buffer.from` call sites; the SDK's Web APIs are view-safe by construction, and adopting the proposed `Buffer`-coupled helpers would regress the edge-runtime zero-Node-builtins gate) — but the invariant is now pinned by tests. The companion upstream-specs digest (System One batching, payload caps, `expires_at`, model warmth) was comprehensively stale — every recommendation already ships. All additive, no breaking changes. 1012 pre-existing tests stay green, 12 new tests added.
|
package/README.md
CHANGED
|
@@ -24,10 +24,12 @@ Nexum’s model harness (2026-10-09) exercised this SDK via `gemma4:cloud` and `
|
|
|
24
24
|
- 🧠 **Reasoning & Thinking Tokens**: First-class support for reasoning models (`qwen3:8b`, `deepseek-r1:8b`) via the native `think` parameter, with discrete `thinking` and `token` streaming events, plus `logprobs`/`top_logprobs` for token-level confidence scoring.
|
|
25
25
|
- 🖼️ **Multimodal / Vision Input**: `images` on `Message`/`generate()` is a universal resolver — pass raw base64 strings, `data:image/...;base64,` data URIs, `http(s)://` URLs (fetched), local file paths (`.png`/`.jpg`/`.webp`/…, read via `node:fs` on Node), or raw `Buffer`/`Uint8Array` bytes — everything is normalized to the raw base64 Ollama's REST API expects, matching the official SDK vision convention.
|
|
26
26
|
- 🎯 **Zod-Powered Structured Outputs**: Strictly typed schema enforcement via `chatWithSchema` and `generateWithSchema` with resilient markdown JSON parsing.
|
|
27
|
+
- ⚖️ **System One Decision Helpers**: `client.decision` wraps Ollama's `/v1/systemone` classification engine with six ergonomic single-question APIs — `choice` / `noul` (yes-no) / `score` / `route` / `verify` / `rank` — each returning calibrated probabilities, and **opt-in confidence gates** (`minConfidence` / `minProbability`) so autonomous flows refuse to act on barely-majority decisions (a 0.51 coin-flip) without seeing the numbers.
|
|
27
28
|
- 🛠️ **Autonomous Agent & Tool Calling**: Multi-turn agent loop (`Agent`) with automated tool execution, parameter validation, and self-correcting error recovery.
|
|
28
29
|
- 🌐 **High Availability & Failover**: Multi-endpoint registry with priority routing, circuit breaker failover, active health checks, and per-endpoint `models` allow-lists for routing several model-specific API keys through one client.
|
|
29
30
|
- 🔌 **Model Context Protocol (MCP)**: First-class, transport-neutral `McpBridge` for converting MCP tool descriptors into Ollama function definitions and registering executable MCP-backed tools.
|
|
30
31
|
- 📚 **Full Model Lifecycle**: `pullModel`, `pushModel`, `createModel`, `copyModel`, `deleteModel`, `listModels`, `showModel`, and `ps()` (currently loaded models) — full parity with Ollama's model management API.
|
|
32
|
+
- 📶 **Pull & Push Progress with Speed/ETA**: `onProgress()` subscribes a typed callback to `pullModel`/`pushModel` NDJSON streams with a pre-computed `percent`, and `createProgressSpeedTracker()` adds per-layer `bytesPerSecond` + `etaSeconds` — the stateful byte counter CLIs and dashboards used to hand-roll, with layer-epoch reset semantics built in.
|
|
31
33
|
- 🔎 **Ollama Cloud Web Tools**: `webSearch`/`webFetch` wrap Ollama's hosted `/api/web_search` and `/api/web_fetch` tools at `ollama.com` (requires an `OLLAMA_API_KEY`), independent of any local `baseUrl` — and `createWebTools(client)` exposes them as model-callable `web_search`/`web_fetch` tools with bounded, valid-JSON output for the documented search-agent pattern.
|
|
32
34
|
- 💳 **Ollama Cloud Usage & Balance**: `usage()`/`balance()` wrap Ollama's hosted account endpoints (`GET /api/usage`, `GET /api/balance`) — request counts, USD spend, cached-token totals bucketed by hour/day, and remaining included/purchased credits (including the legacy session/weekly plan shapes) — with the same fixed-cloud-host, API-key, timeout, and retry semantics as the web tools.
|
|
33
35
|
- 🌉 **OpenAI & Anthropic Compatibility Bridges**: Built-in clients for `/v1/chat/completions`, `/v1/responses`, `/v1/models`, and `/v1/messages`, including `reasoning_effort`/`reasoning.effort` for thinking models — plus an ergonomic dual-mode `client.responses.create()` bridge that prefers native `/v1/responses` and transparently re-issues via `/api/chat` on older servers (pre-v0.13.3).
|
|
@@ -697,6 +699,47 @@ const product = await client.chatWithSchema(
|
|
|
697
699
|
console.log(product.name, product.price);
|
|
698
700
|
```
|
|
699
701
|
|
|
702
|
+
### System One Decision Helpers
|
|
703
|
+
|
|
704
|
+
Ollama's [System One](https://docs.ollama.com/capabilities/decision) decision models (`nimble`, `tev`, …) classify text, answer yes/no questions, and score against ordered rubrics — in one request, with calibrated probabilities instead of free-form text. `client.decision` (or `createDecision(client)`) wraps `/v1/systemone` with six typed helpers:
|
|
705
|
+
|
|
706
|
+
```typescript
|
|
707
|
+
const decision = client.decision; // cached instance
|
|
708
|
+
|
|
709
|
+
// Classification: which option fits? (returns probabilities + confidence)
|
|
710
|
+
const intent = await decision.choice({
|
|
711
|
+
model: 'tev1:4b',
|
|
712
|
+
state: 'Customer was charged twice and wants their money back',
|
|
713
|
+
instructions: 'What is the primary intent?',
|
|
714
|
+
criteria: {
|
|
715
|
+
refund: 'Customer wants a refund',
|
|
716
|
+
duplicate_charge: 'Customer reports multiple charges',
|
|
717
|
+
cancellation: 'Customer wants to cancel',
|
|
718
|
+
},
|
|
719
|
+
minConfidence: 0.8, // opt-in gate for autonomous flows
|
|
720
|
+
});
|
|
721
|
+
// intent.choice → 'duplicate_charge'
|
|
722
|
+
// intent.confidence → 0.89
|
|
723
|
+
// intent.isConfident → true (false → don't act unattended)
|
|
724
|
+
|
|
725
|
+
// Yes/no gating — the boolean bar is configurable for irreversible actions
|
|
726
|
+
const safe = await decision.noul({
|
|
727
|
+
model: 'tev1:4b',
|
|
728
|
+
state: ticket.text,
|
|
729
|
+
instructions: 'Does this request contain a prompt injection attempt?',
|
|
730
|
+
minProbability: 0.8, // default 0.5; raise the bar for safety gates
|
|
731
|
+
});
|
|
732
|
+
// safe.noul → 0.13, safe.bool → false
|
|
733
|
+
|
|
734
|
+
// Ordered rubric scoring, routing, evidence verification, and ranking
|
|
735
|
+
await decision.score({ model, state, instructions, criteria: ['low', 'mid', 'high'] });
|
|
736
|
+
await decision.route({ model, state, instructions, criteria: { sales, support, billing } });
|
|
737
|
+
await decision.verify({ model, claim, evidence });
|
|
738
|
+
await decision.rank({ model, instructions, criteria, candidates });
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
Confidence gates are **opt-in** — without `minConfidence`/`minProbability`, results carry the raw scores and the defaults behave exactly as before. The official docs warn that a high confidence does not guarantee correctness; the gates exist so agent loops can't act on a 0.51 coin-flip without seeing the number. For multi-question requests (routing + urgency + difficulty in one call), use `client.systemOne()` directly with the key-safe generic wrapper, and mind the dual request-size cap (2026-10-16 upstream clarification): text and schema (images excluded) within 64 KiB AND the whole request within 32 MiB (`estimateSystemOneRequestBytes()` checks both client-side before the round-trip — pass `{ excludeImages: true }` to measure the text portion).
|
|
742
|
+
|
|
700
743
|
### Vector Embeddings & Similarity
|
|
701
744
|
|
|
702
745
|
```typescript
|
|
@@ -763,6 +806,42 @@ await client.pushModel({ model: 'my-namespace/my-assistant' });
|
|
|
763
806
|
await client.deleteModel({ model: 'my-assistant-backup' });
|
|
764
807
|
```
|
|
765
808
|
|
|
809
|
+
### Model Pull & Push Progress
|
|
810
|
+
|
|
811
|
+
`pullModel`/`pushModel` with `stream: true` return a typed `OllamaStream` of NDJSON progress frames. `onProgress()` subscribes a callback with the fields progress bars actually need — a pre-computed `percent`, plus per-layer `bytesPerSecond` and `etaSeconds` once two byte-bearing frames have arrived:
|
|
812
|
+
|
|
813
|
+
```typescript
|
|
814
|
+
import { onProgress } from '@nemesis-oss/ollama-sdk';
|
|
815
|
+
|
|
816
|
+
const stream = await client.pullModel({ model: 'llama3.2', stream: true });
|
|
817
|
+
await onProgress(stream, (event) => {
|
|
818
|
+
if (event.percent !== undefined) {
|
|
819
|
+
const speed = event.bytesPerSecond
|
|
820
|
+
? ` at ${(event.bytesPerSecond / 1024 / 1024).toFixed(1)} MiB/s`
|
|
821
|
+
: '';
|
|
822
|
+
const eta = event.etaSeconds ? `, ETA ${Math.ceil(event.etaSeconds)}s` : '';
|
|
823
|
+
console.log(`${event.status}: ${event.percent.toFixed(2)}%${speed}${eta}`);
|
|
824
|
+
} else {
|
|
825
|
+
console.log(event.status); // "pulling manifest", "verifying sha256 digest", …
|
|
826
|
+
}
|
|
827
|
+
});
|
|
828
|
+
console.log('pull complete');
|
|
829
|
+
```
|
|
830
|
+
|
|
831
|
+
Speed semantics are chosen for stable UIs: a **cumulative average** since the layer's first byte-bearing frame (instantaneous frame-to-frame rates jitter wildly), with automatic **per-layer epochs** — the tracker resets whenever the `digest` changes or `completed` regresses, so a 4-layer pull never averages across layers. Consumers iterating the raw stream themselves (structured logging, custom dashboards) can use `createProgressSpeedTracker()` directly — the same stateful byte counter, without hand-rolling one:
|
|
832
|
+
|
|
833
|
+
```typescript
|
|
834
|
+
import { createProgressSpeedTracker } from '@nemesis-oss/ollama-sdk';
|
|
835
|
+
|
|
836
|
+
const speed = createProgressSpeedTracker();
|
|
837
|
+
for await (const event of stream) {
|
|
838
|
+
if (event.type === 'message') {
|
|
839
|
+
const { bytesPerSecond, etaSeconds } = speed(event.data.chunk);
|
|
840
|
+
// …render your own bar
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
```
|
|
844
|
+
|
|
766
845
|
### Web Search & Web Fetch (Ollama Cloud)
|
|
767
846
|
|
|
768
847
|
`webSearch`/`webFetch` wrap Ollama's **hosted** web tools (`POST https://ollama.com/api/web_search` and `/api/web_fetch`) — a fixed Ollama Cloud service, entirely separate from whatever local `baseUrl`/`endpoints` the client is configured with. They require an Ollama account API key (`apiKey` on the client, or the `OLLAMA_API_KEY` environment variable) regardless of where your inference traffic goes:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OllamaRuntime, H as HttpClient, A as AbortableAsyncIterable,
|
|
1
|
+
import { O as OllamaRuntime, H as HttpClient, A as AbortableAsyncIterable, ah as SseEvent, z as OllamaClientError } from './runtime-DYCxYGG-.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.
|
|
@@ -552,12 +552,12 @@ type SystemOneProbabilities = {
|
|
|
552
552
|
*/
|
|
553
553
|
|
|
554
554
|
interface SystemOneRequest {
|
|
555
|
-
/**
|
|
555
|
+
/** Model trained for System One, such as nimble, or clef:cloud for Ollama's cloud. */
|
|
556
556
|
readonly model: string;
|
|
557
557
|
readonly state: SystemOneContent;
|
|
558
|
-
/** Base64-encoded images shared by all questions, in request order. Requires
|
|
558
|
+
/** Base64-encoded images shared by all questions, in request order. Requires a model with vision, such as Clef. URLs and data URLs are not supported. */
|
|
559
559
|
readonly images?: readonly string[] | undefined;
|
|
560
|
-
/** Named questions about the shared state. Answers are not passed to later questions. */
|
|
560
|
+
/** Named questions about the shared state. Answers are not passed to later questions. Cloud models accept names of up to 100 ASCII letters, digits, `_`, `.`, or `-`. */
|
|
561
561
|
readonly questions: {
|
|
562
562
|
[key: string]: SystemOneChoiceQuestion | SystemOneNoulQuestion | SystemOneScoreQuestion;
|
|
563
563
|
};
|
|
@@ -614,7 +614,7 @@ interface SystemOneScoreAnswer {
|
|
|
614
614
|
interface SystemOneScoreQuestion {
|
|
615
615
|
readonly type: 'score';
|
|
616
616
|
readonly instructions: SystemOneContent;
|
|
617
|
-
/** Descriptions ordered from the lowest score (index 0) to the highest. Defines a scale from 0 to the number of criteria minus 1.
|
|
617
|
+
/** Descriptions ordered from the lowest score (index 0) to the highest. Defines a scale from 0 to the number of criteria minus 1. */
|
|
618
618
|
readonly criteria: readonly string[];
|
|
619
619
|
}
|
|
620
620
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { O as OllamaRuntime, H as HttpClient, A as AbortableAsyncIterable,
|
|
1
|
+
import { O as OllamaRuntime, H as HttpClient, A as AbortableAsyncIterable, ah as SseEvent, z as OllamaClientError } from './runtime-C28YEAHC.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.
|
|
@@ -552,12 +552,12 @@ type SystemOneProbabilities = {
|
|
|
552
552
|
*/
|
|
553
553
|
|
|
554
554
|
interface SystemOneRequest {
|
|
555
|
-
/**
|
|
555
|
+
/** Model trained for System One, such as nimble, or clef:cloud for Ollama's cloud. */
|
|
556
556
|
readonly model: string;
|
|
557
557
|
readonly state: SystemOneContent;
|
|
558
|
-
/** Base64-encoded images shared by all questions, in request order. Requires
|
|
558
|
+
/** Base64-encoded images shared by all questions, in request order. Requires a model with vision, such as Clef. URLs and data URLs are not supported. */
|
|
559
559
|
readonly images?: readonly string[] | undefined;
|
|
560
|
-
/** Named questions about the shared state. Answers are not passed to later questions. */
|
|
560
|
+
/** Named questions about the shared state. Answers are not passed to later questions. Cloud models accept names of up to 100 ASCII letters, digits, `_`, `.`, or `-`. */
|
|
561
561
|
readonly questions: {
|
|
562
562
|
[key: string]: SystemOneChoiceQuestion | SystemOneNoulQuestion | SystemOneScoreQuestion;
|
|
563
563
|
};
|
|
@@ -614,7 +614,7 @@ interface SystemOneScoreAnswer {
|
|
|
614
614
|
interface SystemOneScoreQuestion {
|
|
615
615
|
readonly type: 'score';
|
|
616
616
|
readonly instructions: SystemOneContent;
|
|
617
|
-
/** Descriptions ordered from the lowest score (index 0) to the highest. Defines a scale from 0 to the number of criteria minus 1.
|
|
617
|
+
/** Descriptions ordered from the lowest score (index 0) to the highest. Defines a scale from 0 to the number of criteria minus 1. */
|
|
618
618
|
readonly criteria: readonly string[];
|
|
619
619
|
}
|
|
620
620
|
|
package/dist/generated-api.cjs
CHANGED
|
@@ -192,7 +192,7 @@ var systemOneOp = {
|
|
|
192
192
|
path: "/v1/systemone",
|
|
193
193
|
request: { $ref: "#/schemas/SystemOneRequest" },
|
|
194
194
|
response: { $ref: "#/schemas/SystemOneResponse" },
|
|
195
|
-
environment: { local: true, cloud:
|
|
195
|
+
environment: { local: true, cloud: true },
|
|
196
196
|
transport: { mode: "json", streaming: false },
|
|
197
197
|
capabilities: {
|
|
198
198
|
thinking: "unsupported",
|
|
@@ -210,8 +210,10 @@ var systemOneOp = {
|
|
|
210
210
|
status: { documented: true, experimental: true },
|
|
211
211
|
domain: "native",
|
|
212
212
|
notes: [
|
|
213
|
-
"Local
|
|
214
|
-
"64 KiB
|
|
213
|
+
"Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.",
|
|
214
|
+
"Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.",
|
|
215
|
+
"Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.",
|
|
216
|
+
"401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.",
|
|
215
217
|
"No tools, no generation controls (temperature, top_p, etc.).",
|
|
216
218
|
"Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.",
|
|
217
219
|
"Experimental: behavioral surface may change between Ollama releases."
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/generated/api/operations.ts","../src/generated/api/native-api.ts","../src/generated/api/openai-api.ts","../src/generated/api/anthropic-api.ts"],"names":[],"mappings":";;;AASO,IAAM,SAAA,GAAY;AAAA,EACvB,WAAA,EAAa,SAAA;AAAA,EACb,MAAA,EAAQ,KAAA;AAAA,EACR,IAAA,EAAM,cAAA;AAAA,EACN,QAAA,EAAU,EAAE,IAAA,EAAM,2BAAA,EAA4B;AAAA,EAC9C,WAAA,EAAa,EAAE,KAAA,EAAO,KAAA,EAAO,OAAO,IAAA,EAAK;AAAA,EACzC,IAAA,EAAM,oBAAA;AAAA,EACN,SAAA,EAAW,EAAE,IAAA,EAAM,MAAA,EAAQ,WAAW,KAAA,EAAM;AAAA,EAC5C,cAAc,EAAC;AAAA,EACf,MAAA,EAAQ,EAAE,UAAA,EAAY,IAAA,EAAK;AAAA,EAC3B,MAAA,EAAQ,QAAA;AAAA,EACR,KAAA,EAAO;AAAA,IACL,6FAAA;AAAA,IACA,sEAAA;AAAA,IACA,iEAAA;AAAA,IACA,wFAAA;AAAA,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IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AACF","file":"generated-api.cjs","sourcesContent":["/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each OperationDefinition captures what Ollama exposes; the runtime\n * in src/generated/runtime/runtime.ts captures how the SDK behaves.\n */\n\nimport type { OperationDefinition } from '../runtime/operation-definition.js';\n\nexport const balanceOp = {\n operationId: 'balance',\n method: 'GET',\n path: '/api/balance',\n response: { $ref: '#/schemas/BalanceResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Takes no parameters. For usage history see the usage operation.',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.balance() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const blobsOp = {\n operationId: 'blobs',\n method: 'HEAD',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const chatOp = {\n operationId: 'chat',\n method: 'POST',\n path: '/api/chat',\n request: { $ref: '#/schemas/ChatRequest' },\n response: { $ref: '#/schemas/ChatResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Use /api/show to discover model-specific thinking values and defaults.',\n 'Structured output (format field) is rejected by Ollama Cloud.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const copyOp = {\n operationId: 'copy',\n method: 'POST',\n path: '/api/copy',\n request: { $ref: '#/schemas/CopyRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const createOp = {\n operationId: 'create',\n method: 'POST',\n path: '/api/create',\n request: { $ref: '#/schemas/CreateRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: { thinking: 'unsupported', tools: 'unsupported' },\n status: { documented: true },\n domain: 'native',\n notes: ['Model creation is local-only; Ollama Cloud does not support it.'],\n} as const satisfies OperationDefinition;\n\nexport const createBlobOp = {\n operationId: 'createBlob',\n method: 'POST',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'POST endpoint for blob creation; takes a binary body (application/octet-stream).',\n 'Handled by OllamaClient.createBlob() — the generated NativeApi does not expose this operation because the runtime JSON-encodes request bodies.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const deleteOp = {\n operationId: 'delete',\n method: 'DELETE',\n path: '/api/delete',\n request: { $ref: '#/schemas/DeleteRequest' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const embedOp = {\n operationId: 'embed',\n method: 'POST',\n path: '/api/embed',\n request: { $ref: '#/schemas/EmbedRequest' },\n response: { $ref: '#/schemas/EmbedResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const generateOp = {\n operationId: 'generate',\n method: 'POST',\n path: '/api/generate',\n request: { $ref: '#/schemas/GenerateRequest' },\n response: { $ref: '#/schemas/GenerateResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n vision: 'supported',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const psOp = {\n operationId: 'ps',\n method: 'GET',\n path: '/api/ps',\n response: { $ref: '#/schemas/PsResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pullOp = {\n operationId: 'pull',\n method: 'POST',\n path: '/api/pull',\n request: { $ref: '#/schemas/PullRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pushOp = {\n operationId: 'push',\n method: 'POST',\n path: '/api/push',\n request: { $ref: '#/schemas/PushRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const showOp = {\n operationId: 'show',\n method: 'POST',\n path: '/api/show',\n request: { $ref: '#/schemas/ShowRequest' },\n response: { $ref: '#/schemas/ShowResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings).',\n ],\n} as const satisfies OperationDefinition;\n\nexport const systemOneOp = {\n operationId: 'systemOne',\n method: 'POST',\n path: '/v1/systemone',\n request: { $ref: '#/schemas/SystemOneRequest' },\n response: { $ref: '#/schemas/SystemOneResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {\n thinking: 'unsupported',\n tools: 'unsupported',\n vision: 'model-dependent',\n structuredOutput: 'unsupported',\n logprobs: 'unsupported',\n embeddings: 'unsupported',\n },\n constraints: {\n minOllamaVersion: '0.35.0',\n maxRequestBytes: 65536,\n maxRequestBytesWithImages: 33554432,\n },\n status: { documented: true, experimental: true },\n domain: 'native',\n notes: [\n 'Local-only; Ollama Cloud rejects /v1/systemone.',\n '64 KiB request limit without images, 32 MiB with images (includes JSON/base64 overhead).',\n 'No tools, no generation controls (temperature, top_p, etc.).',\n 'Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.',\n 'Experimental: behavioral surface may change between Ollama releases.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const tagsOp = {\n operationId: 'tags',\n method: 'GET',\n path: '/api/tags',\n response: { $ref: '#/schemas/ListResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const usageOp = {\n operationId: 'usage',\n method: 'GET',\n path: '/api/usage',\n response: { $ref: '#/schemas/UsageResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Query parameters (not modeled by the generated runtime): range = 24h | 7d | 30d (server default 7d), scope = self | team (server default self; team scope requires a team admin).',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.usage() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const versionOp = {\n operationId: 'version',\n method: 'GET',\n path: '/api/version',\n response: { $ref: '#/schemas/VersionResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const webFetchOp = {\n operationId: 'webFetch',\n method: 'POST',\n path: '/api/web_fetch',\n request: { $ref: '#/schemas/WebFetchRequest' },\n response: { $ref: '#/schemas/WebFetchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webFetch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const webSearchOp = {\n operationId: 'webSearch',\n method: 'POST',\n path: '/api/web_search',\n request: { $ref: '#/schemas/WebSearchRequest' },\n response: { $ref: '#/schemas/WebSearchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webSearch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiChatCompletionsOp = {\n operationId: 'openaiChatCompletions',\n method: 'POST',\n path: '/v1/chat/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'unsupported',\n },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiCompletionsOp = {\n operationId: 'openaiCompletions',\n method: 'POST',\n path: '/v1/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { logprobs: 'unsupported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiEmbeddingsOp = {\n operationId: 'openaiEmbeddings',\n method: 'POST',\n path: '/v1/embeddings',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsOp = {\n operationId: 'openaiModels',\n method: 'GET',\n path: '/v1/models',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsGetOneOp = {\n operationId: 'openaiModelsGetOne',\n method: 'GET',\n path: '/v1/models/{model}',\n environment: { local: true, cloud: true },\n parameters: [{ name: 'model', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n notes: ['Returns metadata for a single OpenAI-compat model by id.'],\n} as const satisfies OperationDefinition;\n\nexport const openaiResponsesOp = {\n operationId: 'openaiResponses',\n method: 'POST',\n path: '/v1/responses',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const anthropicMessagesOp = {\n operationId: 'anthropicMessages',\n method: 'POST',\n path: '/v1/messages',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'anthropic',\n notes: [\n \"tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.\",\n 'Nested cache_control fields under messages[].content[].cache_control are unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const allOperations = [\n balanceOp,\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n createBlobOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n usageOp,\n versionOp,\n webFetchOp,\n webSearchOp,\n openaiChatCompletionsOp,\n openaiCompletionsOp,\n openaiEmbeddingsOp,\n openaiModelsOp,\n openaiModelsGetOneOp,\n openaiResponsesOp,\n anthropicMessagesOp,\n] as const;\n","/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each generated class delegates to OllamaRuntime — the runtime owns\n * transport, retry, streaming, telemetry, and error handling.\n */\n\nimport type { OllamaRuntime } from '../runtime/runtime.js';\nimport type {\n ChatRequest,\n ChatResponse,\n CopyRequest,\n CreateRequest,\n DeleteRequest,\n EmbedRequest,\n EmbedResponse,\n GenerateRequest,\n GenerateResponse,\n ListResponse,\n PsResponse,\n PullRequest,\n PushRequest,\n ShowRequest,\n ShowResponse,\n StatusResponse,\n SystemOneRequest,\n SystemOneResponse,\n VersionResponse,\n} from '../models/index.js';\nimport {\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n versionOp,\n} from './operations.js';\n\n/**\n * Generated API surface for Ollama's native domain.\n * Each method delegates to {@link OllamaRuntime.invoke}.\n */\nexport class NativeApi {\n constructor(private readonly runtime: OllamaRuntime) {}\n\n blobs(digest: string, options?: { signal?: AbortSignal }): Promise<unknown> {\n return this.runtime.invoke({\n operation: blobsOp,\n body: undefined,\n pathParams: { digest },\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n chat(request: ChatRequest & { stream?: false }): Promise<ChatResponse>;\n chat(\n request: ChatRequest & { stream: true },\n ): Promise<AsyncGenerator<ChatResponse, void, undefined>>;\n chat(\n request: ChatRequest,\n ): Promise<ChatResponse | AsyncGenerator<ChatResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: chatOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n copy(request: CopyRequest): Promise<StatusResponse> {\n return this.runtime.invoke({\n operation: copyOp,\n body: request,\n });\n }\n\n create(request: CreateRequest & { stream?: false }): Promise<StatusResponse>;\n create(\n request: CreateRequest & { stream: true },\n ): Promise<AsyncGenerator<StatusResponse, void, undefined>>;\n create(\n request: CreateRequest,\n ): Promise<StatusResponse | AsyncGenerator<StatusResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: createOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n delete(request: DeleteRequest): Promise<unknown> {\n return this.runtime.invoke({\n operation: deleteOp,\n body: request,\n });\n }\n\n embed(request: EmbedRequest): Promise<EmbedResponse> {\n return this.runtime.invoke({\n operation: embedOp,\n body: request,\n });\n }\n\n generate(request: GenerateRequest & { stream?: false }): Promise<GenerateResponse>;\n generate(\n request: GenerateRequest & { stream: true },\n ): Promise<AsyncGenerator<GenerateResponse, void, undefined>>;\n generate(\n request: GenerateRequest,\n ): Promise<GenerateResponse | AsyncGenerator<GenerateResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: generateOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n ps(options?: { signal?: AbortSignal }): Promise<PsResponse> {\n return this.runtime.invoke({\n operation: psOp,\n body: undefined,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n pull(request: PullRequest & { stream?: false }): Promise<StatusResponse>;\n pull(\n request: PullRequest & { stream: true },\n ): Promise<AsyncGenerator<StatusResponse, void, undefined>>;\n pull(\n request: PullRequest,\n ): Promise<StatusResponse | AsyncGenerator<StatusResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: pullOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n push(request: PushRequest & { stream?: false }): Promise<StatusResponse>;\n push(\n request: PushRequest & { stream: true },\n ): Promise<AsyncGenerator<StatusResponse, void, undefined>>;\n push(\n request: PushRequest,\n ): Promise<StatusResponse | AsyncGenerator<StatusResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: pushOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n show(request: ShowRequest): Promise<ShowResponse> {\n return this.runtime.invoke({\n operation: showOp,\n body: request,\n });\n }\n\n systemOne(request: SystemOneRequest): Promise<SystemOneResponse> {\n return this.runtime.invoke({\n operation: systemOneOp,\n body: request,\n });\n }\n\n tags(options?: { signal?: AbortSignal }): Promise<ListResponse> {\n return this.runtime.invoke({\n operation: tagsOp,\n body: undefined,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n version(options?: { signal?: AbortSignal }): Promise<VersionResponse> {\n return this.runtime.invoke({\n operation: versionOp,\n body: undefined,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n}\n","/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each generated class delegates to OllamaRuntime — the runtime owns\n * transport, retry, streaming, telemetry, and error handling.\n */\n\nimport type { OllamaRuntime } from '../runtime/runtime.js';\n// No model types referenced.\nimport type {\n OpenAIChatCompletionChunk,\n OpenAIChatCompletionRequest,\n OpenAIChatCompletionResponse,\n OpenAICompletionChunk,\n OpenAICompletionRequest,\n OpenAICompletionResponse,\n OpenAIEmbeddingRequest,\n OpenAIEmbeddingResponse,\n OpenAIListModelsResponse,\n OpenAIModelItem,\n OpenAIResponsesRequest,\n OpenAIResponsesResponse,\n OpenAIResponsesStreamEvent,\n} from '../../integrations/index.js';\nimport {\n openaiChatCompletionsOp,\n openaiCompletionsOp,\n openaiEmbeddingsOp,\n openaiModelsOp,\n openaiModelsGetOneOp,\n openaiResponsesOp,\n} from './operations.js';\n\n/**\n * Generated API surface for Ollama's openai domain.\n * Each method delegates to {@link OllamaRuntime.invoke}.\n */\nexport class OpenAIApi {\n constructor(private readonly runtime: OllamaRuntime) {}\n\n openaiChatCompletions(\n request: OpenAIChatCompletionRequest & { stream?: false },\n ): Promise<OpenAIChatCompletionResponse>;\n openaiChatCompletions(\n request: OpenAIChatCompletionRequest & { stream: true },\n ): Promise<AsyncGenerator<OpenAIChatCompletionChunk, void, undefined>>;\n openaiChatCompletions(\n request: OpenAIChatCompletionRequest,\n ): Promise<\n OpenAIChatCompletionResponse | AsyncGenerator<OpenAIChatCompletionChunk, void, undefined>\n > {\n return this.runtime.invoke({\n operation: openaiChatCompletionsOp,\n body: request,\n });\n }\n\n openaiCompletions(\n request: OpenAICompletionRequest & { stream?: false },\n ): Promise<OpenAICompletionResponse>;\n openaiCompletions(\n request: OpenAICompletionRequest & { stream: true },\n ): Promise<AsyncGenerator<OpenAICompletionChunk, void, undefined>>;\n openaiCompletions(\n request: OpenAICompletionRequest,\n ): Promise<OpenAICompletionResponse | AsyncGenerator<OpenAICompletionChunk, void, undefined>> {\n return this.runtime.invoke({\n operation: openaiCompletionsOp,\n body: request,\n });\n }\n\n openaiEmbeddings(request: OpenAIEmbeddingRequest): Promise<OpenAIEmbeddingResponse> {\n return this.runtime.invoke({\n operation: openaiEmbeddingsOp,\n body: request,\n });\n }\n\n openaiModels(options?: { signal?: AbortSignal }): Promise<OpenAIListModelsResponse> {\n return this.runtime.invoke({\n operation: openaiModelsOp,\n body: undefined,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n openaiModelsGetOne(model: string, options?: { signal?: AbortSignal }): Promise<OpenAIModelItem> {\n return this.runtime.invoke({\n operation: openaiModelsGetOneOp,\n body: undefined,\n pathParams: { model },\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n openaiResponses(\n request: OpenAIResponsesRequest & { stream?: false },\n ): Promise<OpenAIResponsesResponse>;\n openaiResponses(\n request: OpenAIResponsesRequest & { stream: true },\n ): Promise<AsyncGenerator<OpenAIResponsesStreamEvent, void, undefined>>;\n openaiResponses(\n request: OpenAIResponsesRequest,\n ): Promise<\n OpenAIResponsesResponse | AsyncGenerator<OpenAIResponsesStreamEvent, void, undefined>\n > {\n return this.runtime.invoke({\n operation: openaiResponsesOp,\n body: request,\n });\n }\n}\n","/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each generated class delegates to OllamaRuntime — the runtime owns\n * transport, retry, streaming, telemetry, and error handling.\n */\n\nimport type { OllamaRuntime } from '../runtime/runtime.js';\n// No model types referenced.\nimport type {\n AnthropicMessageStreamEvent,\n AnthropicMessagesRequest,\n AnthropicMessagesResponse,\n} from '../../integrations/index.js';\nimport { anthropicMessagesOp } from './operations.js';\n\n/**\n * Generated API surface for Ollama's anthropic domain.\n * Each method delegates to {@link OllamaRuntime.invoke}.\n */\nexport class AnthropicApi {\n constructor(private readonly runtime: OllamaRuntime) {}\n\n anthropicMessages(\n request: AnthropicMessagesRequest & { stream?: false },\n ): Promise<AnthropicMessagesResponse>;\n anthropicMessages(\n request: AnthropicMessagesRequest & { stream: true },\n ): Promise<AsyncGenerator<AnthropicMessageStreamEvent, void, undefined>>;\n anthropicMessages(\n request: AnthropicMessagesRequest,\n ): Promise<\n AnthropicMessagesResponse | AsyncGenerator<AnthropicMessageStreamEvent, void, undefined>\n > {\n return this.runtime.invoke({\n operation: anthropicMessagesOp,\n body: request,\n });\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/generated/api/operations.ts","../src/generated/api/native-api.ts","../src/generated/api/openai-api.ts","../src/generated/api/anthropic-api.ts"],"names":[],"mappings":";;;AASO,IAAM,SAAA,GAAY;AAAA,EACvB,WAAA,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Y,EAAE,KAAA,EAAM;AAAA,MACpB,GAAI,SAAS,MAAA,KAAW,MAAA,GAAY,EAAE,MAAA,EAAQ,OAAA,CAAQ,MAAA,EAAO,GAAI;AAAC,KACnE,CAAA;AAAA,EACH;AAAA,EAQA,gBACE,OAAA,EAGA;AACA,IAAA,OAAO,IAAA,CAAK,QAAQ,MAAA,CAAO;AAAA,MACzB,SAAA,EAAW,iBAAA;AAAA,MACX,IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AACF;;;AC5FO,IAAM,eAAN,MAAmB;AAAA,EACxB,YAA6B,OAAA,EAAwB;AAAxB,IAAA,IAAA,CAAA,OAAA,GAAA,OAAA;AAAA,EAAyB;AAAA,EAQtD,kBACE,OAAA,EAGA;AACA,IAAA,OAAO,IAAA,CAAK,QAAQ,MAAA,CAAO;AAAA,MACzB,SAAA,EAAW,mBAAA;AAAA,MACX,IAAA,EAAM;AAAA,KACP,CAAA;AAAA,EACH;AACF","file":"generated-api.cjs","sourcesContent":["/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each OperationDefinition captures what Ollama exposes; the runtime\n * in src/generated/runtime/runtime.ts captures how the SDK behaves.\n */\n\nimport type { OperationDefinition } from '../runtime/operation-definition.js';\n\nexport const balanceOp = {\n operationId: 'balance',\n method: 'GET',\n path: '/api/balance',\n response: { $ref: '#/schemas/BalanceResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Takes no parameters. For usage history see the usage operation.',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.balance() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const blobsOp = {\n operationId: 'blobs',\n method: 'HEAD',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'HEAD-only endpoint for blob existence checks; declared in OpenAPI but not in the legacy parity manifest.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const chatOp = {\n operationId: 'chat',\n method: 'POST',\n path: '/api/chat',\n request: { $ref: '#/schemas/ChatRequest' },\n response: { $ref: '#/schemas/ChatResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Use /api/show to discover model-specific thinking values and defaults.',\n 'Structured output (format field) is rejected by Ollama Cloud.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const copyOp = {\n operationId: 'copy',\n method: 'POST',\n path: '/api/copy',\n request: { $ref: '#/schemas/CopyRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const createOp = {\n operationId: 'create',\n method: 'POST',\n path: '/api/create',\n request: { $ref: '#/schemas/CreateRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: { thinking: 'unsupported', tools: 'unsupported' },\n status: { documented: true },\n domain: 'native',\n notes: ['Model creation is local-only; Ollama Cloud does not support it.'],\n} as const satisfies OperationDefinition;\n\nexport const createBlobOp = {\n operationId: 'createBlob',\n method: 'POST',\n path: '/api/blobs/{digest}',\n environment: { local: true, cloud: false },\n parameters: [{ name: 'digest', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'POST endpoint for blob creation; takes a binary body (application/octet-stream).',\n 'Handled by OllamaClient.createBlob() — the generated NativeApi does not expose this operation because the runtime JSON-encodes request bodies.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const deleteOp = {\n operationId: 'delete',\n method: 'DELETE',\n path: '/api/delete',\n request: { $ref: '#/schemas/DeleteRequest' },\n environment: { local: true, cloud: false },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const embedOp = {\n operationId: 'embed',\n method: 'POST',\n path: '/api/embed',\n request: { $ref: '#/schemas/EmbedRequest' },\n response: { $ref: '#/schemas/EmbedResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const generateOp = {\n operationId: 'generate',\n method: 'POST',\n path: '/api/generate',\n request: { $ref: '#/schemas/GenerateRequest' },\n response: { $ref: '#/schemas/GenerateResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {\n thinking: 'model-dependent',\n vision: 'supported',\n structuredOutput: 'supported',\n logprobs: 'supported',\n },\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const psOp = {\n operationId: 'ps',\n method: 'GET',\n path: '/api/ps',\n response: { $ref: '#/schemas/PsResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pullOp = {\n operationId: 'pull',\n method: 'POST',\n path: '/api/pull',\n request: { $ref: '#/schemas/PullRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const pushOp = {\n operationId: 'push',\n method: 'POST',\n path: '/api/push',\n request: { $ref: '#/schemas/PushRequest' },\n response: { $ref: '#/schemas/StatusResponse' },\n environment: { local: true, cloud: false },\n transport: { mode: 'ndjson', streaming: true, streamingDefault: true },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const showOp = {\n operationId: 'show',\n method: 'POST',\n path: '/api/show',\n request: { $ref: '#/schemas/ShowRequest' },\n response: { $ref: '#/schemas/ShowResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Capabilities source: /api/show is the runtime source of truth for model-dependent capability values (tools, vision, thinking, embeddings).',\n ],\n} as const satisfies OperationDefinition;\n\nexport const systemOneOp = {\n operationId: 'systemOne',\n method: 'POST',\n path: '/v1/systemone',\n request: { $ref: '#/schemas/SystemOneRequest' },\n response: { $ref: '#/schemas/SystemOneResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {\n thinking: 'unsupported',\n tools: 'unsupported',\n vision: 'model-dependent',\n structuredOutput: 'unsupported',\n logprobs: 'unsupported',\n embeddings: 'unsupported',\n },\n constraints: {\n minOllamaVersion: '0.35.0',\n maxRequestBytes: 65536,\n maxRequestBytesWithImages: 33554432,\n },\n status: { documented: true, experimental: true },\n domain: 'native',\n notes: [\n 'Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.',\n 'Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.',\n \"Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.\",\n '401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.',\n 'No tools, no generation controls (temperature, top_p, etc.).',\n 'Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.',\n 'Experimental: behavioral surface may change between Ollama releases.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const tagsOp = {\n operationId: 'tags',\n method: 'GET',\n path: '/api/tags',\n response: { $ref: '#/schemas/ListResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const usageOp = {\n operationId: 'usage',\n method: 'GET',\n path: '/api/usage',\n response: { $ref: '#/schemas/UsageResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only account endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Query parameters (not modeled by the generated runtime): range = 24h | 7d | 30d (server default 7d), scope = self | team (server default self; team scope requires a team admin).',\n 'Rate limited to 10 requests/minute per user; 429 responses carry a Retry-After header.',\n 'Use OllamaClient.usage() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const versionOp = {\n operationId: 'version',\n method: 'GET',\n path: '/api/version',\n response: { $ref: '#/schemas/VersionResponse' },\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n} as const satisfies OperationDefinition;\n\nexport const webFetchOp = {\n operationId: 'webFetch',\n method: 'POST',\n path: '/api/web_fetch',\n request: { $ref: '#/schemas/WebFetchRequest' },\n response: { $ref: '#/schemas/WebFetchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webFetch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const webSearchOp = {\n operationId: 'webSearch',\n method: 'POST',\n path: '/api/web_search',\n request: { $ref: '#/schemas/WebSearchRequest' },\n response: { $ref: '#/schemas/WebSearchResponse' },\n environment: { local: false, cloud: true },\n host: 'https://ollama.com',\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'native',\n notes: [\n 'Cloud-only capability endpoint — targets https://ollama.com, not the local Ollama server.',\n 'Requires an Ollama Cloud API key (set via OllamaClient credentials).',\n 'Use OllamaClient.webSearch() — the generated NativeApi class does not expose this operation.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiChatCompletionsOp = {\n operationId: 'openaiChatCompletions',\n method: 'POST',\n path: '/v1/chat/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: {\n thinking: 'model-dependent',\n tools: 'model-dependent',\n vision: 'model-dependent',\n structuredOutput: 'supported',\n logprobs: 'unsupported',\n },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama exposes a subset of the OpenAI Chat Completions request fields; see docs/upstream/ollama-openai-compatibility.mdx.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const openaiCompletionsOp = {\n operationId: 'openaiCompletions',\n method: 'POST',\n path: '/v1/completions',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { logprobs: 'unsupported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiEmbeddingsOp = {\n operationId: 'openaiEmbeddings',\n method: 'POST',\n path: '/v1/embeddings',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: { embeddings: 'supported' },\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsOp = {\n operationId: 'openaiModels',\n method: 'GET',\n path: '/v1/models',\n environment: { local: true, cloud: true },\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n} as const satisfies OperationDefinition;\n\nexport const openaiModelsGetOneOp = {\n operationId: 'openaiModelsGetOne',\n method: 'GET',\n path: '/v1/models/{model}',\n environment: { local: true, cloud: true },\n parameters: [{ name: 'model', in: 'path', required: true, schema: { type: 'string' } }],\n transport: { mode: 'json', streaming: false },\n capabilities: {},\n status: { documented: true },\n domain: 'openai',\n notes: ['Returns metadata for a single OpenAI-compat model by id.'],\n} as const satisfies OperationDefinition;\n\nexport const openaiResponsesOp = {\n operationId: 'openaiResponses',\n method: 'POST',\n path: '/v1/responses',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'openai',\n notes: [\n 'Ollama implements a subset of the OpenAI Responses API; previous_response_id and conversation are explicitly unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const anthropicMessagesOp = {\n operationId: 'anthropicMessages',\n method: 'POST',\n path: '/v1/messages',\n environment: { local: true, cloud: true },\n transport: { mode: 'sse', streaming: true, streamingDefault: false },\n capabilities: { thinking: 'model-dependent', tools: 'model-dependent' },\n status: { documented: true },\n domain: 'anthropic',\n notes: [\n \"tool_choice and metadata are explicitly unsupported by Ollama's Anthropic compat layer.\",\n 'Nested cache_control fields under messages[].content[].cache_control are unsupported.',\n ],\n} as const satisfies OperationDefinition;\n\nexport const allOperations = [\n balanceOp,\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n createBlobOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n usageOp,\n versionOp,\n webFetchOp,\n webSearchOp,\n openaiChatCompletionsOp,\n openaiCompletionsOp,\n openaiEmbeddingsOp,\n openaiModelsOp,\n openaiModelsGetOneOp,\n openaiResponsesOp,\n anthropicMessagesOp,\n] as const;\n","/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each generated class delegates to OllamaRuntime — the runtime owns\n * transport, retry, streaming, telemetry, and error handling.\n */\n\nimport type { OllamaRuntime } from '../runtime/runtime.js';\nimport type {\n ChatRequest,\n ChatResponse,\n CopyRequest,\n CreateRequest,\n DeleteRequest,\n EmbedRequest,\n EmbedResponse,\n GenerateRequest,\n GenerateResponse,\n ListResponse,\n PsResponse,\n PullRequest,\n PushRequest,\n ShowRequest,\n ShowResponse,\n StatusResponse,\n SystemOneRequest,\n SystemOneResponse,\n VersionResponse,\n} from '../models/index.js';\nimport {\n blobsOp,\n chatOp,\n copyOp,\n createOp,\n deleteOp,\n embedOp,\n generateOp,\n psOp,\n pullOp,\n pushOp,\n showOp,\n systemOneOp,\n tagsOp,\n versionOp,\n} from './operations.js';\n\n/**\n * Generated API surface for Ollama's native domain.\n * Each method delegates to {@link OllamaRuntime.invoke}.\n */\nexport class NativeApi {\n constructor(private readonly runtime: OllamaRuntime) {}\n\n blobs(digest: string, options?: { signal?: AbortSignal }): Promise<unknown> {\n return this.runtime.invoke({\n operation: blobsOp,\n body: undefined,\n pathParams: { digest },\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n chat(request: ChatRequest & { stream?: false }): Promise<ChatResponse>;\n chat(\n request: ChatRequest & { stream: true },\n ): Promise<AsyncGenerator<ChatResponse, void, undefined>>;\n chat(\n request: ChatRequest,\n ): Promise<ChatResponse | AsyncGenerator<ChatResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: chatOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n copy(request: CopyRequest): Promise<StatusResponse> {\n return this.runtime.invoke({\n operation: copyOp,\n body: request,\n });\n }\n\n create(request: CreateRequest & { stream?: false }): Promise<StatusResponse>;\n create(\n request: CreateRequest & { stream: true },\n ): Promise<AsyncGenerator<StatusResponse, void, undefined>>;\n create(\n request: CreateRequest,\n ): Promise<StatusResponse | AsyncGenerator<StatusResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: createOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n delete(request: DeleteRequest): Promise<unknown> {\n return this.runtime.invoke({\n operation: deleteOp,\n body: request,\n });\n }\n\n embed(request: EmbedRequest): Promise<EmbedResponse> {\n return this.runtime.invoke({\n operation: embedOp,\n body: request,\n });\n }\n\n generate(request: GenerateRequest & { stream?: false }): Promise<GenerateResponse>;\n generate(\n request: GenerateRequest & { stream: true },\n ): Promise<AsyncGenerator<GenerateResponse, void, undefined>>;\n generate(\n request: GenerateRequest,\n ): Promise<GenerateResponse | AsyncGenerator<GenerateResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: generateOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n ps(options?: { signal?: AbortSignal }): Promise<PsResponse> {\n return this.runtime.invoke({\n operation: psOp,\n body: undefined,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n pull(request: PullRequest & { stream?: false }): Promise<StatusResponse>;\n pull(\n request: PullRequest & { stream: true },\n ): Promise<AsyncGenerator<StatusResponse, void, undefined>>;\n pull(\n request: PullRequest,\n ): Promise<StatusResponse | AsyncGenerator<StatusResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: pullOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n push(request: PushRequest & { stream?: false }): Promise<StatusResponse>;\n push(\n request: PushRequest & { stream: true },\n ): Promise<AsyncGenerator<StatusResponse, void, undefined>>;\n push(\n request: PushRequest,\n ): Promise<StatusResponse | AsyncGenerator<StatusResponse, void, undefined>> {\n return this.runtime.invoke({\n operation: pushOp,\n body: request,\n streamingDefault: true,\n });\n }\n\n show(request: ShowRequest): Promise<ShowResponse> {\n return this.runtime.invoke({\n operation: showOp,\n body: request,\n });\n }\n\n systemOne(request: SystemOneRequest): Promise<SystemOneResponse> {\n return this.runtime.invoke({\n operation: systemOneOp,\n body: request,\n });\n }\n\n tags(options?: { signal?: AbortSignal }): Promise<ListResponse> {\n return this.runtime.invoke({\n operation: tagsOp,\n body: undefined,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n version(options?: { signal?: AbortSignal }): Promise<VersionResponse> {\n return this.runtime.invoke({\n operation: versionOp,\n body: undefined,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n}\n","/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each generated class delegates to OllamaRuntime — the runtime owns\n * transport, retry, streaming, telemetry, and error handling.\n */\n\nimport type { OllamaRuntime } from '../runtime/runtime.js';\n// No model types referenced.\nimport type {\n OpenAIChatCompletionChunk,\n OpenAIChatCompletionRequest,\n OpenAIChatCompletionResponse,\n OpenAICompletionChunk,\n OpenAICompletionRequest,\n OpenAICompletionResponse,\n OpenAIEmbeddingRequest,\n OpenAIEmbeddingResponse,\n OpenAIListModelsResponse,\n OpenAIModelItem,\n OpenAIResponsesRequest,\n OpenAIResponsesResponse,\n OpenAIResponsesStreamEvent,\n} from '../../integrations/index.js';\nimport {\n openaiChatCompletionsOp,\n openaiCompletionsOp,\n openaiEmbeddingsOp,\n openaiModelsOp,\n openaiModelsGetOneOp,\n openaiResponsesOp,\n} from './operations.js';\n\n/**\n * Generated API surface for Ollama's openai domain.\n * Each method delegates to {@link OllamaRuntime.invoke}.\n */\nexport class OpenAIApi {\n constructor(private readonly runtime: OllamaRuntime) {}\n\n openaiChatCompletions(\n request: OpenAIChatCompletionRequest & { stream?: false },\n ): Promise<OpenAIChatCompletionResponse>;\n openaiChatCompletions(\n request: OpenAIChatCompletionRequest & { stream: true },\n ): Promise<AsyncGenerator<OpenAIChatCompletionChunk, void, undefined>>;\n openaiChatCompletions(\n request: OpenAIChatCompletionRequest,\n ): Promise<\n OpenAIChatCompletionResponse | AsyncGenerator<OpenAIChatCompletionChunk, void, undefined>\n > {\n return this.runtime.invoke({\n operation: openaiChatCompletionsOp,\n body: request,\n });\n }\n\n openaiCompletions(\n request: OpenAICompletionRequest & { stream?: false },\n ): Promise<OpenAICompletionResponse>;\n openaiCompletions(\n request: OpenAICompletionRequest & { stream: true },\n ): Promise<AsyncGenerator<OpenAICompletionChunk, void, undefined>>;\n openaiCompletions(\n request: OpenAICompletionRequest,\n ): Promise<OpenAICompletionResponse | AsyncGenerator<OpenAICompletionChunk, void, undefined>> {\n return this.runtime.invoke({\n operation: openaiCompletionsOp,\n body: request,\n });\n }\n\n openaiEmbeddings(request: OpenAIEmbeddingRequest): Promise<OpenAIEmbeddingResponse> {\n return this.runtime.invoke({\n operation: openaiEmbeddingsOp,\n body: request,\n });\n }\n\n openaiModels(options?: { signal?: AbortSignal }): Promise<OpenAIListModelsResponse> {\n return this.runtime.invoke({\n operation: openaiModelsOp,\n body: undefined,\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n openaiModelsGetOne(model: string, options?: { signal?: AbortSignal }): Promise<OpenAIModelItem> {\n return this.runtime.invoke({\n operation: openaiModelsGetOneOp,\n body: undefined,\n pathParams: { model },\n ...(options?.signal !== undefined ? { signal: options.signal } : {}),\n });\n }\n\n openaiResponses(\n request: OpenAIResponsesRequest & { stream?: false },\n ): Promise<OpenAIResponsesResponse>;\n openaiResponses(\n request: OpenAIResponsesRequest & { stream: true },\n ): Promise<AsyncGenerator<OpenAIResponsesStreamEvent, void, undefined>>;\n openaiResponses(\n request: OpenAIResponsesRequest,\n ): Promise<\n OpenAIResponsesResponse | AsyncGenerator<OpenAIResponsesStreamEvent, void, undefined>\n > {\n return this.runtime.invoke({\n operation: openaiResponsesOp,\n body: request,\n });\n }\n}\n","/**\n * AUTO-GENERATED by `npm run contract:generate`. DO NOT EDIT.\n * Source: contracts/ir/ollama.ir.json (canonical Ollama IR).\n * Each generated class delegates to OllamaRuntime — the runtime owns\n * transport, retry, streaming, telemetry, and error handling.\n */\n\nimport type { OllamaRuntime } from '../runtime/runtime.js';\n// No model types referenced.\nimport type {\n AnthropicMessageStreamEvent,\n AnthropicMessagesRequest,\n AnthropicMessagesResponse,\n} from '../../integrations/index.js';\nimport { anthropicMessagesOp } from './operations.js';\n\n/**\n * Generated API surface for Ollama's anthropic domain.\n * Each method delegates to {@link OllamaRuntime.invoke}.\n */\nexport class AnthropicApi {\n constructor(private readonly runtime: OllamaRuntime) {}\n\n anthropicMessages(\n request: AnthropicMessagesRequest & { stream?: false },\n ): Promise<AnthropicMessagesResponse>;\n anthropicMessages(\n request: AnthropicMessagesRequest & { stream: true },\n ): Promise<AsyncGenerator<AnthropicMessageStreamEvent, void, undefined>>;\n anthropicMessages(\n request: AnthropicMessagesRequest,\n ): Promise<\n AnthropicMessagesResponse | AsyncGenerator<AnthropicMessageStreamEvent, void, undefined>\n > {\n return this.runtime.invoke({\n operation: anthropicMessagesOp,\n body: request,\n });\n }\n}\n"]}
|
package/dist/generated-api.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { O as OpenAIChatCompletionRequest, a as OpenAIChatCompletionResponse, b as OpenAIChatCompletionChunk, c as OpenAICompletionRequest, d as OpenAICompletionResponse, e as OpenAICompletionChunk, f as OpenAIEmbeddingRequest, g as OpenAIEmbeddingResponse, h as OpenAIListModelsResponse, i as OpenAIModelItem, j as OpenAIResponsesRequest, k as OpenAIResponsesResponse, l as OpenAIResponsesStreamEvent, A as AnthropicMessagesRequest, m as AnthropicMessagesResponse, n as AnthropicMessageStreamEvent } from './anthropic-
|
|
2
|
-
export { N as NativeApi } from './anthropic-
|
|
3
|
-
import { O as OllamaRuntime } from './runtime-
|
|
4
|
-
export { a as OperationDefinition } from './runtime-
|
|
5
|
-
import './types-
|
|
1
|
+
import { O as OpenAIChatCompletionRequest, a as OpenAIChatCompletionResponse, b as OpenAIChatCompletionChunk, c as OpenAICompletionRequest, d as OpenAICompletionResponse, e as OpenAICompletionChunk, f as OpenAIEmbeddingRequest, g as OpenAIEmbeddingResponse, h as OpenAIListModelsResponse, i as OpenAIModelItem, j as OpenAIResponsesRequest, k as OpenAIResponsesResponse, l as OpenAIResponsesStreamEvent, A as AnthropicMessagesRequest, m as AnthropicMessagesResponse, n as AnthropicMessageStreamEvent } from './anthropic-DIPnBwlf.cjs';
|
|
2
|
+
export { N as NativeApi } from './anthropic-DIPnBwlf.cjs';
|
|
3
|
+
import { O as OllamaRuntime } from './runtime-C28YEAHC.cjs';
|
|
4
|
+
export { a as OperationDefinition } from './runtime-C28YEAHC.cjs';
|
|
5
|
+
import './types-Y3u0FtdN.cjs';
|
|
6
6
|
import 'zod';
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -421,7 +421,7 @@ declare const systemOneOp: {
|
|
|
421
421
|
};
|
|
422
422
|
readonly environment: {
|
|
423
423
|
readonly local: true;
|
|
424
|
-
readonly cloud:
|
|
424
|
+
readonly cloud: true;
|
|
425
425
|
};
|
|
426
426
|
readonly transport: {
|
|
427
427
|
readonly mode: "json";
|
|
@@ -445,7 +445,7 @@ declare const systemOneOp: {
|
|
|
445
445
|
readonly experimental: true;
|
|
446
446
|
};
|
|
447
447
|
readonly domain: "native";
|
|
448
|
-
readonly notes: readonly ["Local
|
|
448
|
+
readonly notes: readonly ["Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.", "Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.", "Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.", "401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.", "No tools, no generation controls (temperature, top_p, etc.).", "Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.", "Experimental: behavioral surface may change between Ollama releases."];
|
|
449
449
|
};
|
|
450
450
|
declare const tagsOp: {
|
|
451
451
|
readonly operationId: "tags";
|
|
@@ -1056,7 +1056,7 @@ declare const allOperations: readonly [{
|
|
|
1056
1056
|
};
|
|
1057
1057
|
readonly environment: {
|
|
1058
1058
|
readonly local: true;
|
|
1059
|
-
readonly cloud:
|
|
1059
|
+
readonly cloud: true;
|
|
1060
1060
|
};
|
|
1061
1061
|
readonly transport: {
|
|
1062
1062
|
readonly mode: "json";
|
|
@@ -1080,7 +1080,7 @@ declare const allOperations: readonly [{
|
|
|
1080
1080
|
readonly experimental: true;
|
|
1081
1081
|
};
|
|
1082
1082
|
readonly domain: "native";
|
|
1083
|
-
readonly notes: readonly ["Local
|
|
1083
|
+
readonly notes: readonly ["Local and cloud: model accepts cloud models (e.g. clef:cloud); cloud models require Ollama >= 0.40.5 or the hosted https://ollama.com endpoint.", "Local dual cap: text and schema (excluding images) within 64 KiB AND the whole request within 32 MiB, including base64 and JSON overhead.", "Cloud requests: paid plan or usage credits required; up to 64 questions named with up to 100 ASCII letters, digits, `_`, `.`, or `-`; up to 4 images of at most 4 MiB and 16 megapixels each (8 MiB total); requests within 13 MiB; input within the model's 65,536-token context window.", "401 when a cloud model is requested without signing in or with an invalid API key (through a local server the response includes a signin_url); 402 when the cloud model is not included in the Free plan or a payment fails.", "No tools, no generation controls (temperature, top_p, etc.).", "Vision is model-dependent: images are accepted by vision-weighted models (Clef/Clef Flash) but not by text-only models.", "Experimental: behavioral surface may change between Ollama releases."];
|
|
1084
1084
|
}, {
|
|
1085
1085
|
readonly operationId: "tags";
|
|
1086
1086
|
readonly method: "GET";
|