@hackbuild/ai-views 0.1.18 → 0.1.19
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 +4 -4
- package/dist/loaders.d.ts +1 -1
- package/dist/loaders.js +8 -3
- package/dist/single/elements.iife.js +603 -0
- package/dist/single/elements.js +603 -0
- package/dist/single/index.iife.js +916 -10
- package/dist/single/index.js +916 -10
- package/dist/single/vue.iife.js +603 -0
- package/dist/single/vue.js +603 -0
- package/llms.md +1 -1
- package/package.json +8 -8
|
@@ -3061,6 +3061,282 @@ var HackbuildAiViews = (function(exports) {
|
|
|
3061
3061
|
"vendor"
|
|
3062
3062
|
]
|
|
3063
3063
|
}
|
|
3064
|
+
},
|
|
3065
|
+
"onnx-community/Qwen3.5-0.8B-ONNX-OPT": {
|
|
3066
|
+
"revision": "9a4c21d8f724176b0a7edaaed36303044451886e",
|
|
3067
|
+
"files": {
|
|
3068
|
+
"config.json": [
|
|
3069
|
+
"36fed6a902ccd06ef19a452bd5a0750bd88fe347d06ab75ef515615bac5b296d",
|
|
3070
|
+
2849,
|
|
3071
|
+
"measured"
|
|
3072
|
+
],
|
|
3073
|
+
"generation_config.json": [
|
|
3074
|
+
"dc0cbe66543f310896469b7b1448af792f403293a1080baaf04d586c57b23e48",
|
|
3075
|
+
248,
|
|
3076
|
+
"measured"
|
|
3077
|
+
],
|
|
3078
|
+
"onnx/decoder_model_merged_q4.onnx": [
|
|
3079
|
+
"7390858c80a67275d8cb81fb70f66a24d3b86fe333057c1312de09c184a2d41b",
|
|
3080
|
+
576621,
|
|
3081
|
+
"vendor"
|
|
3082
|
+
],
|
|
3083
|
+
"onnx/decoder_model_merged_q4.onnx_data": [
|
|
3084
|
+
"1a9165072dd51a9b6a917b6357a3686372b7429313022802cd4c9a730e8c9749",
|
|
3085
|
+
483655680,
|
|
3086
|
+
"vendor"
|
|
3087
|
+
],
|
|
3088
|
+
"onnx/decoder_model_merged_q4f16.onnx": [
|
|
3089
|
+
"bd556c6ba812cb7c46328d0caf05e9c3a7e3b8b644add85ae21ad7054524d387",
|
|
3090
|
+
697833,
|
|
3091
|
+
"vendor"
|
|
3092
|
+
],
|
|
3093
|
+
"onnx/decoder_model_merged_q4f16.onnx_data": [
|
|
3094
|
+
"e3459410bf09b756150fb590778f09a52dda85ca1426f65ecac18192fac18b91",
|
|
3095
|
+
435777536,
|
|
3096
|
+
"vendor"
|
|
3097
|
+
],
|
|
3098
|
+
"onnx/embed_tokens_q4.onnx": [
|
|
3099
|
+
"8773dcf4858f855bfce13def4356ca17e0bc516a477154496b6ffb6dd6d084dc",
|
|
3100
|
+
857,
|
|
3101
|
+
"vendor"
|
|
3102
|
+
],
|
|
3103
|
+
"onnx/embed_tokens_q4.onnx_data": [
|
|
3104
|
+
"9210b1d26eb14136d3522584d17da14cc5f4b82b6f5607e6d80d59424a8cbe99",
|
|
3105
|
+
162897920,
|
|
3106
|
+
"vendor"
|
|
3107
|
+
],
|
|
3108
|
+
"onnx/embed_tokens_q4f16.onnx": [
|
|
3109
|
+
"8218531ac44ae9978d50647f1d907c53c308f758514b992504238c77843c254d",
|
|
3110
|
+
1064,
|
|
3111
|
+
"vendor"
|
|
3112
|
+
],
|
|
3113
|
+
"onnx/embed_tokens_q4f16.onnx_data": [
|
|
3114
|
+
"ec4a1f13ff942653b52000a7a0ec40504110d8be9a0ecab2da4d3063588ed563",
|
|
3115
|
+
147005440,
|
|
3116
|
+
"vendor"
|
|
3117
|
+
],
|
|
3118
|
+
"onnx/vision_encoder_q4.onnx": [
|
|
3119
|
+
"9b62022e77de4b22ca0bbc4453083c0cdeb8f967ccf13931d4c24c6e7c776177",
|
|
3120
|
+
185278,
|
|
3121
|
+
"vendor"
|
|
3122
|
+
],
|
|
3123
|
+
"onnx/vision_encoder_q4.onnx_data": [
|
|
3124
|
+
"98aebedf02fc5414fd1c7f06a6580b42e272600ace9ecd33bfbc479a0c541c64",
|
|
3125
|
+
68267008,
|
|
3126
|
+
"vendor"
|
|
3127
|
+
],
|
|
3128
|
+
"onnx/vision_encoder_q4f16.onnx": [
|
|
3129
|
+
"1e76d0c16c1c196e7e6f33053284369e0bc82b10bdc2f14bdf103f86ae5eb11a",
|
|
3130
|
+
213118,
|
|
3131
|
+
"vendor"
|
|
3132
|
+
],
|
|
3133
|
+
"onnx/vision_encoder_q4f16.onnx_data": [
|
|
3134
|
+
"0847376fcef41cb3874a21f0eb1b75428502537e16f360bdbf854e71ef552319",
|
|
3135
|
+
61919744,
|
|
3136
|
+
"vendor"
|
|
3137
|
+
],
|
|
3138
|
+
"preprocessor_config.json": [
|
|
3139
|
+
"6a970fd06f30e6943b3e2c14d5d3b42d49b06cf99b99103d56689bef462d90f8",
|
|
3140
|
+
336,
|
|
3141
|
+
"measured"
|
|
3142
|
+
],
|
|
3143
|
+
"processor_config.json": [
|
|
3144
|
+
"14932921ca485d458a04dafd8069fbb0a4505622a48208d19ed247115801385b",
|
|
3145
|
+
1300,
|
|
3146
|
+
"measured"
|
|
3147
|
+
],
|
|
3148
|
+
"tokenizer.json": [
|
|
3149
|
+
"89da80cc6689bef4d90cc1028249436975ffb0814618f1d93c65310e05801a9b",
|
|
3150
|
+
19226111,
|
|
3151
|
+
"vendor"
|
|
3152
|
+
],
|
|
3153
|
+
"tokenizer_config.json": [
|
|
3154
|
+
"5dcac2c1306b11d1e18ec4c024a174bded2ca3178ce87b0aa590711696407f3d",
|
|
3155
|
+
10069,
|
|
3156
|
+
"measured"
|
|
3157
|
+
]
|
|
3158
|
+
}
|
|
3159
|
+
},
|
|
3160
|
+
"onnx-community/Qwen3.5-2B-ONNX": {
|
|
3161
|
+
"revision": "315216e893038beefcc6eba41ac168913dd0d879",
|
|
3162
|
+
"files": {
|
|
3163
|
+
"config.json": [
|
|
3164
|
+
"b028de63b0ed8b37107acaaf1475d40d6d4feb5721153674e7d1d0bdbfd0f258",
|
|
3165
|
+
2993,
|
|
3166
|
+
"measured"
|
|
3167
|
+
],
|
|
3168
|
+
"generation_config.json": [
|
|
3169
|
+
"dc0cbe66543f310896469b7b1448af792f403293a1080baaf04d586c57b23e48",
|
|
3170
|
+
248,
|
|
3171
|
+
"measured"
|
|
3172
|
+
],
|
|
3173
|
+
"onnx/decoder_model_merged_q4.onnx": [
|
|
3174
|
+
"33f9c1311878df2140e7286f76d9e3acb29d77d91f724210674b0b63d8330df5",
|
|
3175
|
+
885982,
|
|
3176
|
+
"vendor"
|
|
3177
|
+
],
|
|
3178
|
+
"onnx/decoder_model_merged_q4.onnx_data": [
|
|
3179
|
+
"c6f4807e1287961a354b0bc6f8d4c68c658f707a9541e771a297dfefaf4a1e14",
|
|
3180
|
+
1209126912,
|
|
3181
|
+
"vendor"
|
|
3182
|
+
],
|
|
3183
|
+
"onnx/decoder_model_merged_q4f16.onnx": [
|
|
3184
|
+
"aff64289c18b527ee16963444be405d08e7211c4fdca6f3fe53d9d4586703bf7",
|
|
3185
|
+
1046438,
|
|
3186
|
+
"vendor"
|
|
3187
|
+
],
|
|
3188
|
+
"onnx/decoder_model_merged_q4f16.onnx_data": [
|
|
3189
|
+
"e0d1375a8d30aa7db927ce05c60c4134345dca61150acdf05b9822bc06c7e54b",
|
|
3190
|
+
1089777664,
|
|
3191
|
+
"vendor"
|
|
3192
|
+
],
|
|
3193
|
+
"onnx/embed_tokens_q4.onnx": [
|
|
3194
|
+
"0255dd844858758f452d9678f1e2c91db178f21b7da254d29b12e7fe3d23e305",
|
|
3195
|
+
857,
|
|
3196
|
+
"vendor"
|
|
3197
|
+
],
|
|
3198
|
+
"onnx/embed_tokens_q4.onnx_data": [
|
|
3199
|
+
"9a6404d9b1c79ffc038d5c28deec04d419efb4594125453c991be38b4522ecb6",
|
|
3200
|
+
325795840,
|
|
3201
|
+
"vendor"
|
|
3202
|
+
],
|
|
3203
|
+
"onnx/embed_tokens_q4f16.onnx": [
|
|
3204
|
+
"802a072ff21f540eda7f343aa71dbb0354c8859caaf34f09b3bf8117725d7de8",
|
|
3205
|
+
1064,
|
|
3206
|
+
"vendor"
|
|
3207
|
+
],
|
|
3208
|
+
"onnx/embed_tokens_q4f16.onnx_data": [
|
|
3209
|
+
"650aa8eb39b7404ca2c908d78243c82b6fd88321feeb8fca175745806c6b3a81",
|
|
3210
|
+
294010880,
|
|
3211
|
+
"vendor"
|
|
3212
|
+
],
|
|
3213
|
+
"onnx/vision_encoder_q4.onnx": [
|
|
3214
|
+
"7ccbf866b2e0d0c59272c741715fd78764c8777f1063efe070d420191255c9fe",
|
|
3215
|
+
338758,
|
|
3216
|
+
"vendor"
|
|
3217
|
+
],
|
|
3218
|
+
"onnx/vision_encoder_q4.onnx_data": [
|
|
3219
|
+
"0ea0ab9559904e1e5150a0ca194136922c6b8f1dfaaa44cc5e174ca59b231bb3",
|
|
3220
|
+
217952256,
|
|
3221
|
+
"vendor"
|
|
3222
|
+
],
|
|
3223
|
+
"onnx/vision_encoder_q4f16.onnx": [
|
|
3224
|
+
"805dd77fc1501ce100574dd81d9181f9ce95def7f25c52fda99a5cbb9b691ae9",
|
|
3225
|
+
393718,
|
|
3226
|
+
"vendor"
|
|
3227
|
+
],
|
|
3228
|
+
"onnx/vision_encoder_q4f16.onnx_data": [
|
|
3229
|
+
"c54ed06141904a99fa05a9ffaf460ee05441d50dde54f784ec2ae71a43c58314",
|
|
3230
|
+
196945920,
|
|
3231
|
+
"vendor"
|
|
3232
|
+
],
|
|
3233
|
+
"preprocessor_config.json": [
|
|
3234
|
+
"6a970fd06f30e6943b3e2c14d5d3b42d49b06cf99b99103d56689bef462d90f8",
|
|
3235
|
+
336,
|
|
3236
|
+
"measured"
|
|
3237
|
+
],
|
|
3238
|
+
"processor_config.json": [
|
|
3239
|
+
"14932921ca485d458a04dafd8069fbb0a4505622a48208d19ed247115801385b",
|
|
3240
|
+
1300,
|
|
3241
|
+
"measured"
|
|
3242
|
+
],
|
|
3243
|
+
"tokenizer.json": [
|
|
3244
|
+
"89da80cc6689bef4d90cc1028249436975ffb0814618f1d93c65310e05801a9b",
|
|
3245
|
+
19226111,
|
|
3246
|
+
"vendor"
|
|
3247
|
+
],
|
|
3248
|
+
"tokenizer_config.json": [
|
|
3249
|
+
"5dcac2c1306b11d1e18ec4c024a174bded2ca3178ce87b0aa590711696407f3d",
|
|
3250
|
+
10069,
|
|
3251
|
+
"measured"
|
|
3252
|
+
]
|
|
3253
|
+
}
|
|
3254
|
+
},
|
|
3255
|
+
"onnx-community/Janus-Pro-1B-ONNX": {
|
|
3256
|
+
"revision": "04efdf2e36cb07a034b0d94f7322356b292f0418",
|
|
3257
|
+
"files": {
|
|
3258
|
+
"config.json": [
|
|
3259
|
+
"211520b35aa61bbc07db2cbdc9584abceb2b19d26ae5219998ad50037d6a9d71",
|
|
3260
|
+
1888,
|
|
3261
|
+
"measured"
|
|
3262
|
+
],
|
|
3263
|
+
"generation_config.json": [
|
|
3264
|
+
"44328aebd31137f591cce9bf3c82a290785e18cb293e99f2410de52b78f04066",
|
|
3265
|
+
167,
|
|
3266
|
+
"measured"
|
|
3267
|
+
],
|
|
3268
|
+
"onnx/gen_head_fp16.onnx": [
|
|
3269
|
+
"59563c2c872555def6959653ad078bfe93d3484f6f9e692e25160ac2dadf4eae",
|
|
3270
|
+
75536078,
|
|
3271
|
+
"vendor"
|
|
3272
|
+
],
|
|
3273
|
+
"onnx/gen_img_embeds_fp16.onnx": [
|
|
3274
|
+
"1501cac82ce8d4b26b27af5f9f993b1575e27a42a09d07ac508feaebb79aedde",
|
|
3275
|
+
8695058,
|
|
3276
|
+
"vendor"
|
|
3277
|
+
],
|
|
3278
|
+
"onnx/image_decode.onnx": [
|
|
3279
|
+
"5395223c9212df6dca1f29a540f7c5c78971c0d2ee7a3ac88a4e8f5f2b227fb8",
|
|
3280
|
+
170460651,
|
|
3281
|
+
"vendor"
|
|
3282
|
+
],
|
|
3283
|
+
"onnx/language_model_q4f16.onnx": [
|
|
3284
|
+
"bda78684bd85d4beda5558179e2a5da960f13969f111a8024f75be11cdef9a61",
|
|
3285
|
+
698231365,
|
|
3286
|
+
"vendor"
|
|
3287
|
+
],
|
|
3288
|
+
"onnx/lm_head_fp16.onnx": [
|
|
3289
|
+
"215ccbdb0efd6067e68b3057ba798802727d36795b064fd95dea5a4c79f8a733",
|
|
3290
|
+
419430700,
|
|
3291
|
+
"vendor"
|
|
3292
|
+
],
|
|
3293
|
+
"onnx/prepare_inputs_embeds_q4.onnx": [
|
|
3294
|
+
"380c548a75687004c47f7a988f474d03d052b2154292e2a4d001d74d4d2cc845",
|
|
3295
|
+
1038802881,
|
|
3296
|
+
"vendor"
|
|
3297
|
+
],
|
|
3298
|
+
"preprocessor_config.json": [
|
|
3299
|
+
"4dae4dc1bda762bdc84b887b2d3339f21935a15ff716b3049490d96935f7f12a",
|
|
3300
|
+
346,
|
|
3301
|
+
"measured"
|
|
3302
|
+
],
|
|
3303
|
+
"processor_config.json": [
|
|
3304
|
+
"0e9cc77ac444a91691215ac4e61d2c832b25c44ab006f1b7c85b91880478c5c4",
|
|
3305
|
+
288,
|
|
3306
|
+
"measured"
|
|
3307
|
+
],
|
|
3308
|
+
"special_tokens_map.json": [
|
|
3309
|
+
"0db13daead5880bf635018dd15996e4dbe7b4333860794cee2b5d6559edaecae",
|
|
3310
|
+
344,
|
|
3311
|
+
"measured"
|
|
3312
|
+
],
|
|
3313
|
+
"tokenizer.json": [
|
|
3314
|
+
"cd187abdb6927a04ff0214b2d3fa05f4131de66298c8b3b75fbc25ce5f7faff2",
|
|
3315
|
+
4718995,
|
|
3316
|
+
"measured"
|
|
3317
|
+
],
|
|
3318
|
+
"tokenizer_config.json": [
|
|
3319
|
+
"e72af0754f6460a71590afaae8e9666e709eabc35cd2a68fcd2a349f06bbd53e",
|
|
3320
|
+
1355,
|
|
3321
|
+
"measured"
|
|
3322
|
+
]
|
|
3323
|
+
}
|
|
3324
|
+
},
|
|
3325
|
+
"ggml-org/gemma-4-E2B-it-GGUF": {
|
|
3326
|
+
"revision": "2a8538c2e2d4687953a86c422c7c623cfd022880",
|
|
3327
|
+
"files": { "gemma-4-E2B-it-Q4_0.gguf": [
|
|
3328
|
+
"8e30dff3ac4c8434c49a7036fa15564bdbb6044e42bf04550bf1a096ad7e6a52",
|
|
3329
|
+
2841481184,
|
|
3330
|
+
"vendor"
|
|
3331
|
+
] }
|
|
3332
|
+
},
|
|
3333
|
+
"ggml-org/Qwen3.5-0.8B-GGUF": {
|
|
3334
|
+
"revision": "1c0b5292de5ccd62235595d1557c0d70d46c3d9d",
|
|
3335
|
+
"files": { "Qwen3.5-0.8B-Q4_0.gguf": [
|
|
3336
|
+
"57d1997790d1744fba5b40a7317df71ea5e2acee28c47e78f0cce39c0703f8cf",
|
|
3337
|
+
563036064,
|
|
3338
|
+
"vendor"
|
|
3339
|
+
] }
|
|
3064
3340
|
}
|
|
3065
3341
|
};
|
|
3066
3342
|
}));
|
|
@@ -3997,6 +4273,184 @@ var HackbuildAiViews = (function(exports) {
|
|
|
3997
4273
|
commercial: "unknown",
|
|
3998
4274
|
runtime: "@wllama/wllama@3.8.1"
|
|
3999
4275
|
},
|
|
4276
|
+
{
|
|
4277
|
+
id: "gemma-4-e2b-it-mlc",
|
|
4278
|
+
label: "Gemma 4 E2B",
|
|
4279
|
+
params: "E2B",
|
|
4280
|
+
quant: "q4f16_1",
|
|
4281
|
+
vramMB: 3387,
|
|
4282
|
+
vramSource: "vendor",
|
|
4283
|
+
censorship: "stock",
|
|
4284
|
+
tier: "medium",
|
|
4285
|
+
family: "gemma",
|
|
4286
|
+
tags: [],
|
|
4287
|
+
note: "google's gemma 4, the small one. text here; images run through the vision records.",
|
|
4288
|
+
group: "good",
|
|
4289
|
+
badge: "newest gemma",
|
|
4290
|
+
speed: "steady",
|
|
4291
|
+
verdict: "newest gemma, heavier",
|
|
4292
|
+
provides: ["chat"],
|
|
4293
|
+
provider: "webllm",
|
|
4294
|
+
source: { modelId: "gemma-4-E2B-it-q4f16_1-MLC" },
|
|
4295
|
+
sizeMB: 2700,
|
|
4296
|
+
sizeSource: "vendor",
|
|
4297
|
+
ctx: 4096,
|
|
4298
|
+
ladder: [{
|
|
4299
|
+
device: "webgpu",
|
|
4300
|
+
dtype: "q4f16_1",
|
|
4301
|
+
options: { modelId: "gemma-4-E2B-it-q4f16_1-MLC" }
|
|
4302
|
+
}, {
|
|
4303
|
+
device: "webgpu",
|
|
4304
|
+
dtype: "q4f32_1",
|
|
4305
|
+
options: { modelId: "gemma-4-E2B-it-q4f32_1-MLC" }
|
|
4306
|
+
}],
|
|
4307
|
+
quirks: { think: "none" },
|
|
4308
|
+
licence: "Apache-2.0 (the base model card)",
|
|
4309
|
+
commercial: true,
|
|
4310
|
+
runtime: "@mlc-ai/web-llm@0.2.86",
|
|
4311
|
+
notes: ["web-llm 0.2.86 or later lists it (vendor)"]
|
|
4312
|
+
},
|
|
4313
|
+
{
|
|
4314
|
+
id: "gemma-4-e2b-it-gguf",
|
|
4315
|
+
label: "Gemma 4 E2B",
|
|
4316
|
+
params: "E2B",
|
|
4317
|
+
quant: "Q4_0",
|
|
4318
|
+
censorship: "stock",
|
|
4319
|
+
tier: "medium",
|
|
4320
|
+
family: "gemma",
|
|
4321
|
+
tags: [],
|
|
4322
|
+
note: "google's gemma 4 e2b from ggml-org, the llama.cpp project's own build.",
|
|
4323
|
+
group: "good",
|
|
4324
|
+
badge: "newest gemma, gguf",
|
|
4325
|
+
speed: "steady",
|
|
4326
|
+
verdict: "newest gemma, gguf",
|
|
4327
|
+
provides: ["chat"],
|
|
4328
|
+
provider: "wllama",
|
|
4329
|
+
source: {
|
|
4330
|
+
repo: "ggml-org/gemma-4-E2B-it-GGUF",
|
|
4331
|
+
file: "gemma-4-E2B-it-Q4_0.gguf"
|
|
4332
|
+
},
|
|
4333
|
+
sizeMB: 2710,
|
|
4334
|
+
sizeSource: "vendor",
|
|
4335
|
+
ladder: [{
|
|
4336
|
+
device: "webgpu",
|
|
4337
|
+
dtype: "q4_0"
|
|
4338
|
+
}, {
|
|
4339
|
+
device: "wasm",
|
|
4340
|
+
dtype: "q4_0"
|
|
4341
|
+
}],
|
|
4342
|
+
quirks: { think: "none" },
|
|
4343
|
+
licence: "Apache-2.0 (the base model card)",
|
|
4344
|
+
commercial: true,
|
|
4345
|
+
runtime: "@wllama/wllama@3.8.1"
|
|
4346
|
+
},
|
|
4347
|
+
{
|
|
4348
|
+
id: "qwen3.5-0.8b-mlc",
|
|
4349
|
+
label: "Qwen3.5 0.8B",
|
|
4350
|
+
params: "0.8B",
|
|
4351
|
+
quant: "q4f32_1",
|
|
4352
|
+
vramMB: 1894,
|
|
4353
|
+
vramSource: "vendor",
|
|
4354
|
+
censorship: "stock",
|
|
4355
|
+
tier: "small",
|
|
4356
|
+
family: "qwen3.5",
|
|
4357
|
+
tags: ["low vram"],
|
|
4358
|
+
note: "the smallest qwen3.5. text in this runtime; images run through the vision records.",
|
|
4359
|
+
group: "tiny",
|
|
4360
|
+
badge: "newest qwen, small",
|
|
4361
|
+
speed: "fast",
|
|
4362
|
+
verdict: "newest qwen, small",
|
|
4363
|
+
provides: ["chat"],
|
|
4364
|
+
provider: "webllm",
|
|
4365
|
+
source: { modelId: "Qwen3.5-0.8B-q4f32_1-MLC" },
|
|
4366
|
+
sizeMB: 427,
|
|
4367
|
+
sizeSource: "vendor",
|
|
4368
|
+
ctx: 4096,
|
|
4369
|
+
ladder: [{
|
|
4370
|
+
device: "webgpu",
|
|
4371
|
+
dtype: "q4f32_1",
|
|
4372
|
+
options: { modelId: "Qwen3.5-0.8B-q4f32_1-MLC" }
|
|
4373
|
+
}, {
|
|
4374
|
+
device: "webgpu",
|
|
4375
|
+
dtype: "q4f16_1",
|
|
4376
|
+
options: { modelId: "Qwen3.5-0.8B-q4f16_1-MLC" }
|
|
4377
|
+
}],
|
|
4378
|
+
quirks: { toolCallTags: true },
|
|
4379
|
+
licence: "Apache-2.0 (the base model card)",
|
|
4380
|
+
commercial: true,
|
|
4381
|
+
runtime: "@mlc-ai/web-llm@0.2.84",
|
|
4382
|
+
notes: ["weak at this size: the 2b answers well (measured 2026-12-02)"]
|
|
4383
|
+
},
|
|
4384
|
+
{
|
|
4385
|
+
id: "qwen3.5-2b-mlc",
|
|
4386
|
+
label: "Qwen3.5 2B",
|
|
4387
|
+
params: "2B",
|
|
4388
|
+
quant: "q4f16_1",
|
|
4389
|
+
vramMB: 2245,
|
|
4390
|
+
vramSource: "vendor",
|
|
4391
|
+
censorship: "stock",
|
|
4392
|
+
tier: "small",
|
|
4393
|
+
family: "qwen3.5",
|
|
4394
|
+
tags: [],
|
|
4395
|
+
note: "qwen3.5 2b. text in this runtime; images run through the vision records.",
|
|
4396
|
+
group: "good",
|
|
4397
|
+
badge: "newest qwen",
|
|
4398
|
+
speed: "fast",
|
|
4399
|
+
verdict: "newest qwen, balanced",
|
|
4400
|
+
provides: ["chat"],
|
|
4401
|
+
provider: "webllm",
|
|
4402
|
+
source: { modelId: "Qwen3.5-2B-q4f16_1-MLC" },
|
|
4403
|
+
sizeMB: 1032,
|
|
4404
|
+
sizeSource: "vendor",
|
|
4405
|
+
ctx: 4096,
|
|
4406
|
+
ladder: [{
|
|
4407
|
+
device: "webgpu",
|
|
4408
|
+
dtype: "q4f16_1",
|
|
4409
|
+
options: { modelId: "Qwen3.5-2B-q4f16_1-MLC" }
|
|
4410
|
+
}, {
|
|
4411
|
+
device: "webgpu",
|
|
4412
|
+
dtype: "q4f32_1",
|
|
4413
|
+
options: { modelId: "Qwen3.5-2B-q4f32_1-MLC" }
|
|
4414
|
+
}],
|
|
4415
|
+
quirks: { toolCallTags: true },
|
|
4416
|
+
licence: "Apache-2.0 (the base model card)",
|
|
4417
|
+
commercial: true,
|
|
4418
|
+
runtime: "@mlc-ai/web-llm@0.2.84"
|
|
4419
|
+
},
|
|
4420
|
+
{
|
|
4421
|
+
id: "qwen3.5-0.8b-gguf",
|
|
4422
|
+
label: "Qwen3.5 0.8B",
|
|
4423
|
+
params: "0.8B",
|
|
4424
|
+
quant: "Q4_0",
|
|
4425
|
+
censorship: "stock",
|
|
4426
|
+
tier: "small",
|
|
4427
|
+
family: "qwen3.5",
|
|
4428
|
+
tags: ["no gpu"],
|
|
4429
|
+
note: "the smallest qwen3.5 from ggml-org. runs on the cpu too.",
|
|
4430
|
+
group: "tiny",
|
|
4431
|
+
badge: "newest qwen, cpu",
|
|
4432
|
+
speed: "fast",
|
|
4433
|
+
verdict: "newest qwen, cpu",
|
|
4434
|
+
provides: ["chat"],
|
|
4435
|
+
provider: "wllama",
|
|
4436
|
+
source: {
|
|
4437
|
+
repo: "ggml-org/Qwen3.5-0.8B-GGUF",
|
|
4438
|
+
file: "Qwen3.5-0.8B-Q4_0.gguf"
|
|
4439
|
+
},
|
|
4440
|
+
sizeMB: 537,
|
|
4441
|
+
sizeSource: "vendor",
|
|
4442
|
+
ladder: [{
|
|
4443
|
+
device: "webgpu",
|
|
4444
|
+
dtype: "q4_0"
|
|
4445
|
+
}, {
|
|
4446
|
+
device: "wasm",
|
|
4447
|
+
dtype: "q4_0"
|
|
4448
|
+
}],
|
|
4449
|
+
quirks: { toolCallTags: true },
|
|
4450
|
+
licence: "Apache-2.0 (the base model card)",
|
|
4451
|
+
commercial: true,
|
|
4452
|
+
runtime: "@wllama/wllama@3.8.1"
|
|
4453
|
+
},
|
|
4000
4454
|
{
|
|
4001
4455
|
id: "qwen3.5-0.8b-abliterated-gguf",
|
|
4002
4456
|
label: "Qwen3.5 0.8B abliterated",
|
|
@@ -8178,6 +8632,67 @@ var HackbuildAiViews = (function(exports) {
|
|
|
8178
8632
|
ids2: "int64"
|
|
8179
8633
|
}
|
|
8180
8634
|
}
|
|
8635
|
+
}, {
|
|
8636
|
+
id: "janus-pro-1b",
|
|
8637
|
+
label: "janus-pro 1b 384",
|
|
8638
|
+
speed: "slow",
|
|
8639
|
+
verdict: "draws and sees",
|
|
8640
|
+
group: "good",
|
|
8641
|
+
provides: ["imagegen"],
|
|
8642
|
+
provider: "tjs",
|
|
8643
|
+
source: { modelId: "onnx-community/Janus-Pro-1B-ONNX" },
|
|
8644
|
+
sizeMB: 2304,
|
|
8645
|
+
sizeSource: "vendor",
|
|
8646
|
+
ladder: [{
|
|
8647
|
+
device: "webgpu",
|
|
8648
|
+
dtype: {
|
|
8649
|
+
prepare_inputs_embeds: "q4",
|
|
8650
|
+
language_model: "q4f16",
|
|
8651
|
+
lm_head: "fp16",
|
|
8652
|
+
gen_head: "fp16",
|
|
8653
|
+
gen_img_embeds: "fp16",
|
|
8654
|
+
image_decode: "fp32"
|
|
8655
|
+
},
|
|
8656
|
+
options: {
|
|
8657
|
+
loader: "imagegen.janus",
|
|
8658
|
+
device: {
|
|
8659
|
+
prepare_inputs_embeds: "wasm",
|
|
8660
|
+
language_model: "webgpu",
|
|
8661
|
+
lm_head: "webgpu",
|
|
8662
|
+
gen_head: "webgpu",
|
|
8663
|
+
gen_img_embeds: "webgpu",
|
|
8664
|
+
image_decode: "webgpu"
|
|
8665
|
+
}
|
|
8666
|
+
}
|
|
8667
|
+
}],
|
|
8668
|
+
licence: "DeepSeek Model License (weights; use restrictions apply), MIT (code)",
|
|
8669
|
+
commercial: true,
|
|
8670
|
+
place: "gpu",
|
|
8671
|
+
runtime: "@huggingface/transformers@4.3.2",
|
|
8672
|
+
notes: [
|
|
8673
|
+
"deepseek's janus-pro: one model that reads images and draws them, 576 image tokens per picture",
|
|
8674
|
+
"janus-pro 7b draws only through deepseek's python code; no browser or openai style build draws (vendor)",
|
|
8675
|
+
"needs shader-f16 on webgpu; transformers.js samples, so a seed does not repeat a picture"
|
|
8676
|
+
],
|
|
8677
|
+
form: {
|
|
8678
|
+
steps: {
|
|
8679
|
+
min: 1,
|
|
8680
|
+
max: 1,
|
|
8681
|
+
default: 1
|
|
8682
|
+
},
|
|
8683
|
+
guidance: null,
|
|
8684
|
+
negative: false,
|
|
8685
|
+
sizes: [384],
|
|
8686
|
+
spacing: "trailing",
|
|
8687
|
+
note: "janus-pro 1b, deepseek. draws 384 pixel pictures token by token.",
|
|
8688
|
+
tokenizer: "onnx-community/Janus-Pro-1B-ONNX",
|
|
8689
|
+
graphs: {
|
|
8690
|
+
textEncoder: "",
|
|
8691
|
+
unet: "",
|
|
8692
|
+
vaeDecoder: ""
|
|
8693
|
+
},
|
|
8694
|
+
pipeline: "janus"
|
|
8695
|
+
}
|
|
8181
8696
|
}];
|
|
8182
8697
|
}));
|
|
8183
8698
|
// packages/imagegen/src/xl.ts
|
|
@@ -8343,10 +8858,77 @@ var HackbuildAiViews = (function(exports) {
|
|
|
8343
8858
|
};
|
|
8344
8859
|
EOT = 49407;
|
|
8345
8860
|
}));
|
|
8861
|
+
// packages/imagegen/src/janus.ts
|
|
8862
|
+
/** RGB or RGBA pixels from transformers.js as RGBA. */
|
|
8863
|
+
function rgbaOf(img) {
|
|
8864
|
+
const n = img.width * img.height;
|
|
8865
|
+
if (img.channels === 4) return new Uint8ClampedArray(img.data);
|
|
8866
|
+
const out = new Uint8ClampedArray(n * 4);
|
|
8867
|
+
for (let i = 0; i < n; i++) {
|
|
8868
|
+
out[i * 4] = img.data[i * img.channels];
|
|
8869
|
+
out[i * 4 + 1] = img.data[i * img.channels + (img.channels > 1 ? 1 : 0)];
|
|
8870
|
+
out[i * 4 + 2] = img.data[i * img.channels + (img.channels > 2 ? 2 : 0)];
|
|
8871
|
+
out[i * 4 + 3] = 255;
|
|
8872
|
+
}
|
|
8873
|
+
return out;
|
|
8874
|
+
}
|
|
8875
|
+
/** The transformers.js loader for Janus image records, registered by `attachImagegen(hub, tjs)` as "imagegen.janus". */
|
|
8876
|
+
async function janusImageLoader(ctx) {
|
|
8877
|
+
const id = ctx.record.source.modelId;
|
|
8878
|
+
const P = ctx.tjs.AutoProcessor;
|
|
8879
|
+
const M = ctx.tjs.MultiModalityCausalLM;
|
|
8880
|
+
if (!P || !M) throw new Error("janus needs transformers.js 3.1.0 or later (MultiModalityCausalLM)");
|
|
8881
|
+
const processor = await P.from_pretrained(id);
|
|
8882
|
+
const model = await M.from_pretrained(id, ctx.options);
|
|
8883
|
+
return {
|
|
8884
|
+
async draw(prompt, o = {}) {
|
|
8885
|
+
const t0 = performance.now();
|
|
8886
|
+
const inputs = await processor([{
|
|
8887
|
+
role: "<|User|>",
|
|
8888
|
+
content: prompt
|
|
8889
|
+
}], { chat_template: "text_to_image" });
|
|
8890
|
+
const total = processor.num_image_tokens;
|
|
8891
|
+
o.signal?.throwIfAborted();
|
|
8892
|
+
let done = -1;
|
|
8893
|
+
const streamer = {
|
|
8894
|
+
put: () => {
|
|
8895
|
+
o.signal?.throwIfAborted();
|
|
8896
|
+
if (++done > 0) o.onToken?.(done, total);
|
|
8897
|
+
},
|
|
8898
|
+
end: () => {}
|
|
8899
|
+
};
|
|
8900
|
+
const t1 = performance.now();
|
|
8901
|
+
const [img] = await model.generate_images({
|
|
8902
|
+
...inputs,
|
|
8903
|
+
min_new_tokens: total,
|
|
8904
|
+
max_new_tokens: total,
|
|
8905
|
+
do_sample: true,
|
|
8906
|
+
streamer
|
|
8907
|
+
});
|
|
8908
|
+
if (!img) throw new Error("janus returned no image");
|
|
8909
|
+
const t2 = performance.now();
|
|
8910
|
+
return {
|
|
8911
|
+
width: img.width,
|
|
8912
|
+
height: img.height,
|
|
8913
|
+
rgba: rgbaOf(img),
|
|
8914
|
+
seed: 0,
|
|
8915
|
+
seeded: false,
|
|
8916
|
+
ms: {
|
|
8917
|
+
text: t1 - t0,
|
|
8918
|
+
unet: t2 - t1,
|
|
8919
|
+
vae: 0
|
|
8920
|
+
}
|
|
8921
|
+
};
|
|
8922
|
+
},
|
|
8923
|
+
dispose: () => model.dispose?.()
|
|
8924
|
+
};
|
|
8925
|
+
}
|
|
8926
|
+
var init_janus$1 = __esmMin((() => {}));
|
|
8346
8927
|
// packages/imagegen/src/hub.ts
|
|
8347
8928
|
/** Add the image records to the hub's registry. */
|
|
8348
|
-
function attachImagegen(hub) {
|
|
8929
|
+
function attachImagegen(hub, tjs) {
|
|
8349
8930
|
hub.registry.add(...IMAGEGEN_RECORDS);
|
|
8931
|
+
tjs?.loader("imagegen.janus", janusImageLoader);
|
|
8350
8932
|
}
|
|
8351
8933
|
/** The sessions of a loaded model, by the form's graph names: three, or four with SDXL's second text encoder. */
|
|
8352
8934
|
function sessionsOf(m, form) {
|
|
@@ -8394,6 +8976,7 @@ var HackbuildAiViews = (function(exports) {
|
|
|
8394
8976
|
}
|
|
8395
8977
|
const loaded = await hub.use(what, o);
|
|
8396
8978
|
const form = formOf(loaded.record) ?? IMAGEGEN_RECORDS[0].form;
|
|
8979
|
+
if (form.pipeline === "janus") return janusGenerator(hub, loaded, form);
|
|
8397
8980
|
let sessions;
|
|
8398
8981
|
try {
|
|
8399
8982
|
sessions = sessionsOf(loaded.value, form);
|
|
@@ -8463,11 +9046,40 @@ var HackbuildAiViews = (function(exports) {
|
|
|
8463
9046
|
}
|
|
8464
9047
|
};
|
|
8465
9048
|
}
|
|
9049
|
+
/** The generator for a Janus record: no onnx sessions or tokenizer of its own; the prompt goes to the model's own processor. */
|
|
9050
|
+
function janusGenerator(hub, loaded, form) {
|
|
9051
|
+
return {
|
|
9052
|
+
loaded,
|
|
9053
|
+
record: loaded.record,
|
|
9054
|
+
form,
|
|
9055
|
+
sessions: {},
|
|
9056
|
+
async generate(_tokenize, req) {
|
|
9057
|
+
const { runOptions, signal, prompt, onStep } = req;
|
|
9058
|
+
const t0 = performance.now();
|
|
9059
|
+
return hub.run(loaded, () => loaded.value.draw(prompt, {
|
|
9060
|
+
...signal ? { signal } : {},
|
|
9061
|
+
...onStep ? { onToken: (step, steps) => onStep({
|
|
9062
|
+
stage: "denoise",
|
|
9063
|
+
step,
|
|
9064
|
+
steps,
|
|
9065
|
+
ms: performance.now() - t0
|
|
9066
|
+
}) } : {}
|
|
9067
|
+
}), {
|
|
9068
|
+
...runOptions ?? {},
|
|
9069
|
+
...signal ? { signal } : {}
|
|
9070
|
+
});
|
|
9071
|
+
},
|
|
9072
|
+
release() {
|
|
9073
|
+
hub.release(loaded);
|
|
9074
|
+
}
|
|
9075
|
+
};
|
|
9076
|
+
}
|
|
8466
9077
|
var FormError;
|
|
8467
9078
|
var init_hub = __esmMin((() => {
|
|
8468
9079
|
init_pipeline();
|
|
8469
9080
|
init_records$3();
|
|
8470
9081
|
init_xl();
|
|
9082
|
+
init_janus$1();
|
|
8471
9083
|
FormError = class extends Error {
|
|
8472
9084
|
name = "FormError";
|
|
8473
9085
|
};
|
|
@@ -8489,12 +9101,14 @@ var HackbuildAiViews = (function(exports) {
|
|
|
8489
9101
|
gaussian: () => gaussian,
|
|
8490
9102
|
generate: () => generate,
|
|
8491
9103
|
generateXl: () => generateXl,
|
|
9104
|
+
janusImageLoader: () => janusImageLoader,
|
|
8492
9105
|
leadingTimesteps: () => leadingTimesteps,
|
|
8493
9106
|
loadImagegen: () => loadImagegen,
|
|
8494
9107
|
loadLabel: () => loadLabel,
|
|
8495
9108
|
mulberry32: () => mulberry32,
|
|
8496
9109
|
padIds: () => padIds,
|
|
8497
9110
|
padIds2: () => padIds2,
|
|
9111
|
+
rgbaOf: () => rgbaOf,
|
|
8498
9112
|
sessionsOf: () => sessionsOf,
|
|
8499
9113
|
sigmas: () => sigmas,
|
|
8500
9114
|
stubImagegenModel: () => stubImagegenModel,
|
|
@@ -8508,6 +9122,7 @@ var HackbuildAiViews = (function(exports) {
|
|
|
8508
9122
|
init_records$3();
|
|
8509
9123
|
init_hub();
|
|
8510
9124
|
init_xl();
|
|
9125
|
+
init_janus$1();
|
|
8511
9126
|
}));
|
|
8512
9127
|
// packages/speak/src/text.ts
|
|
8513
9128
|
/**
|
|
@@ -12562,7 +13177,7 @@ var HackbuildAiViews = (function(exports) {
|
|
|
12562
13177
|
notes: ["640 letterbox, per class nms at iou 0.45, at most 13 boxes"]
|
|
12563
13178
|
};
|
|
12564
13179
|
}
|
|
12565
|
-
var MP_MODELS, mediapipeLadder, mp, VISION_RECORDS, yolo10, PICKER_RECORDS;
|
|
13180
|
+
var MP_MODELS, mediapipeLadder, mp, VISION_RECORDS, yolo10, PICKER_RECORDS, ENDPOINT_RECORDS;
|
|
12566
13181
|
var init_records = __esmMin((() => {
|
|
12567
13182
|
init_src$9();
|
|
12568
13183
|
MP_MODELS = "https://storage.googleapis.com/mediapipe-models/";
|
|
@@ -12810,6 +13425,94 @@ var HackbuildAiViews = (function(exports) {
|
|
|
12810
13425
|
runtime: "@huggingface/transformers@4.3.2",
|
|
12811
13426
|
notes: ["about 3.3 GB (vendor)"]
|
|
12812
13427
|
},
|
|
13428
|
+
{
|
|
13429
|
+
id: "qwen3.5-0.8b-vision",
|
|
13430
|
+
label: "qwen3.5 0.8b",
|
|
13431
|
+
speed: "fast",
|
|
13432
|
+
verdict: "small, reads text",
|
|
13433
|
+
group: "good",
|
|
13434
|
+
provides: ["vision.caption", "vision.ask"],
|
|
13435
|
+
provider: "tjs",
|
|
13436
|
+
source: { modelId: "onnx-community/Qwen3.5-0.8B-ONNX-OPT" },
|
|
13437
|
+
sizeMB: 615,
|
|
13438
|
+
sizeSource: "vendor",
|
|
13439
|
+
ladder: LADDERS.vlmGpuOnly(),
|
|
13440
|
+
quirks: {
|
|
13441
|
+
maxTokensAction: 96,
|
|
13442
|
+
maxImageSide: 768
|
|
13443
|
+
},
|
|
13444
|
+
licence: "Apache-2.0 (the model card's licence field)",
|
|
13445
|
+
commercial: true,
|
|
13446
|
+
place: "gpu",
|
|
13447
|
+
runtime: "@huggingface/transformers@4.3.2",
|
|
13448
|
+
notes: ["qwen3.5 takes images in every size; there is no separate qwen3.5-vl (vendor)", "transformers.js 4.0.0 or later (Qwen3_5ForConditionalGeneration)"]
|
|
13449
|
+
},
|
|
13450
|
+
{
|
|
13451
|
+
id: "qwen3.5-2b-vision",
|
|
13452
|
+
label: "qwen3.5 2b",
|
|
13453
|
+
speed: "steady",
|
|
13454
|
+
verdict: "sharper answers, heavier",
|
|
13455
|
+
group: "good",
|
|
13456
|
+
provides: ["vision.caption", "vision.ask"],
|
|
13457
|
+
provider: "tjs",
|
|
13458
|
+
source: { modelId: "onnx-community/Qwen3.5-2B-ONNX" },
|
|
13459
|
+
sizeMB: 1508,
|
|
13460
|
+
sizeSource: "vendor",
|
|
13461
|
+
ladder: LADDERS.vlmGpuOnly(),
|
|
13462
|
+
quirks: {
|
|
13463
|
+
maxTokensAction: 96,
|
|
13464
|
+
maxImageSide: 768
|
|
13465
|
+
},
|
|
13466
|
+
licence: "Apache-2.0 (the model card's licence field)",
|
|
13467
|
+
commercial: true,
|
|
13468
|
+
place: "gpu",
|
|
13469
|
+
runtime: "@huggingface/transformers@4.3.2",
|
|
13470
|
+
notes: ["transformers.js 4.0.0 or later (Qwen3_5ForConditionalGeneration)"]
|
|
13471
|
+
},
|
|
13472
|
+
{
|
|
13473
|
+
id: "janus-pro-1b-vision",
|
|
13474
|
+
label: "janus-pro 1b",
|
|
13475
|
+
speed: "slow",
|
|
13476
|
+
verdict: "sees and draws, heavy",
|
|
13477
|
+
group: "good",
|
|
13478
|
+
provides: ["vision.caption", "vision.ask"],
|
|
13479
|
+
provider: "tjs",
|
|
13480
|
+
source: { modelId: "onnx-community/Janus-Pro-1B-ONNX" },
|
|
13481
|
+
sizeMB: 2304,
|
|
13482
|
+
sizeSource: "vendor",
|
|
13483
|
+
ladder: [{
|
|
13484
|
+
device: "webgpu",
|
|
13485
|
+
dtype: {
|
|
13486
|
+
prepare_inputs_embeds: "q4",
|
|
13487
|
+
language_model: "q4f16",
|
|
13488
|
+
lm_head: "fp16",
|
|
13489
|
+
gen_head: "fp16",
|
|
13490
|
+
gen_img_embeds: "fp16",
|
|
13491
|
+
image_decode: "fp32"
|
|
13492
|
+
},
|
|
13493
|
+
options: {
|
|
13494
|
+
loader: "vision.janus",
|
|
13495
|
+
device: {
|
|
13496
|
+
prepare_inputs_embeds: "wasm",
|
|
13497
|
+
language_model: "webgpu",
|
|
13498
|
+
lm_head: "webgpu",
|
|
13499
|
+
gen_head: "webgpu",
|
|
13500
|
+
gen_img_embeds: "webgpu",
|
|
13501
|
+
image_decode: "webgpu"
|
|
13502
|
+
}
|
|
13503
|
+
}
|
|
13504
|
+
}],
|
|
13505
|
+
quirks: { maxTokensAction: 96 },
|
|
13506
|
+
licence: "DeepSeek Model License (weights; use restrictions apply), MIT (code)",
|
|
13507
|
+
commercial: true,
|
|
13508
|
+
place: "gpu",
|
|
13509
|
+
runtime: "@huggingface/transformers@4.3.2",
|
|
13510
|
+
notes: [
|
|
13511
|
+
"needs shader-f16 on webgpu",
|
|
13512
|
+
"janus-pro 7b is over 4 GB at q4: run it on your endpoint (janus-pro-7b-endpoint)",
|
|
13513
|
+
"the same weights draw pictures through @hackbuild/imagegen"
|
|
13514
|
+
]
|
|
13515
|
+
},
|
|
12813
13516
|
yolo10("n", 9, "instant", "nano, quick"),
|
|
12814
13517
|
yolo10("s", 28, "fast", "small, sharper"),
|
|
12815
13518
|
yolo10("m", 59, "steady", "medium, best boxes"),
|
|
@@ -12913,6 +13616,56 @@ var HackbuildAiViews = (function(exports) {
|
|
|
12913
13616
|
notes: ["128 px faces; paste the result back with a feathered mask"]
|
|
12914
13617
|
}
|
|
12915
13618
|
];
|
|
13619
|
+
ENDPOINT_RECORDS = [
|
|
13620
|
+
{
|
|
13621
|
+
id: "janus-pro-7b-endpoint",
|
|
13622
|
+
label: "janus-pro 7b, your endpoint",
|
|
13623
|
+
speed: "steady",
|
|
13624
|
+
verdict: "larger janus, sees only",
|
|
13625
|
+
group: "endpoint",
|
|
13626
|
+
provides: ["vision.caption", "vision.ask"],
|
|
13627
|
+
provider: "remote",
|
|
13628
|
+
source: { modelId: "janus-pro-7b" },
|
|
13629
|
+
sizeMB: 0,
|
|
13630
|
+
sizeSource: "vendor",
|
|
13631
|
+
ladder: [{ device: "remote" }],
|
|
13632
|
+
licence: "DeepSeek Model License (weights; use restrictions apply), MIT (code)",
|
|
13633
|
+
commercial: true,
|
|
13634
|
+
notes: ["llama-server -m Janus-Pro-7B.Q4_K_M.gguf --mmproj Janus-Pro-7B.mmproj-Q8_0.gguf (mradermacher/Janus-Pro-7B-GGUF, 4.22 GB plus 0.35 GB, vendor)", "image understanding only: llama.cpp drops the image generation weights; ollama has no official tag"]
|
|
13635
|
+
},
|
|
13636
|
+
{
|
|
13637
|
+
id: "gemma-4-e4b-endpoint",
|
|
13638
|
+
label: "gemma 4 e4b, your endpoint",
|
|
13639
|
+
speed: "steady",
|
|
13640
|
+
verdict: "on your machine",
|
|
13641
|
+
group: "endpoint",
|
|
13642
|
+
provides: ["vision.caption", "vision.ask"],
|
|
13643
|
+
provider: "remote",
|
|
13644
|
+
source: { modelId: "gemma4:e4b" },
|
|
13645
|
+
sizeMB: 0,
|
|
13646
|
+
sizeSource: "vendor",
|
|
13647
|
+
ladder: [{ device: "remote" }],
|
|
13648
|
+
licence: "Apache-2.0 (the model card's licence field)",
|
|
13649
|
+
commercial: true,
|
|
13650
|
+
notes: ["ollama pull gemma4:e4b; gemma4:12b, 26b and 31b take images too"]
|
|
13651
|
+
},
|
|
13652
|
+
{
|
|
13653
|
+
id: "qwen3.5-9b-endpoint",
|
|
13654
|
+
label: "qwen3.5 9b, your endpoint",
|
|
13655
|
+
speed: "steady",
|
|
13656
|
+
verdict: "on your machine",
|
|
13657
|
+
group: "endpoint",
|
|
13658
|
+
provides: ["vision.caption", "vision.ask"],
|
|
13659
|
+
provider: "remote",
|
|
13660
|
+
source: { modelId: "qwen3.5:9b" },
|
|
13661
|
+
sizeMB: 0,
|
|
13662
|
+
sizeSource: "vendor",
|
|
13663
|
+
ladder: [{ device: "remote" }],
|
|
13664
|
+
licence: "Apache-2.0 (the model card's licence field)",
|
|
13665
|
+
commercial: true,
|
|
13666
|
+
notes: ["ollama pull qwen3.5:9b; every qwen3.5 size takes images"]
|
|
13667
|
+
}
|
|
13668
|
+
];
|
|
12916
13669
|
}));
|
|
12917
13670
|
// packages/vision/src/segment.ts
|
|
12918
13671
|
/** True when the prompt has a point or a box. */
|
|
@@ -12986,10 +13739,18 @@ var HackbuildAiViews = (function(exports) {
|
|
|
12986
13739
|
};
|
|
12987
13740
|
}));
|
|
12988
13741
|
// packages/vision/src/loaders.ts
|
|
13742
|
+
/** @internal an image input as a transformers.js RawImage. */
|
|
12989
13743
|
async function toRaw(tjs, img) {
|
|
12990
13744
|
const R = tjs.RawImage;
|
|
12991
13745
|
return R?.read ? R.read(img) : img;
|
|
12992
13746
|
}
|
|
13747
|
+
/** @internal a RawImage resized down so its longest side is at most `side`; smaller images and no cap pass through. */
|
|
13748
|
+
async function capped(img, side) {
|
|
13749
|
+
const r = img;
|
|
13750
|
+
if (!side || !r.width || !r.height || !r.resize) return img;
|
|
13751
|
+
const k = side / Math.max(r.width, r.height);
|
|
13752
|
+
return k >= 1 ? img : r.resize(Math.round(r.width * k), Math.round(r.height * k));
|
|
13753
|
+
}
|
|
12993
13754
|
/** Normalize a depth pipeline result. predicted_depth keeps the raw range; depth is the 8 bit image. */
|
|
12994
13755
|
function depthFromOutput(out) {
|
|
12995
13756
|
const pd = out.predicted_depth;
|
|
@@ -13050,7 +13811,7 @@ var HackbuildAiViews = (function(exports) {
|
|
|
13050
13811
|
text: question ?? "Describe this image in one sentence."
|
|
13051
13812
|
}]
|
|
13052
13813
|
}], { add_generation_prompt: true });
|
|
13053
|
-
const raw = [await toRaw(ctx.tjs, image)];
|
|
13814
|
+
const raw = [await capped(await toRaw(ctx.tjs, image), ctx.record.quirks?.maxImageSide)];
|
|
13054
13815
|
const inputs = await (imagesFirst ? processor(raw, text) : processor(text, raw));
|
|
13055
13816
|
const ids = await model.generate({
|
|
13056
13817
|
...inputs,
|
|
@@ -13128,6 +13889,39 @@ var HackbuildAiViews = (function(exports) {
|
|
|
13128
13889
|
throw new Error(`the transformers.js module has none of ${names.join(", ")}`);
|
|
13129
13890
|
};
|
|
13130
13891
|
}));
|
|
13892
|
+
// packages/vision/src/janus.ts
|
|
13893
|
+
/** One user turn with an image, in the Janus chat format. */
|
|
13894
|
+
function janusTurn(question, image) {
|
|
13895
|
+
return {
|
|
13896
|
+
role: "<|User|>",
|
|
13897
|
+
content: `<image_placeholder>\n${question}`,
|
|
13898
|
+
images: [image]
|
|
13899
|
+
};
|
|
13900
|
+
}
|
|
13901
|
+
/** The transformers.js loader for Janus records: its processor and `MultiModalityCausalLM` wrapped as a {@link Vlm}. */
|
|
13902
|
+
async function janusLoader(ctx) {
|
|
13903
|
+
const id = ctx.record.source.modelId;
|
|
13904
|
+
const processor = await cls(ctx.tjs, "AutoProcessor").from_pretrained(id);
|
|
13905
|
+
const model = await cls(ctx.tjs, "MultiModalityCausalLM").from_pretrained(id, ctx.options);
|
|
13906
|
+
const cap = ctx.record.quirks?.maxTokensAction ?? 96;
|
|
13907
|
+
return {
|
|
13908
|
+
async ask(image, question, o = {}) {
|
|
13909
|
+
const inputs = await processor([janusTurn(question ?? "Describe this image in one sentence.", await toRaw(ctx.tjs, image))]);
|
|
13910
|
+
const ids = await model.generate({
|
|
13911
|
+
...inputs,
|
|
13912
|
+
max_new_tokens: o.maxTokens ?? cap,
|
|
13913
|
+
do_sample: false
|
|
13914
|
+
});
|
|
13915
|
+
const start = inputs.input_ids.dims[inputs.input_ids.dims.length - 1];
|
|
13916
|
+
const gen = ids.slice ? ids.slice(null, [start, null]) : ids;
|
|
13917
|
+
return (processor.batch_decode(gen, { skip_special_tokens: true })[0] ?? "").trim();
|
|
13918
|
+
},
|
|
13919
|
+
dispose: () => model.dispose?.()
|
|
13920
|
+
};
|
|
13921
|
+
}
|
|
13922
|
+
var init_janus = __esmMin((() => {
|
|
13923
|
+
init_loaders();
|
|
13924
|
+
}));
|
|
13131
13925
|
// packages/vision/src/yolo.ts
|
|
13132
13926
|
/** The scale and padding that fit a `w` by `h` image into a `size` square (640 by default), centred. */
|
|
13133
13927
|
function letterboxParams(w, h, size = 640) {
|
|
@@ -13461,6 +14255,7 @@ var HackbuildAiViews = (function(exports) {
|
|
|
13461
14255
|
tjs.loader("vision.caption", vlmLoader);
|
|
13462
14256
|
tjs.loader("vision.ask", vlmLoader);
|
|
13463
14257
|
tjs.loader("segment", samLoader);
|
|
14258
|
+
tjs.loader("vision.janus", janusLoader);
|
|
13464
14259
|
}
|
|
13465
14260
|
}
|
|
13466
14261
|
async function withModel(hub, what, fn, o = {}) {
|
|
@@ -13497,8 +14292,8 @@ var HackbuildAiViews = (function(exports) {
|
|
|
13497
14292
|
function ensureRecord(hub, id) {
|
|
13498
14293
|
const have = hub.registry.get(id);
|
|
13499
14294
|
if (have) return have;
|
|
13500
|
-
const rec = PICKER_RECORDS.find((r) => r.id === id);
|
|
13501
|
-
if (!rec) throw new Error(`${id} is neither registered nor a picker record`);
|
|
14295
|
+
const rec = PICKER_RECORDS.find((r) => r.id === id) ?? ENDPOINT_RECORDS.find((r) => r.id === id);
|
|
14296
|
+
if (!rec) throw new Error(`${id} is neither registered nor a picker or endpoint record`);
|
|
13502
14297
|
hub.registry.add(rec);
|
|
13503
14298
|
return rec;
|
|
13504
14299
|
}
|
|
@@ -13586,14 +14381,21 @@ var HackbuildAiViews = (function(exports) {
|
|
|
13586
14381
|
}
|
|
13587
14382
|
/** Caption an image. VLM calls are serialized on one chain. */
|
|
13588
14383
|
function caption(hub, image, o = {}) {
|
|
13589
|
-
return hub.chain("vlm")(() => withModel(hub, target("vision.caption", o), (m) => m.ask(image, void 0,
|
|
14384
|
+
return hub.chain("vlm")(() => withModel(hub, target("vision.caption", o), (m) => m.ask(image, void 0, {
|
|
14385
|
+
...o.maxTokens ? { maxTokens: o.maxTokens } : {},
|
|
14386
|
+
...o.signal ? { signal: o.signal } : {}
|
|
14387
|
+
}), o));
|
|
13590
14388
|
}
|
|
13591
14389
|
/** Answer a question about an image with the routed vision language model. VLM calls are serialized on one chain. */
|
|
13592
14390
|
function ask(hub, image, question, o = {}) {
|
|
13593
|
-
return hub.chain("vlm")(() => withModel(hub, target("vision.ask", o), (m) => m.ask(image, question,
|
|
14391
|
+
return hub.chain("vlm")(() => withModel(hub, target("vision.ask", o), (m) => m.ask(image, question, {
|
|
14392
|
+
...o.maxTokens ? { maxTokens: o.maxTokens } : {},
|
|
14393
|
+
...o.signal ? { signal: o.signal } : {}
|
|
14394
|
+
}), o));
|
|
13594
14395
|
}
|
|
13595
14396
|
var target;
|
|
13596
14397
|
var init_api = __esmMin((() => {
|
|
14398
|
+
init_janus();
|
|
13597
14399
|
init_loaders();
|
|
13598
14400
|
init_fastsam();
|
|
13599
14401
|
init_records();
|
|
@@ -13601,6 +14403,98 @@ var HackbuildAiViews = (function(exports) {
|
|
|
13601
14403
|
init_yolo();
|
|
13602
14404
|
target = (cap, o) => o.model ? { id: o.model } : cap;
|
|
13603
14405
|
}));
|
|
14406
|
+
// packages/vision/src/endpoint.ts
|
|
14407
|
+
function base64(bytes) {
|
|
14408
|
+
let s = "";
|
|
14409
|
+
for (let i = 0; i < bytes.length; i += 32768) s += String.fromCharCode(...bytes.subarray(i, i + 32768));
|
|
14410
|
+
return btoa(s);
|
|
14411
|
+
}
|
|
14412
|
+
/**
|
|
14413
|
+
* An image input as a URL an endpoint can read: a string passes through
|
|
14414
|
+
* (data or http URL), a Blob becomes a data URL, and pixels, canvases,
|
|
14415
|
+
* video frames and bitmaps are drawn and encoded as JPEG.
|
|
14416
|
+
*/
|
|
14417
|
+
async function imageUrl(image) {
|
|
14418
|
+
if (typeof image === "string") return image;
|
|
14419
|
+
if (typeof Blob !== "undefined" && image instanceof Blob) return `data:${image.type || "image/png"};base64,${base64(new Uint8Array(await image.arrayBuffer()))}`;
|
|
14420
|
+
const src = image;
|
|
14421
|
+
const w = src.videoWidth || src.displayWidth || src.width || 0;
|
|
14422
|
+
const h = src.videoHeight || src.displayHeight || src.height || 0;
|
|
14423
|
+
if (!w || !h || typeof OffscreenCanvas === "undefined") throw new Error("vision endpoint: pass a url, a blob, pixels or something a canvas can draw");
|
|
14424
|
+
const c = new OffscreenCanvas(w, h);
|
|
14425
|
+
const g = c.getContext("2d");
|
|
14426
|
+
if (isPixels(image)) g.putImageData(new ImageData(new Uint8ClampedArray(image.data), w, h), 0, 0);
|
|
14427
|
+
else g.drawImage(image, 0, 0, w, h);
|
|
14428
|
+
return imageUrl(await c.convertToBlob({
|
|
14429
|
+
type: "image/jpeg",
|
|
14430
|
+
quality: .85
|
|
14431
|
+
}));
|
|
14432
|
+
}
|
|
14433
|
+
/** The chat completions body for one image and one question. */
|
|
14434
|
+
function endpointBody(model, url, question, maxTokens) {
|
|
14435
|
+
return {
|
|
14436
|
+
model,
|
|
14437
|
+
stream: false,
|
|
14438
|
+
max_tokens: maxTokens,
|
|
14439
|
+
messages: [{
|
|
14440
|
+
role: "user",
|
|
14441
|
+
content: [{
|
|
14442
|
+
type: "text",
|
|
14443
|
+
text: question
|
|
14444
|
+
}, {
|
|
14445
|
+
type: "image_url",
|
|
14446
|
+
image_url: { url }
|
|
14447
|
+
}]
|
|
14448
|
+
}]
|
|
14449
|
+
};
|
|
14450
|
+
}
|
|
14451
|
+
/** A {@link Vlm} that asks the endpoint's model about each image. */
|
|
14452
|
+
function endpointVlm(o) {
|
|
14453
|
+
const f = o.fetch ?? globalThis.fetch.bind(globalThis);
|
|
14454
|
+
const url = o.base.replace(/\/+$/, "") + "/chat/completions";
|
|
14455
|
+
return { async ask(image, question, opts = {}) {
|
|
14456
|
+
const body = endpointBody(o.model, await (o.toUrl ?? imageUrl)(image), question ?? "Describe this image in one sentence.", opts.maxTokens ?? o.maxTokens ?? 128);
|
|
14457
|
+
const headers = {
|
|
14458
|
+
"content-type": "application/json",
|
|
14459
|
+
...o.headers
|
|
14460
|
+
};
|
|
14461
|
+
if (o.apiKey) headers.authorization = `Bearer ${o.apiKey}`;
|
|
14462
|
+
const res = await f(url, {
|
|
14463
|
+
method: "POST",
|
|
14464
|
+
headers,
|
|
14465
|
+
body: JSON.stringify(body),
|
|
14466
|
+
...opts.signal ? { signal: opts.signal } : {}
|
|
14467
|
+
});
|
|
14468
|
+
if (!res.ok) {
|
|
14469
|
+
const text = (await res.text()).slice(0, 200);
|
|
14470
|
+
throw new Error(`vision endpoint ${res.status}: ${o.apiKey ? text.split(o.apiKey).join("[key]") : text}`);
|
|
14471
|
+
}
|
|
14472
|
+
const c = (await res.json()).choices?.[0]?.message?.content;
|
|
14473
|
+
return (typeof c === "string" ? c : Array.isArray(c) ? c.map((p) => p.text ?? "").join("") : "").trim();
|
|
14474
|
+
} };
|
|
14475
|
+
}
|
|
14476
|
+
/**
|
|
14477
|
+
* The hub factory for remote vision records (`provider: "remote"`): each
|
|
14478
|
+
* record's `source.modelId` names the endpoint's model. A hub has one
|
|
14479
|
+
* factory per provider, so a hub that also runs remote chat passes that
|
|
14480
|
+
* factory as `others`, and records that are not vision go to it. Register
|
|
14481
|
+
* with `hub.provide("remote", endpointVisionProvider({ base, others }))`.
|
|
14482
|
+
*/
|
|
14483
|
+
function endpointVisionProvider(o) {
|
|
14484
|
+
const { others, ...vlm } = o;
|
|
14485
|
+
return async (ctx) => {
|
|
14486
|
+
if (ctx.record.provides.some((c) => c === "vision.ask" || c === "vision.caption")) return endpointVlm({
|
|
14487
|
+
...vlm,
|
|
14488
|
+
model: ctx.record.source.modelId ?? ctx.record.id
|
|
14489
|
+
});
|
|
14490
|
+
if (others) return others(ctx);
|
|
14491
|
+
throw new Error(`${ctx.record.id}: the vision endpoint runs vision records; pass others for the rest`);
|
|
14492
|
+
};
|
|
14493
|
+
}
|
|
14494
|
+
var isPixels;
|
|
14495
|
+
var init_endpoint = __esmMin((() => {
|
|
14496
|
+
isPixels = (x) => !!x && typeof x === "object" && typeof x.width === "number" && typeof x.height === "number" && !!x.data;
|
|
14497
|
+
}));
|
|
13604
14498
|
// packages/vision/src/mediapipe.ts
|
|
13605
14499
|
/** The URL @mediapipe/tasks-vision is imported from, on jsDelivr. */
|
|
13606
14500
|
function tasksVisionUrls(version = TASKS_VISION) {
|
|
@@ -15174,6 +16068,7 @@ self.onmessage = async (ev) => {
|
|
|
15174
16068
|
DEFAULT_REACTIONS: () => DEFAULT_REACTIONS,
|
|
15175
16069
|
DEPTH_WORKER_SOURCE: () => DEPTH_WORKER_SOURCE,
|
|
15176
16070
|
DETECT_SIZES: () => DETECT_SIZES,
|
|
16071
|
+
ENDPOINT_RECORDS: () => ENDPOINT_RECORDS,
|
|
15177
16072
|
EmbeddingCache: () => EmbeddingCache,
|
|
15178
16073
|
LOOK_PATTERN: () => LOOK_PATTERN,
|
|
15179
16074
|
MP_MODELS: () => MP_MODELS,
|
|
@@ -15209,6 +16104,9 @@ self.onmessage = async (ev) => {
|
|
|
15209
16104
|
edgeMask: () => edgeMask,
|
|
15210
16105
|
emptyMask: () => emptyMask,
|
|
15211
16106
|
encodePng: () => encodePng,
|
|
16107
|
+
endpointBody: () => endpointBody,
|
|
16108
|
+
endpointVisionProvider: () => endpointVisionProvider,
|
|
16109
|
+
endpointVlm: () => endpointVlm,
|
|
15212
16110
|
ensureRecord: () => ensureRecord,
|
|
15213
16111
|
exportInstances: () => exportInstances,
|
|
15214
16112
|
faceApiProvider: () => faceApiProvider,
|
|
@@ -15219,9 +16117,12 @@ self.onmessage = async (ev) => {
|
|
|
15219
16117
|
fixedVlm: () => fixedVlm,
|
|
15220
16118
|
gazeTarget: () => gazeTarget,
|
|
15221
16119
|
hasPrompt: () => hasPrompt,
|
|
16120
|
+
imageUrl: () => imageUrl,
|
|
15222
16121
|
instanceAt: () => instanceAt,
|
|
15223
16122
|
iou: () => iou,
|
|
15224
16123
|
isEnd2End: () => isEnd2End,
|
|
16124
|
+
janusLoader: () => janusLoader,
|
|
16125
|
+
janusTurn: () => janusTurn,
|
|
15225
16126
|
landmarkChain: () => landmarkChain,
|
|
15226
16127
|
landmarks: () => landmarks,
|
|
15227
16128
|
letterboxParams: () => letterboxParams,
|
|
@@ -15275,6 +16176,8 @@ self.onmessage = async (ev) => {
|
|
|
15275
16176
|
init_records();
|
|
15276
16177
|
init_api();
|
|
15277
16178
|
init_loaders();
|
|
16179
|
+
init_janus();
|
|
16180
|
+
init_endpoint();
|
|
15278
16181
|
init_mediapipe();
|
|
15279
16182
|
init_faceapi();
|
|
15280
16183
|
init_yolo();
|
|
@@ -18523,7 +19426,7 @@ self.onmessage = async (ev) => {
|
|
|
18523
19426
|
init_src$11();
|
|
18524
19427
|
/** Pinned CDN modules jobLoader imports at load time. */
|
|
18525
19428
|
const RUNTIME_URLS = {
|
|
18526
|
-
webllm: ["https://esm.run/@mlc-ai/web-llm@0.2.
|
|
19429
|
+
webllm: ["https://esm.run/@mlc-ai/web-llm@0.2.89", "https://cdn.jsdelivr.net/npm/@mlc-ai/web-llm@0.2.89/+esm"],
|
|
18527
19430
|
bellows: ["https://cdn.jsdelivr.net/npm/bellows-voice@0.8.0/engine/+esm"],
|
|
18528
19431
|
kokoro: ["https://cdn.jsdelivr.net/npm/kokoro-js@1.2.1/+esm"]
|
|
18529
19432
|
};
|
|
@@ -18585,6 +19488,8 @@ self.onmessage = async (ev) => {
|
|
|
18585
19488
|
tjs.loader("vision.caption", vision.vlmLoader);
|
|
18586
19489
|
tjs.loader("vision.ask", vision.vlmLoader);
|
|
18587
19490
|
tjs.loader("segment", vision.samLoader);
|
|
19491
|
+
tjs.loader("vision.janus", vision.janusLoader);
|
|
19492
|
+
tjs.loader("imagegen.janus", async (ctx) => (await Promise.resolve().then(() => (init_src$6(), src_exports$5))).janusImageLoader(ctx));
|
|
18588
19493
|
tjs.loader("chat", async (ctx) => {
|
|
18589
19494
|
const { createEngine } = await Promise.resolve().then(() => (init_src(), src_exports));
|
|
18590
19495
|
const generator = await ctx.tjs.pipeline("text-generation", ctx.record.source.modelId ?? ctx.record.id, ctx.options);
|
|
@@ -18639,7 +19544,8 @@ self.onmessage = async (ev) => {
|
|
|
18639
19544
|
async function webllmFactory(ctx, m) {
|
|
18640
19545
|
const w = await Promise.resolve().then(() => (init_webllm(), webllm_exports));
|
|
18641
19546
|
const mod = await (m.webllm ?? (() => importEsm(RUNTIME_URLS.webllm)))();
|
|
18642
|
-
const
|
|
19547
|
+
const rungId = ctx.rung.options?.modelId;
|
|
19548
|
+
const id = typeof rungId === "string" ? rungId : ctx.record.source.modelId ?? ctx.record.id;
|
|
18643
19549
|
return w.loadWebLLM({
|
|
18644
19550
|
module: mod,
|
|
18645
19551
|
modelId: id,
|
|
@@ -18868,7 +19774,7 @@ self.onmessage = async (ev) => {
|
|
|
18868
19774
|
}
|
|
18869
19775
|
case "image": {
|
|
18870
19776
|
const gen = await (await Promise.resolve().then(() => (init_src$6(), src_exports$5))).loadImagegen(hub, { id: rec.id }, { ...ctx.signal ? { signal: ctx.signal } : {} });
|
|
18871
|
-
const tokenize = await clipTokenizer(rt, gen.form.tokenizer);
|
|
19777
|
+
const tokenize = gen.form.pipeline === "janus" ? async () => /* @__PURE__ */ new Int32Array(0) : await clipTokenizer(rt, gen.form.tokenizer);
|
|
18872
19778
|
return Object.assign(gen, {
|
|
18873
19779
|
tokenize,
|
|
18874
19780
|
make: (o) => gen.generate(tokenize, o)
|