kolm — the AI compiler. Compile any task into a signed .kolm artifact that runs locally. RS-1 open spec, MIT.
2
stars
904
commits
JavaScript
primary language
Sep 10, 2026
updated
The AI compiler. Compile a task into a signed .kolm artifact you own, run it offline on any device, verify every output.
npm i -g github:kolm-ai/kolm
kolm build my-redactor --from redactor --yes # one-shot: scaffold + seeds + compile + verify
kolm run my-redactor.kolm '{"text":"call 555-1212"}'
The kolm build one-shot is the fastest path: it scaffolds the spec, drops in starter seeds, compiles, and verifies — printing the K-score, the failing cases (if any), and the exact iterate command. The four underlying verbs (kolm new, kolm seeds new, kolm compile, kolm verify) still exist for power use and CI:
kolm signup --email you@example.com # or: kolm login --key ks_... (paste from /signup)
kolm compile "your task" --examples ./examples.jsonl # cloud-compile w/ your frontier key
kolm run your-artifact.kolm "new input"
You bring your own frontier API key. kolm uses it once, during compile. The result is a single signed file with recipe code, examples, evaluator, and receipt chain. Runs on a laptop, phone, or in your VPC. Your data never moves.
If you'd rather talk to the CLI, kolm chat opens an interactive session that maps natural-language asks to real verbs — "make me a redactor recipe" runs kolm new --from redactor, "anonymize my customer data" runs kolm seeds generate --strategy redact-pii-templated, "upgrade kolm" runs kolm update. Add --airgap to keep it narration-only on disconnected boxes. kolm anonymize <file>.jsonl is a first-class shortcut for the same PII-templated seeds path with no LLM and no network.
Four new pillars land in this release. Each one is real code with a passing test file you can run today; nothing is a roadmap claim.
kolm moe compose — combine N expert .kolm files into a single composite with a deterministic router (keyword regex, intent_field, or first_match). The Kimi/Qwen MoE pattern, applied to compiled recipes: small experts, cheap routing, one signed artifact. Per-expert sha256 + recipe source hash + router spec live in training_stats.moe so the receipt chain captures the composition exactly. kolm moe inspect <composite.kolm> reads the block back.
kolm tokenize {train,encode,decode,inspect} — pure-JS byte-level BPE tokenizer (spec id kolm-tokenizer-1). Trains on a JSONL/text corpus, round-trips any UTF-8 input (the byte-level fallback guarantees it), serialises to a single tokenizer.json you can ship inside the .kolm. kolm compile --tokenizer tokenizer.json embeds it into the artifact and the manifest records tokenizer.spec, tokenizer.vocab_size, and tokenizer.sha256. No native deps.
kolm extract <file> — pure-JS text extraction front door for .kolm pipelines. Handles plain text, JSON/JSONL flatten, HTML tag strip with paragraph breaks, and a built-in PDF text-layer extractor that inflates FlateDecode content streams and walks BT/ET/Tj/TJ/'/" operators. Images require --ocr (shells out to tesseract if installed) or --vision (Anthropic vision API, needs ANTHROPIC_API_KEY); without one of those flags an image input fails with a clear error rather than silently producing empty text. Output ships { kind, text, pages?, source, sha256, warnings[] }.
kolm doc check <file> --type <spec> — multimodal document completeness gate. Five built-in specs (claim-packet, denial-letter, pa-request, eob, appeal-letter) cover the common health-insurance document classes; kolm doc types lists them. Custom specs are JSON conforming to kolm-docspec-1 with required_patterns, forbidden_patterns, required_sections, and word-count gates. Verdict is pass / warn / fail; the CLI exits 0 on pass-or-warn and 2 on fail so it composes with shell pipes and CI gates. Score is (required_passed + 0.5 * warn_passed) / total.
All four ship in pure JavaScript. None of them require a C, Rust, or Python toolchain. Heavy ML deps (real LoRA training, ONNX export, INT4 quantization) remain explicitly roadmap in the gates list below; this release does not pretend one class is another.
kolm was built around healthcare. The architecture supports BAA-bounded deployment so PHI never leaves the hosts your security team already trusts. Reference workloads: prior-auth triage, encounter-note drafting for sign-off, ICD-10 coding, intake routing, drug-name redaction. Every output carries an HMAC-bound receipt your clinical informatics committee can re-verify. See public/healthcare.html for the canonical positioning and the reference artifacts (hipaa-summarizer, intake-triage, drug-name-redact). BAA review is a per-customer step in Enterprise onboarding, not a generic template the product ships.
Other supported deployment shapes: finance (SR 11-7 model risk, examinable receipt chain), legal (privileged work inside the firm boundary), edge and offline.
Live: https://kolm.ai · Open spec: public/docs/rs-1.md · Apache-2.0 licensed.
This repository currently ships:
.kolm artifact packaging with manifest.json, recipes.json, evals.json, receipt.json, signature.sig, optional tokenizer.json, and optional moe.json for composite artifacts.KOLM_DATA_DIR support for safe test isolation.Implementation note: .kolm artifacts in v0.2 carry compiled JavaScript recipe code, the seed corpus, the evaluator, the receipt chain, and (when produced via kolm tokenize + kolm compile --tokenizer) a deterministic byte-level BPE tokenizer. They do not carry trained LoRA weights, ONNX graphs, INT4-quantized tensors, or sqlite-vec indexes — those remain explicit roadmap items. Where the code does its job today is rule-class transforms (redaction, normalization, classification with deterministic comparators), MoE composition of those recipes, and document completeness checks. The four features above are real and tested; the model-class artifacts named in the "Product Gates" section are not in this release.
Works on macOS, Linux, and Windows. Requires Node.js 20+ on PATH.
# macOS / Linux
cp .env.example .env
npm install
npm start
# Windows (PowerShell)
Copy-Item .env.example .env
npm install
npm start
Open:
http://localhost:8787/http://localhost:8787/docshttp://localhost:8787/benchmarkshttp://localhost:8787/securitynpm i -g github:kolm-ai/kolm
kolm version
This repository is public. The shortcut above resolves to
https://github.com/kolm-ai/kolm and npm clones it over HTTPS
with no auth. If the install hangs silently:
--verbose to see what npm is stuck on:
npm i -g github:kolm-ai/kolm --verbose
npm i -g git+https://github.com/kolm-ai/kolm.git
npm i -g https://github.com/kolm-ai/kolm/archive/refs/heads/main.tar.gz
kolm version
kolm doctor
kolm reads/writes ~/.kolm/ on macOS/Linux and %USERPROFILE%\.kolm\ on Windows (via Node's os.homedir()). All shell-out hooks branch on process.platform to use /bin/sh -c on POSIX and cmd /c on Windows.
The canonical install is always the GitHub repo above (not the unrelated kolm
package on the public npm registry). kolm upgrade reads the version off the
GitHub main branch's package.json to compare; kolm update re-runs the GitHub
install one-shot.
Run tests:
npm test
The tests boot isolated servers on dynamic ports and write to temporary data directories. They should not mutate the real data/ directory.
Set these before hosting anything public:
ADMIN_KEY=ks_admin_<random>
RECIPE_RECEIPT_SECRET=ks_receipt_<random>
KOLM_DATA_DIR=/path/to/durable/data
KOLM_ARTIFACT_DIR=/path/to/durable/artifacts
KOLM_RECALL_ROOT=/path/to/recall/root
INVITE_ONLY=true
Optional provider config:
ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=claude-opus-4-7
RATE_LIMIT_PER_SEC=20
RATE_LIMIT_BURST=60
Production behavior:
ADMIN_KEY has no development fallback in production-like hosts.RECIPE_RECEIPT_SECRET is required for receipt verification and .kolm artifact signing in production-like hosts./v1/wrap/verified and /v1/verified-inference require a valid tenant key./health is intentionally minimal and should be used for uptime only./ready is the deploy gate. In production-like hosts it returns 503 until critical signing config is present./v1/health contains the fuller runtime snapshot and readiness detail for staff.Public:
GET /healthGET /readyGET /v1/pricingPOST /v1/signupPOST /v1/signinPOST /v1/signoutPOST /v1/anon/bootstrapPOST /v1/anon/claimGET /v1/public/conceptsGET /v1/public/concepts/:idPOST /v1/public/runPOST /v1/receipts/verifyGET /v1/specGET /v1/registry/exportAuthenticated:
GET /v1/healthPOST /v1/compileGET /v1/compileGET /v1/compile/:idGET /v1/compile/:id/.kolmGET /v1/artifactsGET /v1/artifacts/:idGET /v1/artifacts/:id/downloadPOST /v1/wrap/verifiedPOST /v1/verified-inferencePOST /v1/recallPOST /v1/embedGET /v1/recall/statusGET /v1/accountPOST /v1/account/rotate-keyPOST /v1/synthesizePOST /v1/synthesize/streamPOST /v1/synthesize/batchPOST /v1/verifyPOST /v1/publishGET /v1/conceptsPOST /v1/runPOST /v1/composeGET /v1/telemetryGET /v1/libraryAdmin:
POST /v1/admin/tenantGET /v1/admin/tenantsGET /v1/admin/waitlistGET /v1/admin/submissionsThe API is a single Express server:
server.js mounts security headers, static pages, docs aliases, public routes, API routes, and branded error pages.src/router.js owns HTTP routing, auth boundaries, receipt verification, compile endpoints, registry export, and legacy recipe endpoints.src/auth.js provisions tenants, validates API keys, rotates keys, applies usage limits, and disables fallback admin auth in production.src/env.js centralizes production detection and receipt-secret selection.src/compile.js runs the v0 compile job state machine.src/artifact.js builds and signs .kolm zip artifacts.src/store.js is a JSON-backed store with KOLM_DATA_DIR override.tests/*.test.js cover auth hardening, e2e behavior, production proxy config, route/assets resolution, sitemap rules, and brand-token drift.The built-in JSON store is acceptable for demos, local development, and single-node prototypes. It is not the final multi-tenant production database.
Before serious public launch, swap it for a durable transactional store:
| Current | Production target |
|---|---|
JSON files in KOLM_DATA_DIR | Postgres, SQLite with backups, or D1 |
| In-memory rate counters | Redis-backed token buckets |
| Single-node artifact disk | Object storage with signed URLs |
| In-memory compile job cache | Durable job queue |
| Inline scripts on static pages | External JS and stricter CSP |
INVITE_ONLY=true until abuse controls and billing are ready.RECIPE_RECEIPT_SECRET stable; rotating it invalidates prior receipts.npm test before deploy./robots.txt excludes /v1/, /api/, /admin, /dashboard, /onboarding, and /signin.The next gates before claiming full terminal-state parity with the public positioning:
.kolm artifacts.Apache-2.0. See LICENSE.
904 commits
JavaScript
63.9%
HTML
28.1%
Python
5.1%
TypeScript
1.3%
kolm — the AI compiler. Compile any task into a signed .kolm artifact that runs locally. RS-1 open spec, MIT.
2
stars
904
commits
JavaScript
primary language
Sep 10, 2026
updated
The AI compiler. Compile a task into a signed .kolm artifact you own, run it offline on any device, verify every output.
npm i -g github:kolm-ai/kolm
kolm build my-redactor --from redactor --yes # one-shot: scaffold + seeds + compile + verify
kolm run my-redactor.kolm '{"text":"call 555-1212"}'
The kolm build one-shot is the fastest path: it scaffolds the spec, drops in starter seeds, compiles, and verifies — printing the K-score, the failing cases (if any), and the exact iterate command. The four underlying verbs (kolm new, kolm seeds new, kolm compile, kolm verify) still exist for power use and CI:
kolm signup --email you@example.com # or: kolm login --key ks_... (paste from /signup)
kolm compile "your task" --examples ./examples.jsonl # cloud-compile w/ your frontier key
kolm run your-artifact.kolm "new input"
You bring your own frontier API key. kolm uses it once, during compile. The result is a single signed file with recipe code, examples, evaluator, and receipt chain. Runs on a laptop, phone, or in your VPC. Your data never moves.
If you'd rather talk to the CLI, kolm chat opens an interactive session that maps natural-language asks to real verbs — "make me a redactor recipe" runs kolm new --from redactor, "anonymize my customer data" runs kolm seeds generate --strategy redact-pii-templated, "upgrade kolm" runs kolm update. Add --airgap to keep it narration-only on disconnected boxes. kolm anonymize <file>.jsonl is a first-class shortcut for the same PII-templated seeds path with no LLM and no network.
Four new pillars land in this release. Each one is real code with a passing test file you can run today; nothing is a roadmap claim.
kolm moe compose — combine N expert .kolm files into a single composite with a deterministic router (keyword regex, intent_field, or first_match). The Kimi/Qwen MoE pattern, applied to compiled recipes: small experts, cheap routing, one signed artifact. Per-expert sha256 + recipe source hash + router spec live in training_stats.moe so the receipt chain captures the composition exactly. kolm moe inspect <composite.kolm> reads the block back.
kolm tokenize {train,encode,decode,inspect} — pure-JS byte-level BPE tokenizer (spec id kolm-tokenizer-1). Trains on a JSONL/text corpus, round-trips any UTF-8 input (the byte-level fallback guarantees it), serialises to a single tokenizer.json you can ship inside the .kolm. kolm compile --tokenizer tokenizer.json embeds it into the artifact and the manifest records tokenizer.spec, tokenizer.vocab_size, and tokenizer.sha256. No native deps.
kolm extract <file> — pure-JS text extraction front door for .kolm pipelines. Handles plain text, JSON/JSONL flatten, HTML tag strip with paragraph breaks, and a built-in PDF text-layer extractor that inflates FlateDecode content streams and walks BT/ET/Tj/TJ/'/" operators. Images require --ocr (shells out to tesseract if installed) or --vision (Anthropic vision API, needs ANTHROPIC_API_KEY); without one of those flags an image input fails with a clear error rather than silently producing empty text. Output ships { kind, text, pages?, source, sha256, warnings[] }.
kolm doc check <file> --type <spec> — multimodal document completeness gate. Five built-in specs (claim-packet, denial-letter, pa-request, eob, appeal-letter) cover the common health-insurance document classes; kolm doc types lists them. Custom specs are JSON conforming to kolm-docspec-1 with required_patterns, forbidden_patterns, required_sections, and word-count gates. Verdict is pass / warn / fail; the CLI exits 0 on pass-or-warn and 2 on fail so it composes with shell pipes and CI gates. Score is (required_passed + 0.5 * warn_passed) / total.
All four ship in pure JavaScript. None of them require a C, Rust, or Python toolchain. Heavy ML deps (real LoRA training, ONNX export, INT4 quantization) remain explicitly roadmap in the gates list below; this release does not pretend one class is another.
kolm was built around healthcare. The architecture supports BAA-bounded deployment so PHI never leaves the hosts your security team already trusts. Reference workloads: prior-auth triage, encounter-note drafting for sign-off, ICD-10 coding, intake routing, drug-name redaction. Every output carries an HMAC-bound receipt your clinical informatics committee can re-verify. See public/healthcare.html for the canonical positioning and the reference artifacts (hipaa-summarizer, intake-triage, drug-name-redact). BAA review is a per-customer step in Enterprise onboarding, not a generic template the product ships.
Other supported deployment shapes: finance (SR 11-7 model risk, examinable receipt chain), legal (privileged work inside the firm boundary), edge and offline.
Live: https://kolm.ai · Open spec: public/docs/rs-1.md · Apache-2.0 licensed.
This repository currently ships:
.kolm artifact packaging with manifest.json, recipes.json, evals.json, receipt.json, signature.sig, optional tokenizer.json, and optional moe.json for composite artifacts.KOLM_DATA_DIR support for safe test isolation.Implementation note: .kolm artifacts in v0.2 carry compiled JavaScript recipe code, the seed corpus, the evaluator, the receipt chain, and (when produced via kolm tokenize + kolm compile --tokenizer) a deterministic byte-level BPE tokenizer. They do not carry trained LoRA weights, ONNX graphs, INT4-quantized tensors, or sqlite-vec indexes — those remain explicit roadmap items. Where the code does its job today is rule-class transforms (redaction, normalization, classification with deterministic comparators), MoE composition of those recipes, and document completeness checks. The four features above are real and tested; the model-class artifacts named in the "Product Gates" section are not in this release.
Works on macOS, Linux, and Windows. Requires Node.js 20+ on PATH.
# macOS / Linux
cp .env.example .env
npm install
npm start
# Windows (PowerShell)
Copy-Item .env.example .env
npm install
npm start
Open:
http://localhost:8787/http://localhost:8787/docshttp://localhost:8787/benchmarkshttp://localhost:8787/securitynpm i -g github:kolm-ai/kolm
kolm version
This repository is public. The shortcut above resolves to
https://github.com/kolm-ai/kolm and npm clones it over HTTPS
with no auth. If the install hangs silently:
--verbose to see what npm is stuck on:
npm i -g github:kolm-ai/kolm --verbose
npm i -g git+https://github.com/kolm-ai/kolm.git
npm i -g https://github.com/kolm-ai/kolm/archive/refs/heads/main.tar.gz
kolm version
kolm doctor
kolm reads/writes ~/.kolm/ on macOS/Linux and %USERPROFILE%\.kolm\ on Windows (via Node's os.homedir()). All shell-out hooks branch on process.platform to use /bin/sh -c on POSIX and cmd /c on Windows.
The canonical install is always the GitHub repo above (not the unrelated kolm
package on the public npm registry). kolm upgrade reads the version off the
GitHub main branch's package.json to compare; kolm update re-runs the GitHub
install one-shot.
Run tests:
npm test
The tests boot isolated servers on dynamic ports and write to temporary data directories. They should not mutate the real data/ directory.
Set these before hosting anything public:
ADMIN_KEY=ks_admin_<random>
RECIPE_RECEIPT_SECRET=ks_receipt_<random>
KOLM_DATA_DIR=/path/to/durable/data
KOLM_ARTIFACT_DIR=/path/to/durable/artifacts
KOLM_RECALL_ROOT=/path/to/recall/root
INVITE_ONLY=true
Optional provider config:
ANTHROPIC_API_KEY=
ANTHROPIC_MODEL=claude-opus-4-7
RATE_LIMIT_PER_SEC=20
RATE_LIMIT_BURST=60
Production behavior:
ADMIN_KEY has no development fallback in production-like hosts.RECIPE_RECEIPT_SECRET is required for receipt verification and .kolm artifact signing in production-like hosts./v1/wrap/verified and /v1/verified-inference require a valid tenant key./health is intentionally minimal and should be used for uptime only./ready is the deploy gate. In production-like hosts it returns 503 until critical signing config is present./v1/health contains the fuller runtime snapshot and readiness detail for staff.Public:
GET /healthGET /readyGET /v1/pricingPOST /v1/signupPOST /v1/signinPOST /v1/signoutPOST /v1/anon/bootstrapPOST /v1/anon/claimGET /v1/public/conceptsGET /v1/public/concepts/:idPOST /v1/public/runPOST /v1/receipts/verifyGET /v1/specGET /v1/registry/exportAuthenticated:
GET /v1/healthPOST /v1/compileGET /v1/compileGET /v1/compile/:idGET /v1/compile/:id/.kolmGET /v1/artifactsGET /v1/artifacts/:idGET /v1/artifacts/:id/downloadPOST /v1/wrap/verifiedPOST /v1/verified-inferencePOST /v1/recallPOST /v1/embedGET /v1/recall/statusGET /v1/accountPOST /v1/account/rotate-keyPOST /v1/synthesizePOST /v1/synthesize/streamPOST /v1/synthesize/batchPOST /v1/verifyPOST /v1/publishGET /v1/conceptsPOST /v1/runPOST /v1/composeGET /v1/telemetryGET /v1/libraryAdmin:
POST /v1/admin/tenantGET /v1/admin/tenantsGET /v1/admin/waitlistGET /v1/admin/submissionsThe API is a single Express server:
server.js mounts security headers, static pages, docs aliases, public routes, API routes, and branded error pages.src/router.js owns HTTP routing, auth boundaries, receipt verification, compile endpoints, registry export, and legacy recipe endpoints.src/auth.js provisions tenants, validates API keys, rotates keys, applies usage limits, and disables fallback admin auth in production.src/env.js centralizes production detection and receipt-secret selection.src/compile.js runs the v0 compile job state machine.src/artifact.js builds and signs .kolm zip artifacts.src/store.js is a JSON-backed store with KOLM_DATA_DIR override.tests/*.test.js cover auth hardening, e2e behavior, production proxy config, route/assets resolution, sitemap rules, and brand-token drift.The built-in JSON store is acceptable for demos, local development, and single-node prototypes. It is not the final multi-tenant production database.
Before serious public launch, swap it for a durable transactional store:
| Current | Production target |
|---|---|
JSON files in KOLM_DATA_DIR | Postgres, SQLite with backups, or D1 |
| In-memory rate counters | Redis-backed token buckets |
| Single-node artifact disk | Object storage with signed URLs |
| In-memory compile job cache | Durable job queue |
| Inline scripts on static pages | External JS and stricter CSP |
INVITE_ONLY=true until abuse controls and billing are ready.RECIPE_RECEIPT_SECRET stable; rotating it invalidates prior receipts.npm test before deploy./robots.txt excludes /v1/, /api/, /admin, /dashboard, /onboarding, and /signin.The next gates before claiming full terminal-state parity with the public positioning:
.kolm artifacts.Apache-2.0. See LICENSE.
904 commits
JavaScript
63.9%
HTML
28.1%
Python
5.1%
TypeScript
1.3%