@teamflojo/floimg-ollama 0.2.1 → 0.2.2

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 (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +39 -17
  3. package/package.json +12 -13
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Flojo, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  Local AI provider for floimg using [Ollama](https://ollama.ai). Run vision and text models locally with no API key required.
4
4
 
5
+ ## Standing on the Shoulders of Giants
6
+
7
+ This plugin integrates with [Ollama](https://ollama.ai/), the amazing local AI runtime. We provide a consistent FloImg interface while exposing the full power of Ollama's models.
8
+
9
+ - **Full Ollama power**: All models and configuration options work
10
+ - **Native format**: Use Ollama model names and options directly
11
+ - **Their docs are your docs**: See [Ollama documentation](https://ollama.ai/)
12
+
13
+ FloImg orchestrates the workflow (generate → transform → save). Ollama does what it does best.
14
+
5
15
  ## Features
6
16
 
7
17
  - **Vision Analysis** - Analyze images with LLaVA or other vision models
@@ -44,8 +54,8 @@ const result = await client.analyzeImage({
44
54
  blob: imageBlob,
45
55
  params: {
46
56
  prompt: "What objects are in this image?",
47
- outputFormat: "json"
48
- }
57
+ outputFormat: "json",
58
+ },
49
59
  });
50
60
 
51
61
  console.log(result.content);
@@ -64,8 +74,8 @@ const result = await client.generateText({
64
74
  provider: "ollama-text",
65
75
  params: {
66
76
  prompt: "Write a creative caption for a sunset photo",
67
- temperature: 0.8
68
- }
77
+ temperature: 0.8,
78
+ },
69
79
  });
70
80
 
71
81
  console.log(result.content);
@@ -81,7 +91,7 @@ const client = createClient();
81
91
  const [vision, text] = ollama({
82
92
  baseUrl: "http://localhost:11434",
83
93
  visionModel: "llava",
84
- textModel: "llama3.2"
94
+ textModel: "llama3.2",
85
95
  });
86
96
 
87
97
  client.registerVisionProvider(vision);
@@ -95,11 +105,21 @@ await client.run({
95
105
  name: "local-image-analysis",
96
106
  steps: [
97
107
  { kind: "generate", generator: "qr", params: { text: "hello" }, out: "qr" },
98
- { kind: "vision", in: "qr", provider: "ollama-vision",
99
- params: { prompt: "What does this QR code contain?" }, out: "analysis" },
100
- { kind: "text", in: "analysis", provider: "ollama-text",
101
- params: { prompt: "Summarize this in one sentence" }, out: "summary" }
102
- ]
108
+ {
109
+ kind: "vision",
110
+ in: "qr",
111
+ provider: "ollama-vision",
112
+ params: { prompt: "What does this QR code contain?" },
113
+ out: "analysis",
114
+ },
115
+ {
116
+ kind: "text",
117
+ in: "analysis",
118
+ provider: "ollama-text",
119
+ params: { prompt: "Summarize this in one sentence" },
120
+ out: "summary",
121
+ },
122
+ ],
103
123
  });
104
124
  ```
105
125
 
@@ -107,26 +127,28 @@ await client.run({
107
127
 
108
128
  ### Vision Provider
109
129
 
110
- | Option | Default | Description |
111
- |--------|---------|-------------|
112
- | `baseUrl` | `http://localhost:11434` | Ollama server URL |
113
- | `model` | `llava` | Vision model to use |
130
+ | Option | Default | Description |
131
+ | --------- | ------------------------ | ------------------- |
132
+ | `baseUrl` | `http://localhost:11434` | Ollama server URL |
133
+ | `model` | `llava` | Vision model to use |
114
134
 
115
135
  ### Text Provider
116
136
 
117
- | Option | Default | Description |
118
- |--------|---------|-------------|
137
+ | Option | Default | Description |
138
+ | --------- | ------------------------ | ----------------- |
119
139
  | `baseUrl` | `http://localhost:11434` | Ollama server URL |
120
- | `model` | `llama3.2` | Text model to use |
140
+ | `model` | `llama3.2` | Text model to use |
121
141
 
122
142
  ## Supported Models
123
143
 
124
144
  ### Vision Models
145
+
125
146
  - `llava` - LLaVA (default)
126
147
  - `llava:13b` - LLaVA 13B
127
148
  - `bakllava` - BakLLaVA
128
149
 
129
150
  ### Text Models
151
+
130
152
  - `llama3.2` - Llama 3.2 (default)
131
153
  - `llama3.1` - Llama 3.1
132
154
  - `mistral` - Mistral 7B
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamflojo/floimg-ollama",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Ollama local AI provider for floimg - vision and text generation with local models",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -16,14 +16,6 @@
16
16
  "README.md",
17
17
  "LICENSE"
18
18
  ],
19
- "scripts": {
20
- "build": "tsc",
21
- "dev": "tsc --watch",
22
- "test": "vitest",
23
- "typecheck": "tsc --noEmit",
24
- "clean": "rm -rf dist",
25
- "prepublishOnly": "npm run build"
26
- },
27
19
  "keywords": [
28
20
  "floimg",
29
21
  "ollama",
@@ -42,18 +34,25 @@
42
34
  "directory": "packages/floimg-ollama"
43
35
  },
44
36
  "peerDependencies": {
45
- "@teamflojo/floimg": "^0.2.0"
37
+ "@teamflojo/floimg": "^0.8.0"
46
38
  },
47
39
  "dependencies": {
48
40
  "ollama": "^0.5.11"
49
41
  },
50
42
  "devDependencies": {
51
43
  "@types/node": "^22.10.2",
52
- "@teamflojo/floimg": "workspace:*",
53
44
  "typescript": "^5.7.2",
54
- "vitest": "^2.1.8"
45
+ "vitest": "^2.1.8",
46
+ "@teamflojo/floimg": "0.9.0"
55
47
  },
56
48
  "engines": {
57
49
  "node": ">=18.0.0"
50
+ },
51
+ "scripts": {
52
+ "build": "tsc",
53
+ "dev": "tsc --watch",
54
+ "typecheck": "tsc --noEmit",
55
+ "clean": "rm -rf dist",
56
+ "test": "vitest --run"
58
57
  }
59
- }
58
+ }