What compounds when you integrate.
Steadily improving loop
Every outcome you report trains the shared model. The router you integrate today is the worst one you'll ever run. It gets sharper using results from every harness on the protocol, not just yours, and you didn't have to build it.
Route across your real model pool
Hokusai only routes among models you explicitly make available. Add the models your harness can actually run, report outcomes, and keep improving the layer that chooses between them.
Lower inference cost
The router picks the right model for each task instead of sending everything to the biggest one. You spend less on inference before a single token is counted.
A stake in what you improve
Outcome data that measurably improves the router mints HTASK to you — a position in its per-decision fee stream, held as ownership or redeemed for USDC anytime. Keep it as revenue, pass it through to your users, or split it.
Coding / Multi-Model Routing
Coding Task Router
Hokusai's first router corpus comes from real autonomous coding evals, not synthetic routing examples.
696
Deduplicated router-training records
209
Challenge-mode routing examples
85
Head-to-head model comparisons
88%
Migration, feature, and bugfix work
The data spans migrations, features, bug fixes, infra, tests, refactors, and docs across TypeScript, JavaScript, Python, Bash, and mixed-language repos. This provides a decent starting point for learning routing behavior while leaving clear room to expand coverage across more repositories, languages, and task families.
Integration
Install the shipped router.
Install @hokusai/router, pass the models your harness can actually run, execute the selected model yourself, then report coarse outcomes for learning.
npm install @hokusai/router
export HOKUSAI_API_KEY=hk_live_your_key_hereimport { createRouter } from '@hokusai/router'
const models = {
'claude-sonnet-4-6': { run: async (task) => ({ ok: true }) },
'gpt-5': { run: async (task) => ({ ok: true }) },
}
const modelPool = Object.keys(models)
const router = createRouter({
availableModels: modelPool,
})
const task = 'Refactor billing webhook retry handling.'
const decision = await router({
task,
context: { language: 'typescript', task_type: 'refactor' },
availableModels: modelPool,
objective: 'reliability',
maxCostUsd: 1,
})
const result = await models[decision.model].run(task)
await router.reportOutcome({
correlationId: decision.correlationId,
model: decision.model,
status: result.ok ? 'succeeded' : 'failed',
latency: 'medium',
cost: 'medium',
tokens: 'medium',
})Where does your routing data go today?
| Lab-owned auto-routing | Hokusai | |
|---|---|---|
| Who pays for routing decisions | The lab keeps it as gross margin | Integrators pay; fees back the contributor token. |
| Who captures the optimization signal | The lab | You and the contributors |
| Who keeps the inference cost savings | The lab keeps margin | You |
| What you build over time | Nothing transferable | A token position in the router |
| Portability across harnesses | Locked in | Take your position with you |
| Auditability | Opaque | On-chain attribution |
Future decision layers
The shipped SDK surface today is model routing for coding tasks. These are future decision-layer candidates, not implemented @hokusai/router APIs.
Tool selection
Future layer candidate: which tool or MCP to call, learned from outcomes. Not part of the shipped @hokusai/router API today.
Learn moreRetrieval policy
Future layer candidate: what context to surface before a model call. Not part of the shipped SDK surface today.
Learn moreReview model selection
Future layer candidate: which reviewer model fits a diff, measured on real PR outcomes.
Learn morePrompt-policy optimizer
Future layer candidate: which prompt strategy fits a task, once that layer ships.
Learn more