@tryhamster/gerbil 1.1.2 → 1.1.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.
Files changed (62) hide show
  1. package/README.md +18 -16
  2. package/dist/cli.mjs +1 -1
  3. package/dist/cli.mjs.map +1 -1
  4. package/dist/gpu/hooks.d.mts +3 -3
  5. package/dist/gpu/hooks.mjs +5 -5
  6. package/dist/gpu/hooks.mjs.map +1 -1
  7. package/dist/index-Dgmb2kE3.d.mts.map +1 -1
  8. package/package.json +1 -2
  9. package/docs/PROJECT-STATE.md +0 -321
  10. package/docs/adding-a-model-family.md +0 -280
  11. package/docs/ai-sdk.md +0 -205
  12. package/docs/architecture/README.md +0 -84
  13. package/docs/architecture/caching.md +0 -227
  14. package/docs/architecture/inference.md +0 -176
  15. package/docs/architecture/overview.md +0 -189
  16. package/docs/architecture/streaming.md +0 -261
  17. package/docs/architecture/webgpu.md +0 -213
  18. package/docs/browser.md +0 -762
  19. package/docs/cli.md +0 -155
  20. package/docs/embeddings.md +0 -156
  21. package/docs/frameworks.md +0 -90
  22. package/docs/gerbil-site-native-migration.md +0 -217
  23. package/docs/gpu-engine/architectures.md +0 -398
  24. package/docs/gpu-engine/ir.md +0 -372
  25. package/docs/gpu-engine/kernels.md +0 -718
  26. package/docs/gpu-engine/paper.html +0 -1759
  27. package/docs/gpu-engine/paper.md +0 -2109
  28. package/docs/gpu-engine/safetensors.md +0 -312
  29. package/docs/gpu-engine/tokenizer.md +0 -302
  30. package/docs/kernel-research-queue.md +0 -85
  31. package/docs/mcp-client.md +0 -224
  32. package/docs/mcp.md +0 -109
  33. package/docs/memory-rag.md +0 -91
  34. package/docs/memory.md +0 -301
  35. package/docs/metal-safari-intel.md +0 -190
  36. package/docs/mobile-failure-diagnosis.md +0 -124
  37. package/docs/mobile.md +0 -99
  38. package/docs/observability.md +0 -230
  39. package/docs/onnx-removal-plan.md +0 -339
  40. package/docs/repl.md +0 -473
  41. package/docs/research/autoresearch-portable.md +0 -933
  42. package/docs/research/dispatch-reduction-hivemind.md +0 -84
  43. package/docs/research/ios-safari-model-caching.md +0 -117
  44. package/docs/research/mobile-webgpu-speed-fusion.md +0 -135
  45. package/docs/research/native-stt-model-selection.md +0 -49
  46. package/docs/research/native-tts-model-selection.md +0 -90
  47. package/docs/research/native-vs-chromium-decision.md +0 -152
  48. package/docs/research/nemotron-mamba2-inference.md +0 -910
  49. package/docs/research/qwen35-multimodal.md +0 -293
  50. package/docs/research/qwen36-gemma4-targets.md +0 -337
  51. package/docs/research/sota-embedding-models.md +0 -179
  52. package/docs/research/sota-mobile-models-2026.md +0 -263
  53. package/docs/research/sota-modality-models.md +0 -202
  54. package/docs/research/tps-baselines.md +0 -71
  55. package/docs/research/webgpu-m4-reference.md +0 -104
  56. package/docs/site-update-plan.md +0 -155
  57. package/docs/skills.md +0 -261
  58. package/docs/structured-output.md +0 -123
  59. package/docs/stt.md +0 -111
  60. package/docs/tools.md +0 -304
  61. package/docs/tts.md +0 -147
  62. package/docs/vision.md +0 -158
package/README.md CHANGED
@@ -123,12 +123,12 @@ For a copy-pasteable version see [`examples/benchmark.ts`](./examples/benchmark.
123
123
 
124
124
  ## React Quickstart
125
125
 
126
- `useEngine` (from `@tryhamster/gerbil/gpu/hooks`) owns the full engine lifecycle —
126
+ `useEngine` (from `@tryhamster/gerbil/hooks`) owns the full engine lifecycle —
127
127
  load, unload, hot-swap on config change, and reference-counted sharing so multiple
128
128
  components never upload the same weights to the GPU twice.
129
129
 
130
130
  ```tsx
131
- import { useEngine } from "@tryhamster/gerbil/gpu/hooks";
131
+ import { useEngine } from "@tryhamster/gerbil/hooks";
132
132
 
133
133
  function Chat() {
134
134
  const { complete, completion, isLoading, isGenerating, tps } = useEngine({
@@ -156,7 +156,7 @@ and `dispose`. Pass `enableVision: true` or `embedding: true` to load those moda
156
156
  until the engine is ready — and keep it warm across navigation (no GPU re-upload):
157
157
 
158
158
  ```tsx
159
- import { GerbilGate } from "@tryhamster/gerbil/gpu/hooks";
159
+ import { GerbilGate } from "@tryhamster/gerbil/hooks";
160
160
 
161
161
  <GerbilGate
162
162
  model="mlx-community/Qwen3.5-0.8B-4bit"
@@ -199,10 +199,10 @@ const engine = await WebGPUEngine.create({ repo: "mlx-community/Qwen3.5-0.8B-4bi
199
199
  await engine.generateObject("…", { schema: { required: ["title"] } });
200
200
  ```
201
201
 
202
- In React, use `useObject` (from `@tryhamster/gerbil/gpu/hooks`):
202
+ In React, use `useObject` (from `@tryhamster/gerbil/hooks`):
203
203
 
204
204
  ```tsx
205
- import { useObject } from "@tryhamster/gerbil/gpu/hooks";
205
+ import { useObject } from "@tryhamster/gerbil/hooks";
206
206
 
207
207
  const { generate, object, isGenerating } = useObject<{ city: string }>();
208
208
  await generate("Extract the city from: I live in Paris", {
@@ -322,17 +322,19 @@ const skill = useSkill("my-skill");
322
322
 
323
323
  ## Tools & Agents
324
324
 
325
- Gerbil supports tool calling with Qwen3 models for agentic workflows:
325
+ Gerbil supports tool calling with Qwen3 models for agentic workflows. A tool is a
326
+ plain object (`AgentTool`) — give it a `name`, `description`, optional `parameters`,
327
+ and an `execute` function:
326
328
 
327
329
  ```typescript
328
- import { defineTool, executeToolCall } from "@tryhamster/gerbil";
330
+ import type { AgentTool } from "@tryhamster/gerbil/gpu";
329
331
 
330
- const weatherTool = defineTool({
332
+ const weatherTool: AgentTool = {
331
333
  name: "get_weather",
332
334
  description: "Get weather for a city",
333
- parameters: z.object({ city: z.string() }),
334
- execute: async ({ city }) => `Weather in ${city}: 72°F, sunny`,
335
- });
335
+ parameters: { city: "string" },
336
+ execute: ({ city }) => `Weather in ${city}: 72°F, sunny`,
337
+ };
336
338
  ```
337
339
 
338
340
  **Agentic loop, on-device.** `engine.generateWithTools` (and the `useAgent` React hook)
@@ -340,7 +342,7 @@ run the whole loop — generate → call a tool → feed the result back → rep
340
342
  step trace for UIs:
341
343
 
342
344
  ```tsx
343
- import { useAgent } from "@tryhamster/gerbil/gpu/hooks";
345
+ import { useAgent } from "@tryhamster/gerbil/hooks";
344
346
 
345
347
  const { run, steps, answer, isRunning } = useAgent({
346
348
  model: "mlx-community/Qwen3.5-0.8B-4bit",
@@ -377,7 +379,7 @@ Inline autocomplete — `engine.autocomplete(prefix)` and the debounced `useAuto
377
379
  hook return a brief single-line continuation (low-latency defaults + cleanup):
378
380
 
379
381
  ```tsx
380
- import { useAutocomplete } from "@tryhamster/gerbil/gpu/hooks";
382
+ import { useAutocomplete } from "@tryhamster/gerbil/hooks";
381
383
 
382
384
  const { suggestion, onInput, accept, dismiss } = useAutocomplete({
383
385
  model: "mlx-community/Qwen3.5-0.8B-4bit",
@@ -418,10 +420,10 @@ gerbil update # Update to latest version
418
420
  ## Browser Usage
419
421
 
420
422
  Run LLMs directly in the browser with WebGPU — no server required. The React hooks
421
- live at `@tryhamster/gerbil/gpu/hooks` and run pure WebGPU compute:
423
+ live at `@tryhamster/gerbil/hooks` and run pure WebGPU compute:
422
424
 
423
425
  ```tsx
424
- import { useChat } from "@tryhamster/gerbil/gpu/hooks";
426
+ import { useChat } from "@tryhamster/gerbil/hooks";
425
427
 
426
428
  function Chat() {
427
429
  const { messages, send, isLoading, isGenerating } = useChat();
@@ -454,7 +456,7 @@ function Chat() {
454
456
  | **LangChain** | `@tryhamster/gerbil/langchain` | [📖 LangChain](https://gerbilsdk.com/docs/frameworks/langchain) |
455
457
  | **MCP Server** | `npx @tryhamster/gerbil serve --mcp` | [📖 MCP](https://gerbilsdk.com/docs/mcp) |
456
458
 
457
- **Native engine:** `import { WebGPUEngine } from "@tryhamster/gerbil/gpu"` (or `useEngine` from `@tryhamster/gerbil/gpu/hooks` for React) is the primary surface for text, vision, embeddings, and speech.
459
+ **Native engine:** `import { WebGPUEngine } from "@tryhamster/gerbil/gpu"` (or `useEngine` from `@tryhamster/gerbil/hooks` for React) is the primary surface for text, vision, embeddings, and speech.
458
460
 
459
461
  ## Supported Models
460
462
 
package/dist/cli.mjs CHANGED
@@ -24,7 +24,7 @@ import TextInput from "ink-text-input";
24
24
  import http from "node:http";
25
25
 
26
26
  //#region package.json
27
- var version = "1.1.2";
27
+ var version = "1.1.3";
28
28
 
29
29
  //#endregion
30
30
  //#region src/cli/repl/auto-update.ts