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.
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.
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.
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);
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.
One model-first call for complex app tasks. Pass intent, input, schema, context, tools, and validators; get structured output with confidence and review state.
The model can request app actions, but your code executes them. Validators gate totals, required fields, permissions, and confidence before data changes.
Instruction-driven rewrites for focused data: formulas, DSL snippets, field values, and structured text. Fast paths stay deterministic; weird asks escalate locally.
Keystroke-level help for inputs and textareas: autofill, contextual spellcheck, and smart paste. These are the narrow UX primitives underneath larger workflows.
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.
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.
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?
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.
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.
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",
});
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.
Workflow, Transform, and Reflex. That includes Workflow.run, SmartField, SmartForm, SmartText, smart paste, formula transform, formula explain, and formula debug.
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.
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.