@oh-my-pi/snapcompact 17.2.7 → 17.2.9
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/dist/types/snapcompact.d.ts +6 -5
- package/package.json +5 -5
- package/src/snapcompact.ts +18 -12
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
* billing (32px × 1.2, 10k-patch budget at `detail: "original"`) is
|
|
32
32
|
* area-proportional, so resolution cannot improve chars/$ — 1568 stays.
|
|
33
33
|
* `detail: "high"` would downgrade (2,500-patch cap); `original` is sent.
|
|
34
|
-
* - **Unknown providers** default to
|
|
35
|
-
* still caps per-request
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* - **Unknown providers** default to `8on22-bw` with Anthropic-style
|
|
35
|
+
* visual-token area billing. `providerImageBudget` still caps per-request
|
|
36
|
+
* images per provider so inline imaging cannot flood a request with
|
|
37
|
+
* attachments, but the old OpenRouter-specific 8-image cap is gone; routers
|
|
38
|
+
* now use the same permissive budget as direct Anthropic/Claude lines unless
|
|
39
|
+
* configured otherwise upstream.
|
|
39
40
|
*
|
|
40
41
|
* The whole pass is local and deterministic — no LLM call, no API key, no
|
|
41
42
|
* latency beyond rendering. Rasterization and PNG encoding happen in native
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@oh-my-pi/snapcompact",
|
|
4
|
-
"version": "17.2.
|
|
4
|
+
"version": "17.2.9",
|
|
5
5
|
"description": "Bitmap-frame context compression for vision-capable LLMs",
|
|
6
6
|
"homepage": "https://omp.sh",
|
|
7
7
|
"author": "Can Boluk",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"fmt": "biome format --write ."
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@oh-my-pi/pi-ai": "17.2.
|
|
35
|
-
"@oh-my-pi/pi-natives": "17.2.
|
|
36
|
-
"@oh-my-pi/pi-utils": "17.2.
|
|
37
|
-
"@oh-my-pi/pi-wire": "17.2.
|
|
34
|
+
"@oh-my-pi/pi-ai": "17.2.9",
|
|
35
|
+
"@oh-my-pi/pi-natives": "17.2.9",
|
|
36
|
+
"@oh-my-pi/pi-utils": "17.2.9",
|
|
37
|
+
"@oh-my-pi/pi-wire": "17.2.9"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/bun": "^1.3.14"
|
package/src/snapcompact.ts
CHANGED
|
@@ -31,11 +31,12 @@
|
|
|
31
31
|
* billing (32px × 1.2, 10k-patch budget at `detail: "original"`) is
|
|
32
32
|
* area-proportional, so resolution cannot improve chars/$ — 1568 stays.
|
|
33
33
|
* `detail: "high"` would downgrade (2,500-patch cap); `original` is sent.
|
|
34
|
-
* - **Unknown providers** default to
|
|
35
|
-
* still caps per-request
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* - **Unknown providers** default to `8on22-bw` with Anthropic-style
|
|
35
|
+
* visual-token area billing. `providerImageBudget` still caps per-request
|
|
36
|
+
* images per provider so inline imaging cannot flood a request with
|
|
37
|
+
* attachments, but the old OpenRouter-specific 8-image cap is gone; routers
|
|
38
|
+
* now use the same permissive budget as direct Anthropic/Claude lines unless
|
|
39
|
+
* configured otherwise upstream.
|
|
39
40
|
*
|
|
40
41
|
* The whole pass is local and deterministic — no LLM call, no API key, no
|
|
41
42
|
* latency beyond rendering. Rasterization and PNG encoding happen in native
|
|
@@ -201,10 +202,13 @@ export function isShapeVariantName(value: unknown): value is ShapeVariantName {
|
|
|
201
202
|
}
|
|
202
203
|
|
|
203
204
|
/** Provider families with distinct image billing. */
|
|
204
|
-
type BillingFamily = "anthropic" | "google" | "openai";
|
|
205
|
+
type BillingFamily = "anthropic" | "google" | "openai" | "unknown";
|
|
205
206
|
|
|
206
207
|
function billingFamily(api?: Api): BillingFamily {
|
|
207
208
|
switch (api) {
|
|
209
|
+
case "anthropic-messages":
|
|
210
|
+
case "bedrock-converse-stream":
|
|
211
|
+
return "anthropic";
|
|
208
212
|
case "openai-completions":
|
|
209
213
|
case "openai-responses":
|
|
210
214
|
case "openai-codex-responses":
|
|
@@ -215,9 +219,8 @@ function billingFamily(api?: Api): BillingFamily {
|
|
|
215
219
|
case "google-vertex":
|
|
216
220
|
return "google";
|
|
217
221
|
default:
|
|
218
|
-
//
|
|
219
|
-
|
|
220
|
-
return "anthropic";
|
|
222
|
+
// Unknown APIs share Anthropic's pixel-area pricing as the safe ceiling.
|
|
223
|
+
return "unknown";
|
|
221
224
|
}
|
|
222
225
|
}
|
|
223
226
|
|
|
@@ -305,6 +308,7 @@ const FAMILY_VARIANT: Record<BillingFamily, ShapeVariantName> = {
|
|
|
305
308
|
anthropic: "11on16-bw",
|
|
306
309
|
google: "8on22-bw",
|
|
307
310
|
openai: "8on22-bw",
|
|
311
|
+
unknown: "8on22-bw",
|
|
308
312
|
};
|
|
309
313
|
|
|
310
314
|
/** Denser companion variant per family for the foveated archive middle: same
|
|
@@ -315,12 +319,14 @@ const FAMILY_VARIANT_LOW: Record<BillingFamily, ShapeVariantName> = {
|
|
|
315
319
|
anthropic: "8on16-bw",
|
|
316
320
|
google: "8on16-bw",
|
|
317
321
|
openai: "8on16-bw",
|
|
322
|
+
unknown: "8on16-bw",
|
|
318
323
|
};
|
|
319
324
|
|
|
320
325
|
const FAMILY_SHAPE: Record<BillingFamily, Shape> = {
|
|
321
326
|
anthropic: SHAPES.anthropic,
|
|
322
327
|
google: SHAPES.google,
|
|
323
328
|
openai: SHAPES.openai,
|
|
329
|
+
unknown: priceShape(SHAPE_VARIANTS["8on22-bw"], "unknown"),
|
|
324
330
|
};
|
|
325
331
|
|
|
326
332
|
/** One model line's ideal format: variant plus an optional frame-size
|
|
@@ -348,9 +354,9 @@ const MODEL_VARIANTS: readonly (readonly [RegExp, IdealShape])[] = [
|
|
|
348
354
|
[/gemini/i, { variant: "8on22-bw", frameSize: 2048 }],
|
|
349
355
|
// gpt-5.5 patch billing is area-proportional; 1568 is already optimal.
|
|
350
356
|
[/gpt|codex/i, { variant: "8on22-bw" }],
|
|
351
|
-
// kimi
|
|
352
|
-
// 1568 wins on chars/$
|
|
353
|
-
[/kimi/i, { variant: "
|
|
357
|
+
// kimi-k3 chunked bench: `8on22-bw` scored f1 .915 @ $0.66 vs .813 on `8on16-bw` ($0.70);
|
|
358
|
+
// 1568 wins on chars/$ (image processor downscales past 1792px).
|
|
359
|
+
[/kimi/i, { variant: "8on22-bw" }],
|
|
354
360
|
// glm-4.6v .780 mono via direct vendor routing.
|
|
355
361
|
[/glm/i, { variant: "8on16-bw" }],
|
|
356
362
|
];
|