@holokai/holo-provider-ollama 0.1.3 → 1.0.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/README.md +116 -93
- package/dist/manifest.d.ts +2 -2
- package/dist/manifest.d.ts.map +1 -1
- package/dist/manifest.js +3 -130
- package/dist/manifest.js.map +1 -1
- package/dist/ollama.auditor.d.ts +5 -3
- package/dist/ollama.auditor.d.ts.map +1 -1
- package/dist/ollama.auditor.js +8 -6
- package/dist/ollama.auditor.js.map +1 -1
- package/dist/ollama.provider.d.ts +9 -4
- package/dist/ollama.provider.d.ts.map +1 -1
- package/dist/ollama.provider.js +51 -14
- package/dist/ollama.provider.js.map +1 -1
- package/dist/ollama.response.factory.d.ts +2 -2
- package/dist/ollama.response.factory.d.ts.map +1 -1
- package/dist/ollama.response.factory.js +3 -3
- package/dist/ollama.response.factory.js.map +1 -1
- package/dist/ollama.translator.d.ts +2 -1
- package/dist/ollama.translator.d.ts.map +1 -1
- package/dist/ollama.translator.js +1 -1
- package/dist/ollama.translator.js.map +1 -1
- package/dist/ollama.wire.adapter.d.ts +2 -2
- package/dist/ollama.wire.adapter.d.ts.map +1 -1
- package/dist/ollama.wire.adapter.js +4 -4
- package/dist/ollama.wire.adapter.js.map +1 -1
- package/dist/plugin.d.ts +8 -6
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +12 -5
- package/dist/plugin.js.map +1 -1
- package/dist/translators/ollama.chat.request.translator.d.ts +1 -1
- package/dist/translators/ollama.chat.request.translator.d.ts.map +1 -1
- package/dist/translators/ollama.chat.request.translator.js.map +1 -1
- package/dist/translators/ollama.chat.response.translator.d.ts +1 -1
- package/dist/translators/ollama.chat.response.translator.d.ts.map +1 -1
- package/dist/translators/ollama.chat.response.translator.js.map +1 -1
- package/dist/translators/ollama.generate.request.translator.d.ts +1 -1
- package/dist/translators/ollama.generate.request.translator.d.ts.map +1 -1
- package/dist/translators/ollama.generate.request.translator.js.map +1 -1
- package/dist/translators/ollama.generate.response.translator.d.ts +1 -1
- package/dist/translators/ollama.generate.response.translator.d.ts.map +1 -1
- package/dist/translators/ollama.generate.response.translator.js.map +1 -1
- package/dist/translators/ollama.message.translators.d.ts +1 -1
- package/dist/translators/ollama.message.translators.d.ts.map +1 -1
- package/dist/translators/ollama.message.translators.js.map +1 -1
- package/dist/translators/ollama.options.translators.d.ts +2 -1
- package/dist/translators/ollama.options.translators.d.ts.map +1 -1
- package/dist/translators/ollama.options.translators.js +2 -1
- package/dist/translators/ollama.options.translators.js.map +1 -1
- package/dist/translators/ollama.tool.translators.d.ts +2 -1
- package/dist/translators/ollama.tool.translators.d.ts.map +1 -1
- package/dist/translators/ollama.tool.translators.js +2 -1
- package/dist/translators/ollama.tool.translators.js.map +1 -1
- package/dist/translators/streaming/ollama.content.delta.translator.d.ts +1 -1
- package/dist/translators/streaming/ollama.content.delta.translator.d.ts.map +1 -1
- package/dist/translators/streaming/ollama.content.delta.translator.js.map +1 -1
- package/dist/translators/streaming/ollama.message.delta.translator.d.ts +1 -1
- package/dist/translators/streaming/ollama.message.delta.translator.d.ts.map +1 -1
- package/dist/translators/streaming/ollama.message.delta.translator.js.map +1 -1
- package/dist/translators/streaming/ollama.message.stop.translator.d.ts +1 -1
- package/dist/translators/streaming/ollama.message.stop.translator.d.ts.map +1 -1
- package/dist/translators/streaming/ollama.message.stop.translator.js.map +1 -1
- package/dist/translators/streaming/ollama.stream.translator.d.ts +1 -1
- package/dist/translators/streaming/ollama.stream.translator.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -9,7 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
## Overview
|
|
11
11
|
|
|
12
|
-
The Ollama provider plugin enables Holo to communicate with locally-hosted Ollama models through the universal Holo
|
|
12
|
+
The Ollama provider plugin enables Holo to communicate with locally-hosted Ollama models through the universal Holo
|
|
13
|
+
format. This plugin is part of the migration from the monolithic provider architecture to a plugin-based system,
|
|
14
|
+
providing complete bidirectional translation between Ollama's native API and the portable Holo format.
|
|
13
15
|
|
|
14
16
|
### Key Features
|
|
15
17
|
|
|
@@ -33,6 +35,7 @@ npm install @holokai/holo-provider-ollama
|
|
|
33
35
|
### Peer Dependencies
|
|
34
36
|
|
|
35
37
|
This plugin requires:
|
|
38
|
+
|
|
36
39
|
- `@holokai/sdk` ^0.1.0 - Holo universal format types and plugin contracts
|
|
37
40
|
- `ollama` ^0.6.3 - Official Ollama JavaScript SDK
|
|
38
41
|
|
|
@@ -47,7 +50,8 @@ This plugin requires:
|
|
|
47
50
|
|
|
48
51
|
### Automatic Discovery
|
|
49
52
|
|
|
50
|
-
When installed in a Holo worker environment, this plugin is automatically discovered and loaded by the plugin system. No
|
|
53
|
+
When installed in a Holo worker environment, this plugin is automatically discovered and loaded by the plugin system. No
|
|
54
|
+
manual registration required.
|
|
51
55
|
|
|
52
56
|
### Configuration
|
|
53
57
|
|
|
@@ -91,9 +95,11 @@ const response: HoloResponse = await holoClient.chat(request);
|
|
|
91
95
|
|
|
92
96
|
### What Changed
|
|
93
97
|
|
|
94
|
-
This plugin represents the extraction of Ollama provider logic from the monolithic `src/providers/ollama/` codebase into
|
|
98
|
+
This plugin represents the extraction of Ollama provider logic from the monolithic `src/providers/ollama/` codebase into
|
|
99
|
+
a standalone, independently versioned package.
|
|
95
100
|
|
|
96
101
|
**Before** (Monolithic):
|
|
102
|
+
|
|
97
103
|
```
|
|
98
104
|
src/providers/ollama/
|
|
99
105
|
├── ollama.translator.ts
|
|
@@ -105,6 +111,7 @@ src/providers/ollama/
|
|
|
105
111
|
```
|
|
106
112
|
|
|
107
113
|
**After** (Plugin):
|
|
114
|
+
|
|
108
115
|
```
|
|
109
116
|
@holokai/holo-provider-ollama
|
|
110
117
|
├── src/
|
|
@@ -205,79 +212,83 @@ This plugin implements the official Holo format mappings as documented in the SD
|
|
|
205
212
|
|
|
206
213
|
### Request Mapping: Holo → Ollama
|
|
207
214
|
|
|
208
|
-
| Holo Field
|
|
209
|
-
|
|
210
|
-
| **Direct 1:1**
|
|
211
|
-
| `model`
|
|
212
|
-
| `stream`
|
|
213
|
-
| **Structure Transforms**
|
|
214
|
-
| `system` (Chat)
|
|
215
|
-
| `system` (Generate)
|
|
216
|
-
| `messages` (Chat)
|
|
217
|
-
| `messages` (Generate)
|
|
218
|
-
| `temperature`
|
|
219
|
-
| `top_p`
|
|
220
|
-
| `top_k`
|
|
221
|
-
| `max_tokens`
|
|
222
|
-
| `stop_sequences`
|
|
223
|
-
| `frequency_penalty`
|
|
224
|
-
| `presence_penalty`
|
|
225
|
-
| `seed`
|
|
226
|
-
| `response_format.type: 'json_object'` | `format: "json"`
|
|
227
|
-
| `response_format.schema`
|
|
228
|
-
| `tools` (Chat)
|
|
215
|
+
| Holo Field | Ollama Field | Transformation | Notes |
|
|
216
|
+
|---------------------------------------|------------------------------------|----------------------------------|---------------------|
|
|
217
|
+
| **Direct 1:1** | | | |
|
|
218
|
+
| `model` | `model` | Direct | Required |
|
|
219
|
+
| `stream` | `stream` | Direct | Optional |
|
|
220
|
+
| **Structure Transforms** | | | |
|
|
221
|
+
| `system` (Chat) | First message with `role:'system'` | Inject as message | Optional |
|
|
222
|
+
| `system` (Generate) | `system` | Top-level field | Optional |
|
|
223
|
+
| `messages` (Chat) | `messages` | Flatten to text + extract images | Required |
|
|
224
|
+
| `messages` (Generate) | `prompt` | Extract from single user message | Converted to string |
|
|
225
|
+
| `temperature` | `options.temperature` | Nest in options | Optional |
|
|
226
|
+
| `top_p` | `options.top_p` | Nest in options | Optional |
|
|
227
|
+
| `top_k` | `options.top_k` | Nest in options | Optional |
|
|
228
|
+
| `max_tokens` | `options.num_predict` | Nest + rename | Optional |
|
|
229
|
+
| `stop_sequences` | `options.stop` | Nest in options | Array format |
|
|
230
|
+
| `frequency_penalty` | `options.frequency_penalty` | Nest in options | Optional |
|
|
231
|
+
| `presence_penalty` | `options.presence_penalty` | Nest in options | Optional |
|
|
232
|
+
| `seed` | `options.seed` | Nest in options | Optional |
|
|
233
|
+
| `response_format.type: 'json_object'` | `format: "json"` | Map to string | Optional |
|
|
234
|
+
| `response_format.schema` | `format: {...}` | Pass schema object | Optional |
|
|
235
|
+
| `tools` (Chat) | `tools` | Direct | Chat mode only |
|
|
229
236
|
|
|
230
237
|
**Dropped Fields** (Holo → Ollama):
|
|
238
|
+
|
|
231
239
|
- `tool_choice` - Ollama doesn't support explicit tool selection (log warning)
|
|
232
240
|
- `service_tier` - Not applicable to local models
|
|
233
241
|
- `metadata` - Provider-specific field
|
|
234
242
|
|
|
235
243
|
**Ollama-Specific Fields** (not in Holo):
|
|
244
|
+
|
|
236
245
|
- `keep_alive` - Model memory duration (handled via config)
|
|
237
246
|
- `options.*` - Runtime-specific hardware options
|
|
238
247
|
- `raw` - Skip prompt formatting (Generate mode only)
|
|
239
248
|
|
|
240
249
|
### Response Mapping: Ollama → Holo
|
|
241
250
|
|
|
242
|
-
| Ollama Field
|
|
243
|
-
|
|
244
|
-
| **Direct 1:1**
|
|
245
|
-
| `model`
|
|
246
|
-
| `message.role` (Chat)
|
|
247
|
-
| `message.content` (Chat)
|
|
248
|
-
| `response` (Generate)
|
|
249
|
-
| `message.tool_calls`
|
|
250
|
-
| **Structure Transforms**
|
|
251
|
-
| N/A
|
|
252
|
-
| `created_at`
|
|
253
|
-
| `done_reason: 'stop'`
|
|
254
|
-
| `done_reason: 'length'`
|
|
255
|
-
| `done: true` with no `done_reason` | `finish_reason: 'stop'`
|
|
256
|
-
| `prompt_eval_count`
|
|
257
|
-
| `eval_count`
|
|
258
|
-
| Computed
|
|
259
|
-
| `total_duration` (ns)
|
|
260
|
-
| `load_duration` (ns)
|
|
261
|
-
| `prompt_eval_duration` (ns)
|
|
262
|
-
| `eval_duration` (ns)
|
|
251
|
+
| Ollama Field | Holo Field | Transformation | Notes |
|
|
252
|
+
|------------------------------------|-----------------------------|---------------------|--------------------------|
|
|
253
|
+
| **Direct 1:1** | | | |
|
|
254
|
+
| `model` | `model` | Direct | Always present |
|
|
255
|
+
| `message.role` (Chat) | `messages[0].role` | Wrap in array | Always 'assistant' |
|
|
256
|
+
| `message.content` (Chat) | `messages[0].content` | Direct | Text content |
|
|
257
|
+
| `response` (Generate) | `messages[0].content` | Wrap in message | Text content |
|
|
258
|
+
| `message.tool_calls` | `messages[0].tool_calls` | Direct | If present |
|
|
259
|
+
| **Structure Transforms** | | | |
|
|
260
|
+
| N/A | `id` | Synthesize UUID | Ollama lacks ID |
|
|
261
|
+
| `created_at` | `created` | Parse ISO8601 to ms | `Date.parse(created_at)` |
|
|
262
|
+
| `done_reason: 'stop'` | `finish_reason: 'stop'` | Direct | Optional |
|
|
263
|
+
| `done_reason: 'length'` | `finish_reason: 'length'` | Direct | Optional |
|
|
264
|
+
| `done: true` with no `done_reason` | `finish_reason: 'stop'` | Default | Fallback behavior |
|
|
265
|
+
| `prompt_eval_count` | `usage.input_tokens` | Rename | Optional |
|
|
266
|
+
| `eval_count` | `usage.output_tokens` | Rename | Optional |
|
|
267
|
+
| Computed | `usage.total_tokens` | `input + output` | Derived |
|
|
268
|
+
| `total_duration` (ns) | `usage.timings.total` | Direct | Optional; nanoseconds |
|
|
269
|
+
| `load_duration` (ns) | `usage.timings.load` | Direct | Optional; nanoseconds |
|
|
270
|
+
| `prompt_eval_duration` (ns) | `usage.timings.prompt_eval` | Direct | Optional; nanoseconds |
|
|
271
|
+
| `eval_duration` (ns) | `usage.timings.eval` | Direct | Optional; nanoseconds |
|
|
263
272
|
|
|
264
273
|
**ID Synthesis**:
|
|
274
|
+
|
|
265
275
|
- Ollama responses do NOT include `id` fields
|
|
266
276
|
- Translators MUST synthesize UUIDs for all responses and streaming chunks
|
|
267
277
|
- For streaming: Generate once at start, reuse across all chunks
|
|
268
278
|
|
|
269
279
|
**Timestamp Conversion**:
|
|
280
|
+
|
|
270
281
|
- Ollama: ISO8601 string (e.g., `"2024-01-01T12:00:00Z"`)
|
|
271
282
|
- Holo: Milliseconds since epoch (`number`)
|
|
272
283
|
- Conversion: `Date.parse(created_at)`
|
|
273
284
|
|
|
274
285
|
**Finish Reason Mapping**:
|
|
275
286
|
|
|
276
|
-
| Ollama `done_reason`
|
|
277
|
-
|
|
278
|
-
| `'stop'`
|
|
279
|
-
| `'length'`
|
|
280
|
-
| `null` or missing + `done: true` | `'stop'`
|
|
287
|
+
| Ollama `done_reason` | Holo `finish_reason` | Notes |
|
|
288
|
+
|----------------------------------|----------------------|--------------------|
|
|
289
|
+
| `'stop'` | `'stop'` | Natural completion |
|
|
290
|
+
| `'length'` | `'length'` | Hit token limit |
|
|
291
|
+
| `null` or missing + `done: true` | `'stop'` | Default fallback |
|
|
281
292
|
|
|
282
293
|
### Content Mapping
|
|
283
294
|
|
|
@@ -322,28 +333,32 @@ This plugin implements the official Holo format mappings as documented in the SD
|
|
|
322
333
|
```typescript
|
|
323
334
|
// Ollama Response (OpenAI-style)
|
|
324
335
|
{
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
336
|
+
message: {
|
|
337
|
+
role: 'assistant',
|
|
338
|
+
content
|
|
339
|
+
:
|
|
340
|
+
'',
|
|
341
|
+
tool_calls
|
|
342
|
+
:
|
|
343
|
+
[{
|
|
344
|
+
id: 'call_abc',
|
|
345
|
+
type: 'function',
|
|
346
|
+
function: {name: 'get_weather', arguments: {location: 'SF'}}
|
|
347
|
+
}]
|
|
348
|
+
}
|
|
334
349
|
}
|
|
335
350
|
|
|
336
351
|
// Holo Response (direct mapping)
|
|
337
352
|
{
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
353
|
+
messages: [{
|
|
354
|
+
role: 'assistant',
|
|
355
|
+
content: '',
|
|
356
|
+
tool_calls: [{
|
|
357
|
+
id: 'call_abc',
|
|
358
|
+
type: 'function',
|
|
359
|
+
function: {name: 'get_weather', arguments: {location: 'SF'}}
|
|
360
|
+
}]
|
|
345
361
|
}]
|
|
346
|
-
}]
|
|
347
362
|
}
|
|
348
363
|
```
|
|
349
364
|
|
|
@@ -357,16 +372,16 @@ This plugin implements the official Holo format mappings as documented in the SD
|
|
|
357
372
|
|
|
358
373
|
Ollama provides two distinct endpoints with different capabilities:
|
|
359
374
|
|
|
360
|
-
| Feature
|
|
361
|
-
|
|
362
|
-
| **Endpoint**
|
|
363
|
-
| **Input**
|
|
364
|
-
| **Conversation**
|
|
365
|
-
| **System Prompt**
|
|
366
|
-
| **Tools**
|
|
367
|
-
| **Images**
|
|
368
|
-
| **Context Continuation** | ❌ Use message history
|
|
369
|
-
| **Use Case**
|
|
375
|
+
| Feature | Chat Mode (`/api/chat`) | Generate Mode (`/api/generate`) |
|
|
376
|
+
|--------------------------|-------------------------|---------------------------------|
|
|
377
|
+
| **Endpoint** | `/api/chat` | `/api/generate` |
|
|
378
|
+
| **Input** | `messages[]` array | `prompt` string |
|
|
379
|
+
| **Conversation** | ✅ Multi-turn history | ❌ Single prompt only |
|
|
380
|
+
| **System Prompt** | ✅ As first message | ✅ Top-level field |
|
|
381
|
+
| **Tools** | ✅ Function calling | ❌ Not supported |
|
|
382
|
+
| **Images** | ✅ Via `images[]` | ❌ Not supported |
|
|
383
|
+
| **Context Continuation** | ❌ Use message history | ✅ Via `context` array |
|
|
384
|
+
| **Use Case** | Interactive chat | Single completion |
|
|
370
385
|
|
|
371
386
|
### Mode Selection
|
|
372
387
|
|
|
@@ -375,24 +390,24 @@ The plugin automatically selects the appropriate mode based on the request:
|
|
|
375
390
|
```typescript
|
|
376
391
|
// Auto-detected as Chat Mode (has tools)
|
|
377
392
|
const chatRequest: HoloRequest = {
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
393
|
+
model: 'llama2',
|
|
394
|
+
messages: [{role: 'user', content: 'What is the weather?'}],
|
|
395
|
+
tools: [{name: 'get_weather', parameters: {...}}]
|
|
381
396
|
};
|
|
382
397
|
|
|
383
398
|
// Can be either mode (no tools, single message)
|
|
384
399
|
const simpleRequest: HoloRequest = {
|
|
385
|
-
|
|
386
|
-
|
|
400
|
+
model: 'llama2',
|
|
401
|
+
messages: [{role: 'user', content: 'Complete this sentence...'}]
|
|
387
402
|
};
|
|
388
403
|
|
|
389
404
|
// Force Generate Mode via provider config
|
|
390
405
|
const generateRequest: HoloRequest = {
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
406
|
+
model: 'llama2',
|
|
407
|
+
messages: [{role: 'user', content: 'Complete: Once upon a time'}],
|
|
408
|
+
provider_config: {
|
|
409
|
+
mode: 'generate' // Force Generate endpoint
|
|
410
|
+
}
|
|
396
411
|
};
|
|
397
412
|
```
|
|
398
413
|
|
|
@@ -443,11 +458,11 @@ Ollama uses a simpler frame-based streaming model compared to Claude's event-bas
|
|
|
443
458
|
|
|
444
459
|
The plugin translates Ollama frames to Holo streaming events:
|
|
445
460
|
|
|
446
|
-
| Ollama Frame
|
|
447
|
-
|
|
448
|
-
| First frame (`done: false`)
|
|
449
|
-
| Content frames (`done: false`) | `content_delta`
|
|
450
|
-
| Final frame (`done: true`)
|
|
461
|
+
| Ollama Frame | Holo Event | Notes |
|
|
462
|
+
|--------------------------------|-----------------------------------|-----------------------------|
|
|
463
|
+
| First frame (`done: false`) | `message_start` + `content_delta` | Synthesized by orchestrator |
|
|
464
|
+
| Content frames (`done: false`) | `content_delta` | Incremental text |
|
|
465
|
+
| Final frame (`done: true`) | `message_delta` + `message_stop` | Usage + completion |
|
|
451
466
|
|
|
452
467
|
### Streaming Example
|
|
453
468
|
|
|
@@ -566,6 +581,7 @@ import type {
|
|
|
566
581
|
### Migration from Legacy Types
|
|
567
582
|
|
|
568
583
|
**Before** (Legacy provider):
|
|
584
|
+
|
|
569
585
|
```typescript
|
|
570
586
|
import { HoloTool } from '../../types/holo/requests';
|
|
571
587
|
|
|
@@ -575,6 +591,7 @@ interface HoloTool {
|
|
|
575
591
|
```
|
|
576
592
|
|
|
577
593
|
**After** (Plugin SDK):
|
|
594
|
+
|
|
578
595
|
```typescript
|
|
579
596
|
import type { HoloTool, HoloJsonSchema } from '@holokai/sdk';
|
|
580
597
|
|
|
@@ -661,7 +678,8 @@ npm run clean
|
|
|
661
678
|
|
|
662
679
|
**Issue**: Ollama responses don't include `id` fields.
|
|
663
680
|
|
|
664
|
-
**Workaround**: Plugin automatically synthesizes UUIDs for all responses. For streaming, the same ID is used across all
|
|
681
|
+
**Workaround**: Plugin automatically synthesizes UUIDs for all responses. For streaming, the same ID is used across all
|
|
682
|
+
chunks in a session.
|
|
665
683
|
|
|
666
684
|
### Timestamp Format
|
|
667
685
|
|
|
@@ -692,15 +710,18 @@ npm run clean
|
|
|
692
710
|
## Related Documentation
|
|
693
711
|
|
|
694
712
|
### SDK Documentation
|
|
713
|
+
|
|
695
714
|
- [SDK README](../sdk/README.md) - Plugin development guide and templates
|
|
696
715
|
|
|
697
716
|
### Ollama Documentation
|
|
717
|
+
|
|
698
718
|
- [Official API Docs](https://github.com/ollama/ollama/blob/main/docs/api.md)
|
|
699
719
|
- [Model Library](https://ollama.com/library)
|
|
700
720
|
- [Model Files](https://github.com/ollama/ollama/blob/main/docs/modelfile.md)
|
|
701
721
|
- [FAQ](https://github.com/ollama/ollama/blob/main/docs/faq.md)
|
|
702
722
|
|
|
703
723
|
### Migration Notes
|
|
724
|
+
|
|
704
725
|
- This plugin was extracted from the monolithic `src/providers/ollama/` codebase
|
|
705
726
|
- Migration to plugin architecture is complete
|
|
706
727
|
|
|
@@ -718,6 +739,7 @@ npm run clean
|
|
|
718
739
|
### Reporting Issues
|
|
719
740
|
|
|
720
741
|
Found a bug or have a feature request?
|
|
742
|
+
|
|
721
743
|
- GitHub Issues: https://github.com/holokai/holo-provider-ollama/issues
|
|
722
744
|
- Include: Holo version, Ollama version, model name, request/response samples
|
|
723
745
|
|
|
@@ -732,6 +754,7 @@ MIT © Holokai
|
|
|
732
754
|
## Changelog
|
|
733
755
|
|
|
734
756
|
### v0.1.0 (Current)
|
|
757
|
+
|
|
735
758
|
- ✅ Initial plugin release
|
|
736
759
|
- ✅ Extracted from monolithic architecture
|
|
737
760
|
- ✅ Migrated to SDK types
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const manifest:
|
|
1
|
+
import type { IHoloPluginManifest } from "@holokai/types/plugin";
|
|
2
|
+
export declare const manifest: IHoloPluginManifest;
|
|
3
3
|
//# sourceMappingURL=manifest.d.ts.map
|
package/dist/manifest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,uBAAuB,CAAC;AAE/D,eAAO,MAAM,QAAQ,EAAE,mBAOtB,CAAC"}
|
package/dist/manifest.js
CHANGED
|
@@ -1,136 +1,9 @@
|
|
|
1
1
|
export const manifest = {
|
|
2
|
-
// Required identity
|
|
3
2
|
name: '@holokai/provider-ollama',
|
|
4
|
-
family: 'ollama',
|
|
5
3
|
version: '1.0.0',
|
|
6
4
|
pluginType: 'provider',
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
author: {
|
|
11
|
-
name: 'Holokai Team',
|
|
12
|
-
url: 'https://holok.ai'
|
|
13
|
-
},
|
|
14
|
-
license: 'MIT',
|
|
15
|
-
homepage: 'https://holok.ai/docs/providers/ollama',
|
|
16
|
-
repository: {
|
|
17
|
-
type: 'git',
|
|
18
|
-
url: 'https://github.com/holokai/holokai',
|
|
19
|
-
directory: 'packages/provider-ollama'
|
|
20
|
-
},
|
|
21
|
-
bugs: {
|
|
22
|
-
url: 'https://github.com/holokai/holokai/issues'
|
|
23
|
-
},
|
|
24
|
-
keywords: [
|
|
25
|
-
'holokai',
|
|
26
|
-
'holo',
|
|
27
|
-
'ollama',
|
|
28
|
-
'provider',
|
|
29
|
-
'llm',
|
|
30
|
-
'local',
|
|
31
|
-
'chat-completions',
|
|
32
|
-
'streaming'
|
|
33
|
-
],
|
|
34
|
-
// Engine / dependency requirements
|
|
35
|
-
engineVersion: '>=1.0.0 <2.0.0',
|
|
36
|
-
peerDependencies: {
|
|
37
|
-
'@holokai/sdk': '^1.0.0'
|
|
38
|
-
},
|
|
39
|
-
dependencies: {
|
|
40
|
-
ollama: '^0.6.3'
|
|
41
|
-
},
|
|
42
|
-
// Plugin-level capabilities
|
|
43
|
-
capabilities: {
|
|
44
|
-
supportsStreaming: true,
|
|
45
|
-
supportsHotReload: true,
|
|
46
|
-
supportsAsync: true,
|
|
47
|
-
supportsBatching: false,
|
|
48
|
-
supportsDistributed: true
|
|
49
|
-
},
|
|
50
|
-
// Permissions (what the host must allow)
|
|
51
|
-
permissions: ['network'],
|
|
52
|
-
// Configuration schema (what the operator configures for this plugin)
|
|
53
|
-
configSchema: {
|
|
54
|
-
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
55
|
-
type: 'object',
|
|
56
|
-
title: 'Ollama Provider Configuration',
|
|
57
|
-
description: 'Configuration for the @holokai/provider-ollama plugin. Used by Holokai to connect to a local or remote Ollama instance.',
|
|
58
|
-
properties: {
|
|
59
|
-
baseUrl: {
|
|
60
|
-
type: 'string',
|
|
61
|
-
description: 'Base URL for the Ollama instance (e.g., "http://localhost:11434").',
|
|
62
|
-
format: 'uri',
|
|
63
|
-
default: 'http://localhost:11434'
|
|
64
|
-
},
|
|
65
|
-
defaultModel: {
|
|
66
|
-
type: 'string',
|
|
67
|
-
description: 'Default Ollama model to use when no model is specified in the HoloRequest (e.g., "llama2", "mistral").'
|
|
68
|
-
},
|
|
69
|
-
allowedModels: {
|
|
70
|
-
type: 'array',
|
|
71
|
-
description: 'Optional allowlist of Ollama model names that this plugin may use. If set, all requests will be validated against this list.',
|
|
72
|
-
items: {
|
|
73
|
-
type: 'string'
|
|
74
|
-
},
|
|
75
|
-
uniqueItems: true
|
|
76
|
-
},
|
|
77
|
-
timeoutMs: {
|
|
78
|
-
type: 'integer',
|
|
79
|
-
description: 'Default request timeout in milliseconds for Ollama calls.',
|
|
80
|
-
minimum: 1000,
|
|
81
|
-
maximum: 600000,
|
|
82
|
-
default: 120000
|
|
83
|
-
},
|
|
84
|
-
maxRetries: {
|
|
85
|
-
type: 'integer',
|
|
86
|
-
description: 'Maximum number of retry attempts for transient Ollama errors.',
|
|
87
|
-
minimum: 0,
|
|
88
|
-
maximum: 10,
|
|
89
|
-
default: 2
|
|
90
|
-
},
|
|
91
|
-
logRequests: {
|
|
92
|
-
type: 'boolean',
|
|
93
|
-
description: 'If true, log summarized request/response metadata for observability.',
|
|
94
|
-
default: false
|
|
95
|
-
},
|
|
96
|
-
telemetrySampleRate: {
|
|
97
|
-
type: 'number',
|
|
98
|
-
description: 'Sampling rate (0.0–1.0) for sending telemetry events related to this provider.',
|
|
99
|
-
minimum: 0,
|
|
100
|
-
maximum: 1,
|
|
101
|
-
default: 1
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
required: ['baseUrl'],
|
|
105
|
-
additionalProperties: false
|
|
106
|
-
},
|
|
107
|
-
// Marketplace metadata
|
|
108
|
-
category: 'ai-providers',
|
|
109
|
-
screenshots: [
|
|
110
|
-
'https://holok.ai/assets/screenshots/provider-ollama-1.png'
|
|
111
|
-
],
|
|
112
|
-
changelog: 'https://holok.ai/docs/providers/ollama/changelog',
|
|
113
|
-
pricing: {
|
|
114
|
-
model: 'free',
|
|
115
|
-
price: 0,
|
|
116
|
-
currency: 'USD',
|
|
117
|
-
billingPeriod: 'one-time'
|
|
118
|
-
},
|
|
119
|
-
support: {
|
|
120
|
-
email: 'support@holok.ai',
|
|
121
|
-
documentation: 'https://holok.ai/docs/providers/ollama'
|
|
122
|
-
},
|
|
123
|
-
// Upgrade semantics
|
|
124
|
-
upgradeFrom: '>=1.0.0',
|
|
125
|
-
// Entrypoints
|
|
126
|
-
main: 'dist/index.js',
|
|
127
|
-
types: 'dist/index.d.ts',
|
|
128
|
-
// Custom metadata for host/runtime
|
|
129
|
-
custom: {
|
|
130
|
-
// Used by the host/plugin loader to auto-wire this plugin
|
|
131
|
-
providerKind: 'ollama',
|
|
132
|
-
// Hints for the host UI
|
|
133
|
-
recommendedDefaultModel: 'llama2'
|
|
134
|
-
}
|
|
5
|
+
family: 'ollama',
|
|
6
|
+
displayName: 'Ollama Provider',
|
|
7
|
+
description: 'Ollama provider plugin for Holo.',
|
|
135
8
|
};
|
|
136
9
|
//# sourceMappingURL=manifest.js.map
|
package/dist/manifest.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAwB;IACzC,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,UAAU;IACtB,MAAM,EAAE,QAAQ;IAChB,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,kCAAkC;CAClD,CAAC"}
|
package/dist/ollama.auditor.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { BaseAuditor
|
|
1
|
+
import { BaseAuditor } from "@holokai/sdk/provider";
|
|
2
|
+
import type { HoloWorkerRequest } from "@holokai/types/worker";
|
|
3
|
+
import type { ProviderEnvelope, ProviderEvent } from "@holokai/types/provider";
|
|
4
|
+
import type { LlmRequest } from "@holokai/types/entities";
|
|
2
5
|
import { ChatRequest, GenerateRequest } from "ollama";
|
|
3
|
-
import { LlmRequest } from "@holokai/sdk/core/entities";
|
|
4
6
|
export declare class OllamaAuditor extends BaseAuditor {
|
|
5
7
|
readonly provider = "ollama";
|
|
6
8
|
protected toHoloRequest(workerRequest: HoloWorkerRequest, llmRequest: Omit<LlmRequest, 'id'>): void;
|
|
@@ -14,6 +16,7 @@ export declare class OllamaAuditor extends BaseAuditor {
|
|
|
14
16
|
time_to_first_token: any;
|
|
15
17
|
total_processing_time: any;
|
|
16
18
|
}>>;
|
|
19
|
+
protected createProviderEnvelope(payload: GenerateRequest | ChatRequest): Promise<ProviderEnvelope>;
|
|
17
20
|
private extractUserPromptFromMessages;
|
|
18
21
|
private extractSystemPromptFromMessages;
|
|
19
22
|
/**
|
|
@@ -24,6 +27,5 @@ export declare class OllamaAuditor extends BaseAuditor {
|
|
|
24
27
|
* @returns Time to first token in milliseconds, or undefined if timing data is unavailable
|
|
25
28
|
*/
|
|
26
29
|
private calculateTimeToFirstToken;
|
|
27
|
-
protected createProviderEnvelope(payload: GenerateRequest | ChatRequest): Promise<ProviderEnvelope>;
|
|
28
30
|
}
|
|
29
31
|
//# sourceMappingURL=ollama.auditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ollama.auditor.d.ts","sourceRoot":"","sources":["../src/ollama.auditor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"ollama.auditor.d.ts","sourceRoot":"","sources":["../src/ollama.auditor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,uBAAuB,CAAC;AAGlD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAC,gBAAgB,EAAE,aAAa,EAAC,MAAM,yBAAyB,CAAC;AAC7E,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAC,WAAW,EAAgB,eAAe,EAAmB,MAAM,QAAQ,CAAC;AAEpF,qBACa,aAAc,SAAQ,WAAW;IAC1C,QAAQ,CAAC,QAAQ,YAAY;IAE7B,SAAS,CAAC,aAAa,CAAC,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,IAAI;IA4BnG,SAAS,CAAC,kBAAkB,CAAC,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,IAAI;cAQxF,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,aAAa,EAAE;QAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;;;;;;;cAoBpF,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAMzG,OAAO,CAAC,6BAA6B;IAWrC,OAAO,CAAC,+BAA+B;IAOvC;;;;;;OAMG;IACH,OAAO,CAAC,yBAAyB;CAWpC"}
|
package/dist/ollama.auditor.js
CHANGED
|
@@ -5,7 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { injectable } from 'tsyringe';
|
|
8
|
-
import { BaseAuditor
|
|
8
|
+
import { BaseAuditor } from "@holokai/sdk/provider";
|
|
9
|
+
import { pickDefined } from "@holokai/sdk";
|
|
10
|
+
import { RequestType } from "@holokai/types/holo";
|
|
9
11
|
let OllamaAuditor = class OllamaAuditor extends BaseAuditor {
|
|
10
12
|
provider = 'ollama';
|
|
11
13
|
toHoloRequest(workerRequest, llmRequest) {
|
|
@@ -58,6 +60,11 @@ let OllamaAuditor = class OllamaAuditor extends BaseAuditor {
|
|
|
58
60
|
...usage
|
|
59
61
|
});
|
|
60
62
|
}
|
|
63
|
+
async createProviderEnvelope(payload) {
|
|
64
|
+
return pickDefined({
|
|
65
|
+
model_slug: payload.model
|
|
66
|
+
});
|
|
67
|
+
}
|
|
61
68
|
extractUserPromptFromMessages(messages) {
|
|
62
69
|
if (!messages || !Array.isArray(messages))
|
|
63
70
|
return undefined;
|
|
@@ -91,11 +98,6 @@ let OllamaAuditor = class OllamaAuditor extends BaseAuditor {
|
|
|
91
98
|
}
|
|
92
99
|
return undefined;
|
|
93
100
|
}
|
|
94
|
-
async createProviderEnvelope(payload) {
|
|
95
|
-
return pickDefined({
|
|
96
|
-
model_slug: payload.model
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
101
|
};
|
|
100
102
|
OllamaAuditor = __decorate([
|
|
101
103
|
injectable()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ollama.auditor.js","sourceRoot":"","sources":["../src/ollama.auditor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEpC,OAAO,EAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"ollama.auditor.js","sourceRoot":"","sources":["../src/ollama.auditor.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
import { ChatRequest, ErrorResponse, GenerateRequest, ListResponse, Ollama } from 'ollama';
|
|
2
|
-
import { BaseProvider
|
|
1
|
+
import { ChatRequest, EmbedRequest, ErrorResponse, GenerateRequest, ListResponse, Ollama } from 'ollama';
|
|
2
|
+
import { BaseProvider } from '@holokai/sdk/provider';
|
|
3
|
+
import type { IAuditor, IProviderTranslator, IResponseFactory, ProviderContext, RunHandle } from '@holokai/types/provider';
|
|
3
4
|
export declare class OllamaProvider extends BaseProvider<Ollama, GenerateRequest | ChatRequest> {
|
|
5
|
+
getModelNameFromRequest(payload: GenerateRequest | ChatRequest): Promise<string>;
|
|
6
|
+
getModels(allowedModels: string[] | true): Promise<ListResponse>;
|
|
7
|
+
ollamaEmbed(payload: EmbedRequest, _ctx: ProviderContext): Promise<{
|
|
8
|
+
final: () => Promise<import("ollama").EmbedResponse>;
|
|
9
|
+
}>;
|
|
4
10
|
protected createAuditor(): IAuditor;
|
|
5
11
|
protected createClient(): Ollama;
|
|
6
12
|
protected createTranslator(): IProviderTranslator;
|
|
7
13
|
protected createResponseFactory(): IResponseFactory;
|
|
8
|
-
getModels(allowedModels: string[] | true): Promise<ListResponse>;
|
|
9
14
|
protected handleError(error: Error): Promise<ErrorResponse>;
|
|
10
|
-
protected handleRequest(payload: GenerateRequest | ChatRequest, ctx: ProviderContext): Promise<RunHandle<any>>;
|
|
15
|
+
protected handleRequest(payload: GenerateRequest | ChatRequest | EmbedRequest, ctx: ProviderContext): Promise<RunHandle<any>>;
|
|
11
16
|
private ollamaGenerate;
|
|
12
17
|
private ollamaChat;
|
|
13
18
|
}
|