@phamkhachoabk/dsh-local-vision-describe 0.1.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 +69 -0
- package/cordis.patch.yml +20 -0
- package/package.json +31 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Local Vision Describe
|
|
2
|
+
|
|
3
|
+
Tell a text-only model what an image *shows*, not just what it *says*.
|
|
4
|
+
|
|
5
|
+
[Local Vision](../local-vision) reads the text in an attached image. That is
|
|
6
|
+
the whole answer for a document or a code screenshot, and no answer at all for
|
|
7
|
+
a diagram, a chart, a UI mockup, or a photo — OCR returns nothing and the model
|
|
8
|
+
is left to assume the image was empty.
|
|
9
|
+
|
|
10
|
+
This bundle adds the other half: a vision-language model running on your own
|
|
11
|
+
machine describes each image, and that description is added to the conversation
|
|
12
|
+
beside the recognized text. **The image itself is still never sent to the
|
|
13
|
+
model.**
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
dsh plugin --profile web add @phamkhachoabk/dsh-local-vision-describe
|
|
19
|
+
python3 -m pip install mlx-vlm
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The first command pulls in Local Vision itself, so it is the only plugin
|
|
23
|
+
command needed on a fresh machine. Restart the harness afterwards: bundle
|
|
24
|
+
layers are composed at boot.
|
|
25
|
+
|
|
26
|
+
The second is the part this bundle cannot do for you. MLX needs a Python
|
|
27
|
+
environment, and the checkpoint (about 2.5 GB) downloads itself on the plugin's
|
|
28
|
+
first start. Until both exist, the provider reports itself unusable and Local
|
|
29
|
+
Vision keeps working with OCR alone.
|
|
30
|
+
|
|
31
|
+
**Apple Silicon only** for now. MLX is built on Metal, so there is no Linux or
|
|
32
|
+
Intel build. The seam is a registry, so a provider for another platform is one
|
|
33
|
+
new package and one row in this bundle's patch — nothing else changes.
|
|
34
|
+
|
|
35
|
+
## What it costs
|
|
36
|
+
|
|
37
|
+
Seconds per new image, not milliseconds. Results are cached by attachment and
|
|
38
|
+
prompt, so an image already described in the conversation is free on every
|
|
39
|
+
later turn.
|
|
40
|
+
|
|
41
|
+
Turn it off without uninstalling with the `describeImages` setting under
|
|
42
|
+
`local-vision`; OCR then behaves exactly as before.
|
|
43
|
+
|
|
44
|
+
## What the model sees
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
<local-vision-ocr attachment="sha256:a1b2c3d4" engine="apple-vision-documents" confidence="0.94">
|
|
48
|
+
…recognized text…
|
|
49
|
+
</local-vision-ocr>
|
|
50
|
+
|
|
51
|
+
<local-vision-description attachment="sha256:a1b2c3d4" engine="mlx-vlm">
|
|
52
|
+
A dark terminal window with a red error banner across the top third…
|
|
53
|
+
</local-vision-description>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Two blocks, because they answer different questions and fail independently: an
|
|
57
|
+
image whose text could not be read can still be described, and the other way
|
|
58
|
+
round. Both are labelled as user-provided content rather than instructions.
|
|
59
|
+
|
|
60
|
+
## Packages
|
|
61
|
+
|
|
62
|
+
| Package | Role |
|
|
63
|
+
| --- | --- |
|
|
64
|
+
| `@phamkhachoabk/dsh-vision-describe` | Service Definition — `ctx.visionDescribe`, the engine contract, the ladder |
|
|
65
|
+
| `@phamkhachoabk/dsh-vision-describe-mlx` | Service Provider — a persistent MLX vision-language model |
|
|
66
|
+
| `@phamkhachoabk/dsh-local-vision-describe` | Bundle — the one name you install |
|
|
67
|
+
|
|
68
|
+
The consumer is Local Vision's own `local-vision-context` row, which reads
|
|
69
|
+
`ctx.visionDescribe` only when a provider is installed.
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# The Local Vision Describe bundle: the two rows that add whole-image
|
|
2
|
+
# understanding on top of the Local Vision bundle it depends on. Rows are
|
|
3
|
+
# addressed by id, so a profile's own cordis.patch.yml can reconfigure or
|
|
4
|
+
# disable either of them individually — disabling `vision-describe-mlx` alone
|
|
5
|
+
# keeps `ctx.visionDescribe` available for another provider to fill.
|
|
6
|
+
#
|
|
7
|
+
# The consumer row is not repeated here: `local-vision-context` comes from the
|
|
8
|
+
# Local Vision bundle, and reads `ctx.visionDescribe` only when it is present.
|
|
9
|
+
|
|
10
|
+
- insert:
|
|
11
|
+
# Service Definition: the ctx.visionDescribe registry, the engine contract,
|
|
12
|
+
# and the fallback ladder. Carries the prompt every request resolves through.
|
|
13
|
+
- id: vision-describe
|
|
14
|
+
name: '@phamkhachoabk/dsh-vision-describe'
|
|
15
|
+
|
|
16
|
+
# Service Provider: a vision-language model held in memory by MLX, on
|
|
17
|
+
# Apple Silicon. Needs python3 with mlx-vlm installed; the checkpoint
|
|
18
|
+
# downloads itself on first use.
|
|
19
|
+
- id: vision-describe-mlx
|
|
20
|
+
name: '@phamkhachoabk/dsh-vision-describe-mlx'
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@phamkhachoabk/dsh-local-vision-describe",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Local Vision image descriptions for DeepSeek Harness: a vision-language model on your own machine tells a text-only model what each image shows, beyond the text OCR can read",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
8
|
+
"./package.json": "./package.json"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"cordis.patch.yml",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"publishConfig": {
|
|
16
|
+
"access": "public"
|
|
17
|
+
},
|
|
18
|
+
"dsh": {
|
|
19
|
+
"bundle": {
|
|
20
|
+
"patch": "./cordis.patch.yml"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@phamkhachoabk/dsh-local-vision": "^0.3.0",
|
|
25
|
+
"@phamkhachoabk/dsh-vision-describe": "^0.1.0",
|
|
26
|
+
"@phamkhachoabk/dsh-vision-describe-mlx": "^0.1.0"
|
|
27
|
+
},
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"@deepseek-ai/cordis": "^4.0.2"
|
|
30
|
+
}
|
|
31
|
+
}
|