termux-vision 1.4.1 → 1.4.3

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 CHANGED
@@ -60,8 +60,8 @@ pkg install -y python nodejs clang make cmake git termux-api wget vulkan-loader
60
60
 
61
61
  * **Option B: Direct GitHub Releases Wheel Asset (SSOT Verified)**:
62
62
  ```bash
63
- # Download and install the prebuilt v1.4.1 release wheel
64
- pip install https://github.com/uno-km/termux-vision/releases/download/v1.4.1/termux_vision-1.4.1-py3-none-any.whl
63
+ # Download and install the prebuilt v1.4.0 release wheel
64
+ pip install https://github.com/uno-km/termux-vision/releases/download/v1.4.0/termux_vision-1.4.0-py3-none-any.whl
65
65
  ```
66
66
 
67
67
  ### 2.3 Node.js / TypeScript CLI Installation
package/README.pypi.md CHANGED
@@ -31,7 +31,7 @@ pip install termux-vision
31
31
 
32
32
  ### 2.2 Direct GitHub Releases Wheel Asset
33
33
  ```bash
34
- pip install https://github.com/uno-km/termux-vision/releases/download/v1.4.1/termux_vision-1.4.1-py3-none-any.whl
34
+ pip install https://github.com/uno-km/termux-vision/releases/download/v1.4.0/termux_vision-1.4.0-py3-none-any.whl
35
35
  ```
36
36
 
37
37
  ### 2.3 One-Line Bootstrap Installer
package/lib/cache.js CHANGED
@@ -24,7 +24,7 @@ const CATALOG = {
24
24
  adapter: 'smolvlm',
25
25
  tier: 'M',
26
26
  estimatedMemoryMb: 750,
27
- contextLimit: 1024,
27
+ contextLimit: 2048,
28
28
  preferredResolution: 384,
29
29
  artifacts: [
30
30
  {
@@ -174,7 +174,7 @@ class ModelCacheManager {
174
174
  modelId: path.parse(filename).name,
175
175
  adapter: /smol/i.test(filename) ? 'smolvlm' : 'qwen2vl',
176
176
  tier: 'CUSTOM',
177
- contextLimit: 1024
177
+ contextLimit: 2048
178
178
  },
179
179
  textModelPath: expanded,
180
180
  visionModelPath: visionPath
@@ -234,7 +234,7 @@ class ModelCacheManager {
234
234
  modelId: modelId,
235
235
  adapter: /smol/i.test(modelId) ? 'smolvlm' : 'qwen2vl',
236
236
  tier: 'CUSTOM',
237
- contextLimit: 1024
237
+ contextLimit: 2048
238
238
  },
239
239
  textModelPath: textPath,
240
240
  visionModelPath: visionPath
package/lib/errors.js CHANGED
@@ -86,9 +86,11 @@ class RuntimeNotFoundError extends TermuxVisionError {
86
86
  searched = '\n\nSearched paths:\n' + searchedPaths.map(p => ` - ${p}`).join('\n');
87
87
  }
88
88
  const msg =
89
- `Required runtime 'llama-cli' was not found.${searched}\n\n` +
90
- `Please ensure llama.cpp is installed on Termux:\n` +
91
- ` pkg install termux-llamacpp (or place llama-cli in PATH / $PREFIX/bin)`;
89
+ `Required runtime engine 'llama-cli' was not found.${searched}\n\n` +
90
+ `Please install the official termux-llamacpp native runtime:\n` +
91
+ ` - Python: pip install termux-llamacpp\n` +
92
+ ` - Node.js: npm install -g termux-llamacpp\n` +
93
+ ` - Setup: termux-llama install (compiles native binary if needed)`;
92
94
  super(msg);
93
95
  this.searchedPaths = searchedPaths;
94
96
  }
package/lib/vlm.js CHANGED
@@ -284,17 +284,28 @@ class NodeVLMContext {
284
284
 
285
285
  async function load(options = {}) {
286
286
  const cache = new ModelCacheManager(options.cacheRoot || null);
287
- const modelId = options.modelId || 'smolvlm-500m-q4';
288
287
 
289
- if (!modelId || !String(modelId).trim()) {
290
- throw new Error("Parameter 'modelId' cannot be null or empty.");
288
+ if (options.modelId && options.modelPath) {
289
+ throw new Error("Cannot specify both 'modelId' and 'modelPath'. Use 'modelId' for catalog presets or 'modelPath' for explicit .gguf file paths.");
291
290
  }
292
291
 
293
- if (options.allowDownload && !cache.isModelInstalled(modelId)) {
294
- await cache.install(modelId);
292
+ let modelInfo;
293
+ if (options.modelPath) {
294
+ const expanded = path.resolve(options.modelPath.replace(/^~(?=$|\/|\\)/, os.homedir()));
295
+ if (!fs.existsSync(expanded) || !fs.statSync(expanded).isFile()) {
296
+ throw new Error(`Model file not found at 'modelPath': ${options.modelPath}`);
297
+ }
298
+ modelInfo = cache.requireInstalledModel(expanded, options.mmprojPath || null);
299
+ } else {
300
+ const modelId = options.modelId || 'smolvlm-500m-q4';
301
+ if (!modelId || !String(modelId).trim()) {
302
+ throw new Error("Parameter 'modelId' cannot be null or empty.");
303
+ }
304
+ if (options.allowDownload && !cache.isModelInstalled(modelId)) {
305
+ await cache.install(modelId);
306
+ }
307
+ modelInfo = cache.requireInstalledModel(modelId, options.mmprojPath || null);
295
308
  }
296
-
297
- const modelInfo = cache.requireInstalledModel(modelId, options.mmprojPath || null);
298
309
  const executable = resolveLlamaCli(options.runtimePath || null);
299
310
 
300
311
  const reqDevice = (options.device || 'auto').toLowerCase().trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termux-vision",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "On-device computer vision & VLM multimodal inference framework utilizing device resources for Android Termux & ARM64",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",