open source · Apache-2.0 · browser-local LLM workflows

Dhamaka

Ship the model to the data. Dhamaka gives web apps a model-first workflow layer: local LLMs read private app context, reason over complex tasks, request app tools, and return validated structured output in the browser tab.

Product surface

Let the browser model do the hard app work.

Workflow is the core Dhamaka API. Give it user intent, focused input, app state, schema, available actions, and validators. The local model handles the messy reasoning; your app keeps control over tools, permissions, and whether the answer can be applied.

This is for real product work: invoice imports, formula changes, policy checks, schema mapping, CRM cleanup, spreadsheet edits, and internal operations where the context is sensitive and the workflow is too complex for a handful of regexes.

workflow.js model first · validated output
import { Workflow } from "dhamaka";

const workflow = new Workflow({ backend: "auto" });

const result = await workflow.run({
  intent: "Turn this invoice email into an AP draft.",
  input: emailText,
  context: {
    vendorSchema,
    openPurchaseOrders,
    selectedCompany,
  },
  schema: {
    invoiceNo: "string",
    total: "number",
    dueDate: "string",
    reviewFlags: ["string"],
  },
  tools: [{
    name: "matchPurchaseOrder",
    description: "Find a likely PO by vendor and amount",
    run: ({ vendor, total }) => matchPurchaseOrder(vendor, total),
  }],
  validators: [
    (r) => r.output.total > 0 || "missing total",
    (r) => r.confidence >= 0.7 || "low confidence",
  ],
});

if (!result.needsReview) applyDraft(result.output);
./demos/autofill.html small surface · same local runtime

Shipping address

source: - confidence: - latency: - ms
Location Private context stays in the browser tab
Network No provider calls by default
Cost $0 per local model call
Status Workflow, Transform, and Reflex ship today
License Open source under Apache-2.0
Capability families

Model-first workflows, with deterministic rails.

Dhamaka sits above the browser Prompt API, Transformers.js, WASM, and mock engines. The model does the reasoning over app context; deterministic code provides tools, calculators, parsers, and validators so products can trust what gets applied.

Workflow

One model-first call for complex app tasks. Pass intent, input, schema, context, tools, and validators; get structured output with confidence and review state.

Workflow.run schema-aware tool calls needsReview

Tools and validators

The model can request app actions, but your code executes them. Validators gate totals, required fields, permissions, and confidence before data changes.

calculators lookups policy checks apply gates

Transform

Instruction-driven rewrites for focused data: formulas, DSL snippets, field values, and structured text. Fast paths stay deterministic; weird asks escalate locally.

formula-transform formula-explain formula-debug

Reflex

Keystroke-level help for inputs and textareas: autofill, contextual spellcheck, and smart paste. These are the narrow UX primitives underneath larger workflows.

SmartField SmartForm SmartText smart paste
Hero case

Complex app work, without shipping the app away.

ERP formulas, invoice imports, payroll checks, pricing rules, and compliance edits all need sensitive context. Dhamaka lets products reason over that context in the tab, call local tools for exact calculations, and return an answer the app can validate before applying.

Workflow.run() source: local model + validators

A user selects a tax formula and asks for an employee discount. The local model understands the request, the formula tool performs the structural edit, and validators check that the output is still a formula and that the discount is explicit.

intent: add a 10% employee discount
input: =SUM(A1:A10) * 1.08
tool: rewriteFormula({ discount: 0.10 })
output: =(SUM(A1:A10) * 1.08) * 0.9
review: false, confidence: 0.94
Architecture

The model reasons; the app stays in control.

Dhamaka optimizes for a simple test: can the browser model use the same private state the app already has, produce structured output, and let code verify it before anything changes?

your app
State, schema, permissions, selections, draftsThe product already holds the context a remote model would have to be sent.
workflow
Workflow.run({ intent, input, context, schema, tools, validators })The app asks for complex work in one structured call instead of wiring a chatbot beside the product.
local model
LanguageModel -> Transformers.js -> WASM -> MockEngineThe SDK keeps one surface while the runtime picks the best available browser-local backend.
tools
Calculators, lookups, parsers, rewritesThe model can request actions, but deterministic app code executes them and returns exact results.
trust
Validators, confidence, needsReviewEvery workflow result is inspectable before the UI applies it to business data.
Evals

The local rails are measured, so model workflows stay honest.

Latest local eval run: May 24, 2026 on Apple Silicon, Node v22.22.2, and headless Chromium. The task pipeline measures deterministic tools and validators; browser evals measure real page load, debounce, DOM updates, and user-visible results.

Task p99 98.5 µs fuzzy city match
Autofill 299 ms type to result
Spellcheck 189 ms to suggestion
Paste 18 ms blob to fields
Network 0 external requests
Install

One package. No provider account.

Install the public SDK and attach Dhamaka where your app already has intent and context: import screens, spreadsheets, internal tools, form fields, textareas, and workflow-heavy product surfaces.

quickstart.js dhamaka@0.1.0
import { Workflow, Transform } from "dhamaka";

const workflow = new Workflow({ backend: "auto" });

const result = await workflow.run({
  intent: "Map this CSV import to our customer schema.",
  input: pastedCsv,
  context: {
    schema: customerSchema,
    duplicatePolicy: "flag-review",
  },
  validators: [
    (r) => r.output.email || "missing email",
  ],
});

if (result.needsReview) showReview(result);
else saveCustomer(result.output);

await Transform.run({
  task: "formula-transform",
  input: "=SUM(A1:A10)",
  instruction: "add 8% tax",
});
FAQ

Browser-local AI, built for real product work.

Is Dhamaka a model runtime?

Not primarily. Dhamaka is the workflow and capability layer above browser model runtimes. It gives apps a stable API for intent, context, tools, validators, and structured output.

What ships today?

Workflow, Transform, and Reflex. That includes Workflow.run, SmartField, SmartForm, SmartText, smart paste, formula transform, formula explain, and formula debug.

What if the browser model is unavailable?

The API stays the same. Dhamaka falls back through Transformers.js, WASM, and MockEngine depending on the environment, so products can feature-detect capability without changing workflow code.

Why local?

Complex workflows need private app context: schemas, formulas, rows, permissions, customer data, and drafts. Keeping the model local avoids provider calls while preserving low-latency UX.