@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.
Files changed (64) hide show
  1. package/README.md +116 -93
  2. package/dist/manifest.d.ts +2 -2
  3. package/dist/manifest.d.ts.map +1 -1
  4. package/dist/manifest.js +3 -130
  5. package/dist/manifest.js.map +1 -1
  6. package/dist/ollama.auditor.d.ts +5 -3
  7. package/dist/ollama.auditor.d.ts.map +1 -1
  8. package/dist/ollama.auditor.js +8 -6
  9. package/dist/ollama.auditor.js.map +1 -1
  10. package/dist/ollama.provider.d.ts +9 -4
  11. package/dist/ollama.provider.d.ts.map +1 -1
  12. package/dist/ollama.provider.js +51 -14
  13. package/dist/ollama.provider.js.map +1 -1
  14. package/dist/ollama.response.factory.d.ts +2 -2
  15. package/dist/ollama.response.factory.d.ts.map +1 -1
  16. package/dist/ollama.response.factory.js +3 -3
  17. package/dist/ollama.response.factory.js.map +1 -1
  18. package/dist/ollama.translator.d.ts +2 -1
  19. package/dist/ollama.translator.d.ts.map +1 -1
  20. package/dist/ollama.translator.js +1 -1
  21. package/dist/ollama.translator.js.map +1 -1
  22. package/dist/ollama.wire.adapter.d.ts +2 -2
  23. package/dist/ollama.wire.adapter.d.ts.map +1 -1
  24. package/dist/ollama.wire.adapter.js +4 -4
  25. package/dist/ollama.wire.adapter.js.map +1 -1
  26. package/dist/plugin.d.ts +8 -6
  27. package/dist/plugin.d.ts.map +1 -1
  28. package/dist/plugin.js +12 -5
  29. package/dist/plugin.js.map +1 -1
  30. package/dist/translators/ollama.chat.request.translator.d.ts +1 -1
  31. package/dist/translators/ollama.chat.request.translator.d.ts.map +1 -1
  32. package/dist/translators/ollama.chat.request.translator.js.map +1 -1
  33. package/dist/translators/ollama.chat.response.translator.d.ts +1 -1
  34. package/dist/translators/ollama.chat.response.translator.d.ts.map +1 -1
  35. package/dist/translators/ollama.chat.response.translator.js.map +1 -1
  36. package/dist/translators/ollama.generate.request.translator.d.ts +1 -1
  37. package/dist/translators/ollama.generate.request.translator.d.ts.map +1 -1
  38. package/dist/translators/ollama.generate.request.translator.js.map +1 -1
  39. package/dist/translators/ollama.generate.response.translator.d.ts +1 -1
  40. package/dist/translators/ollama.generate.response.translator.d.ts.map +1 -1
  41. package/dist/translators/ollama.generate.response.translator.js.map +1 -1
  42. package/dist/translators/ollama.message.translators.d.ts +1 -1
  43. package/dist/translators/ollama.message.translators.d.ts.map +1 -1
  44. package/dist/translators/ollama.message.translators.js.map +1 -1
  45. package/dist/translators/ollama.options.translators.d.ts +2 -1
  46. package/dist/translators/ollama.options.translators.d.ts.map +1 -1
  47. package/dist/translators/ollama.options.translators.js +2 -1
  48. package/dist/translators/ollama.options.translators.js.map +1 -1
  49. package/dist/translators/ollama.tool.translators.d.ts +2 -1
  50. package/dist/translators/ollama.tool.translators.d.ts.map +1 -1
  51. package/dist/translators/ollama.tool.translators.js +2 -1
  52. package/dist/translators/ollama.tool.translators.js.map +1 -1
  53. package/dist/translators/streaming/ollama.content.delta.translator.d.ts +1 -1
  54. package/dist/translators/streaming/ollama.content.delta.translator.d.ts.map +1 -1
  55. package/dist/translators/streaming/ollama.content.delta.translator.js.map +1 -1
  56. package/dist/translators/streaming/ollama.message.delta.translator.d.ts +1 -1
  57. package/dist/translators/streaming/ollama.message.delta.translator.d.ts.map +1 -1
  58. package/dist/translators/streaming/ollama.message.delta.translator.js.map +1 -1
  59. package/dist/translators/streaming/ollama.message.stop.translator.d.ts +1 -1
  60. package/dist/translators/streaming/ollama.message.stop.translator.d.ts.map +1 -1
  61. package/dist/translators/streaming/ollama.message.stop.translator.js.map +1 -1
  62. package/dist/translators/streaming/ollama.stream.translator.d.ts +1 -1
  63. package/dist/translators/streaming/ollama.stream.translator.d.ts.map +1 -1
  64. 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 format. This plugin is part of the migration from the monolithic provider architecture to a plugin-based system, providing complete bidirectional translation between Ollama's native API and the portable Holo format.
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 manual registration required.
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 a standalone, independently versioned package.
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 | Ollama Field | Transformation | Notes |
209
- |------------|-------------|----------------|-------|
210
- | **Direct 1:1** ||||
211
- | `model` | `model` | Direct | Required |
212
- | `stream` | `stream` | Direct | Optional |
213
- | **Structure Transforms** ||||
214
- | `system` (Chat) | First message with `role:'system'` | Inject as message | Optional |
215
- | `system` (Generate) | `system` | Top-level field | Optional |
216
- | `messages` (Chat) | `messages` | Flatten to text + extract images | Required |
217
- | `messages` (Generate) | `prompt` | Extract from single user message | Converted to string |
218
- | `temperature` | `options.temperature` | Nest in options | Optional |
219
- | `top_p` | `options.top_p` | Nest in options | Optional |
220
- | `top_k` | `options.top_k` | Nest in options | Optional |
221
- | `max_tokens` | `options.num_predict` | Nest + rename | Optional |
222
- | `stop_sequences` | `options.stop` | Nest in options | Array format |
223
- | `frequency_penalty` | `options.frequency_penalty` | Nest in options | Optional |
224
- | `presence_penalty` | `options.presence_penalty` | Nest in options | Optional |
225
- | `seed` | `options.seed` | Nest in options | Optional |
226
- | `response_format.type: 'json_object'` | `format: "json"` | Map to string | Optional |
227
- | `response_format.schema` | `format: {...}` | Pass schema object | Optional |
228
- | `tools` (Chat) | `tools` | Direct | Chat mode only |
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 | Holo Field | Transformation | Notes |
243
- |-------------|------------|----------------|-------|
244
- | **Direct 1:1** ||||
245
- | `model` | `model` | Direct | Always present |
246
- | `message.role` (Chat) | `messages[0].role` | Wrap in array | Always 'assistant' |
247
- | `message.content` (Chat) | `messages[0].content` | Direct | Text content |
248
- | `response` (Generate) | `messages[0].content` | Wrap in message | Text content |
249
- | `message.tool_calls` | `messages[0].tool_calls` | Direct | If present |
250
- | **Structure Transforms** ||||
251
- | N/A | `id` | Synthesize UUID | Ollama lacks ID |
252
- | `created_at` | `created` | Parse ISO8601 to ms | `Date.parse(created_at)` |
253
- | `done_reason: 'stop'` | `finish_reason: 'stop'` | Direct | Optional |
254
- | `done_reason: 'length'` | `finish_reason: 'length'` | Direct | Optional |
255
- | `done: true` with no `done_reason` | `finish_reason: 'stop'` | Default | Fallback behavior |
256
- | `prompt_eval_count` | `usage.input_tokens` | Rename | Optional |
257
- | `eval_count` | `usage.output_tokens` | Rename | Optional |
258
- | Computed | `usage.total_tokens` | `input + output` | Derived |
259
- | `total_duration` (ns) | `usage.timings.total` | Direct | Optional; nanoseconds |
260
- | `load_duration` (ns) | `usage.timings.load` | Direct | Optional; nanoseconds |
261
- | `prompt_eval_duration` (ns) | `usage.timings.prompt_eval` | Direct | Optional; nanoseconds |
262
- | `eval_duration` (ns) | `usage.timings.eval` | Direct | Optional; nanoseconds |
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` | Holo `finish_reason` | Notes |
277
- |---------------------|---------------------|-------|
278
- | `'stop'` | `'stop'` | Natural completion |
279
- | `'length'` | `'length'` | Hit token limit |
280
- | `null` or missing + `done: true` | `'stop'` | Default fallback |
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
- message: {
326
- role: 'assistant',
327
- content: '',
328
- tool_calls: [{
329
- id: 'call_abc',
330
- type: 'function',
331
- function: { name: 'get_weather', arguments: { location: 'SF' } }
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
- messages: [{
339
- role: 'assistant',
340
- content: '',
341
- tool_calls: [{
342
- id: 'call_abc',
343
- type: 'function',
344
- function: { name: 'get_weather', arguments: { location: 'SF' } }
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 | Chat Mode (`/api/chat`) | Generate Mode (`/api/generate`) |
361
- |---------|------------------------|--------------------------------|
362
- | **Endpoint** | `/api/chat` | `/api/generate` |
363
- | **Input** | `messages[]` array | `prompt` string |
364
- | **Conversation** | ✅ Multi-turn history | ❌ Single prompt only |
365
- | **System Prompt** | ✅ As first message | ✅ Top-level field |
366
- | **Tools** | ✅ Function calling | ❌ Not supported |
367
- | **Images** | ✅ Via `images[]` | ❌ Not supported |
368
- | **Context Continuation** | ❌ Use message history | ✅ Via `context` array |
369
- | **Use Case** | Interactive chat | Single completion |
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
- model: 'llama2',
379
- messages: [{ role: 'user', content: 'What is the weather?' }],
380
- tools: [{ name: 'get_weather', parameters: {...} }]
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
- model: 'llama2',
386
- messages: [{ role: 'user', content: 'Complete this sentence...' }]
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
- model: 'llama2',
392
- messages: [{ role: 'user', content: 'Complete: Once upon a time' }],
393
- provider_config: {
394
- mode: 'generate' // Force Generate endpoint
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 | Holo Event | Notes |
447
- |--------------|-----------|-------|
448
- | First frame (`done: false`) | `message_start` + `content_delta` | Synthesized by orchestrator |
449
- | Content frames (`done: false`) | `content_delta` | Incremental text |
450
- | Final frame (`done: true`) | `message_delta` + `message_stop` | Usage + completion |
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 chunks in a session.
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
@@ -1,3 +1,3 @@
1
- import { PluginManifest } from "@holokai/sdk";
2
- export declare const manifest: PluginManifest;
1
+ import type { IHoloPluginManifest } from "@holokai/types/plugin";
2
+ export declare const manifest: IHoloPluginManifest;
3
3
  //# sourceMappingURL=manifest.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,cAAc,CAAC;AAE5C,eAAO,MAAM,QAAQ,EAAE,cAyJtB,CAAC"}
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
- displayName: 'Ollama',
8
- description: 'First-party Ollama provider plugin for Holokai, providing local LLM support via the Holo universal format.',
9
- // Optional metadata
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
@@ -1 +1 @@
1
- {"version":3,"file":"manifest.js","sourceRoot":"","sources":["../src/manifest.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,QAAQ,GAAmB;IACpC,oBAAoB;IACpB,IAAI,EAAE,0BAA0B;IAChC,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,UAAU;IACtB,WAAW,EAAE,QAAQ;IACrB,WAAW,EAAE,4GAA4G;IAEzH,oBAAoB;IACpB,MAAM,EAAE;QACJ,IAAI,EAAE,cAAc;QACpB,GAAG,EAAE,kBAAkB;KAC1B;IACD,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,wCAAwC;IAClD,UAAU,EAAE;QACR,IAAI,EAAE,KAAK;QACX,GAAG,EAAE,oCAAoC;QACzC,SAAS,EAAE,0BAA0B;KACxC;IACD,IAAI,EAAE;QACF,GAAG,EAAE,2CAA2C;KACnD;IACD,QAAQ,EAAE;QACN,SAAS;QACT,MAAM;QACN,QAAQ;QACR,UAAU;QACV,KAAK;QACL,OAAO;QACP,kBAAkB;QAClB,WAAW;KACd;IAED,mCAAmC;IACnC,aAAa,EAAE,gBAAgB;IAC/B,gBAAgB,EAAE;QACd,cAAc,EAAE,QAAQ;KAC3B;IACD,YAAY,EAAE;QACV,MAAM,EAAE,QAAQ;KACnB;IAED,4BAA4B;IAC5B,YAAY,EAAE;QACV,iBAAiB,EAAE,IAAI;QACvB,iBAAiB,EAAE,IAAI;QACvB,aAAa,EAAE,IAAI;QACnB,gBAAgB,EAAE,KAAK;QACvB,mBAAmB,EAAE,IAAI;KAC5B;IAED,yCAAyC;IACzC,WAAW,EAAE,CAAC,SAAS,CAAC;IAExB,sEAAsE;IACtE,YAAY,EAAE;QACV,OAAO,EAAE,yCAAyC;QAClD,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,+BAA+B;QACtC,WAAW,EAC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ACL,KAAK,EAAE,kBAAkB;QACzB,aAAa,EAAE,wCAAwC;KAC1D;IAED,oBAAoB;IACpB,WAAW,EAAE,SAAS;IAEtB,cAAc;IACd,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,iBAAiB;IAExB,mCAAmC;IACnC,MAAM,EAAE;QACJ,0DAA0D;QAC1D,YAAY,EAAE,QAAQ;QACtB,wBAAwB;QACxB,uBAAuB,EAAE,QAAQ;KACpC;CACJ,CAAC"}
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"}
@@ -1,6 +1,8 @@
1
- import { BaseAuditor, HoloWorkerRequest, ProviderEnvelope, ProviderEvent } from "@holokai/sdk";
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,EAAE,iBAAiB,EAAe,gBAAgB,EAAE,aAAa,EAAc,MAAM,cAAc,CAAC;AACvH,OAAO,EAAC,WAAW,EAAgB,eAAe,EAAmB,MAAM,QAAQ,CAAC;AACpF,OAAO,EAAC,UAAU,EAAC,MAAM,4BAA4B,CAAC;AAEtD,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;;;;;;;IAoBpG,OAAO,CAAC,6BAA6B;IAWrC,OAAO,CAAC,+BAA+B;IAOvC;;;;;;OAMG;IACH,OAAO,CAAC,yBAAyB;cAYjB,sBAAsB,CAAC,OAAO,EAAE,eAAe,GAAG,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAK5G"}
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"}
@@ -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, pickDefined, RequestType } from "@holokai/sdk";
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,EAAqB,WAAW,EAAmC,WAAW,EAAC,MAAM,cAAc,CAAC;AAKhH,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,WAAW;IACjC,QAAQ,GAAG,QAAQ,CAAC;IAEnB,aAAa,CAAC,aAAgC,EAAE,UAAkC;QACxF,MAAM,OAAO,GAAG,aAAa,CAAC,OAAoD,CAAC;QAEnF,YAAY;QACZ,UAAU,CAAC,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC;QAEtC,mDAAmD;QACnD,IAAI,aAAa,CAAC,IAAI,KAAK,WAAW,CAAC,IAAI,EAAE,CAAC;YAC1C,MAAM,WAAW,GAAG,OAA4B,CAAC;YACjD,MAAM,UAAU,GAAG,IAAI,CAAC,6BAA6B,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAC5E,MAAM,YAAY,GAAG,IAAI,CAAC,+BAA+B,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;YAChF,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;gBAC3B,UAAU,C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C;QAE5D,MAAM,aAAa,GAAG,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC;QAClE,OAAO,aAAa,IAAI,OAAO,aAAa,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1G,CAAC;IAED;;;;;;OAMG;IACK,yBAAyB,CAAC,OAAY;QAC1C,MAAM,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;QAC3C,MAAM,kBAAkB,GAAG,OAAO,CAAC,oBAAoB,CAAC;QAExD,IAAI,YAAY,KAAK,SAAS,IAAI,kBAAkB,KAAK,SAAS,EAAE,CAAC;YACjE,4DAA4D;YAC5D,MAAM,kBAAkB,GAAG,YAAY,GAAG,kBAAkB,CAAC;YAC7D,OAAO,IAAI,CAAC,KAAK,CAAC,kBAAkB,GAAG,OAAO,CAAC,CAAC;QACpD,CAAC;QACD,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ,CAAA;AArGY,aAAa;IADzB,UAAU,EAAE;GACA,aAAa,CAqGzB"}
@@ -1,13 +1,18 @@
1
- import { ChatRequest, ErrorResponse, GenerateRequest, ListResponse, Ollama } from 'ollama';
2
- import { BaseProvider, IAuditor, IProviderTranslator, IResponseFactory, ProviderContext, RunHandle } from '@holokai/sdk';
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
  }