openmerit 0.1.4 → 0.1.6-preview.0
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.
- package/CHANGELOG.md +40 -0
- package/README.md +121 -386
- package/dist/core/src/index.d.ts +101 -0
- package/dist/core/src/index.js +1649 -0
- package/dist/core/src/store.d.ts +35 -0
- package/dist/core/src/store.js +102 -0
- package/dist/pi/src/index.d.ts +32 -0
- package/dist/pi/src/index.js +794 -0
- package/dist/pi/src/scheduler.d.ts +11 -0
- package/dist/pi/src/scheduler.js +137 -0
- package/dist/pi/src/wakeup.d.ts +2 -0
- package/dist/pi/src/wakeup.js +108 -0
- package/dist/protocol/src/index.d.ts +484 -0
- package/dist/protocol/src/index.js +47 -0
- package/dist/protocol/src/schemas.d.ts +576 -0
- package/dist/protocol/src/schemas.js +280 -0
- package/dist/terminal/public/app.js +297 -0
- package/dist/terminal/public/brands/anthropic.png +0 -0
- package/dist/terminal/public/brands/baai.png +0 -0
- package/dist/terminal/public/brands/baseten.png +0 -0
- package/dist/terminal/public/brands/cerebras.png +0 -0
- package/dist/terminal/public/brands/cohere.png +0 -0
- package/dist/terminal/public/brands/deepseek.ico +0 -0
- package/dist/terminal/public/brands/google.png +0 -0
- package/dist/terminal/public/brands/groq.ico +0 -0
- package/dist/terminal/public/brands/lm-studio.png +0 -0
- package/dist/terminal/public/brands/meta.ico +0 -0
- package/dist/terminal/public/brands/mistral.png +0 -0
- package/dist/terminal/public/brands/nomic.png +0 -0
- package/dist/terminal/public/brands/ollama.png +0 -0
- package/dist/terminal/public/brands/openai.png +0 -0
- package/dist/terminal/public/brands/openrouter.png +0 -0
- package/dist/terminal/public/brands/qwen.png +0 -0
- package/dist/terminal/public/brands/vllm.ico +0 -0
- package/dist/terminal/public/brands/vllm.png +0 -0
- package/dist/terminal/public/favicon.svg +1 -0
- package/dist/terminal/public/flow.css +1 -0
- package/dist/terminal/public/flow.js +770 -0
- package/dist/terminal/public/index.html +21 -0
- package/dist/terminal/public/styles.css +779 -0
- package/dist/terminal/src/activity-merge.mjs +64 -0
- package/dist/terminal/src/browser.mjs +29 -0
- package/dist/terminal/src/cli.mjs +60 -0
- package/dist/terminal/src/collect.mjs +311 -0
- package/dist/terminal/src/discovery.mjs +93 -0
- package/dist/terminal/src/hardware.mjs +57 -0
- package/dist/terminal/src/project-activity.mjs +156 -0
- package/dist/terminal/src/sample.mjs +171 -0
- package/dist/terminal/src/server.mjs +56 -0
- package/dist/terminal/src/services.mjs +62 -0
- package/dist/terminal/src/topology.mjs +30 -0
- package/docs/adapter-guide.md +189 -0
- package/docs/architecture.md +59 -0
- package/docs/automation.md +74 -0
- package/docs/budgets.md +37 -0
- package/docs/commands.md +85 -0
- package/docs/demo-backfill.md +29 -0
- package/docs/demo-fieldkit.md +47 -0
- package/docs/demo-placement.md +30 -0
- package/docs/demo-spam.md +15 -0
- package/docs/demo-support.md +42 -0
- package/docs/demo.md +57 -0
- package/docs/first-trial.md +60 -0
- package/docs/getting-started.md +65 -0
- package/docs/index.md +40 -0
- package/docs/inference-terminal.md +439 -0
- package/docs/lifecycle.md +30 -0
- package/docs/memo.md +126 -0
- package/docs/metrics-and-evidence.md +48 -0
- package/docs/operations.md +40 -0
- package/docs/pareto-spec.md +76 -0
- package/docs/pi-extension.md +54 -0
- package/docs/roadmap.md +28 -0
- package/docs/security.md +37 -0
- package/docs/site-artwork-linocut.md +23 -0
- package/docs/site-artwork-miniature-diverse.md +28 -0
- package/docs/site-artwork-miniature.md +26 -0
- package/docs/site-demo.md +177 -0
- package/docs/site-design.md +94 -0
- package/docs/site-documentation.md +83 -0
- package/docs/site-dynamic-og.md +35 -0
- package/docs/site-faq-maintenance.md +115 -0
- package/docs/site-hero-resolution.md +60 -0
- package/docs/site-illustration-sequences.md +227 -0
- package/docs/site-inference-terminal.md +203 -0
- package/docs/site-memo.md +39 -0
- package/docs/site-og-image.md +38 -0
- package/docs/site-og-workshop.md +21 -0
- package/docs/site-section-artwork.md +56 -0
- package/docs/site-skill-review.md +57 -0
- package/docs/site-terminal-preview.md +85 -0
- package/docs/testing.md +118 -0
- package/docs/troubleshooting.md +55 -0
- package/docs/ux-reference.md +32 -0
- package/package.json +74 -42
- package/benchmark/invoice_ocr/data/invoice_01_ground_truth.json +0 -38
- package/benchmark/invoice_ocr/data/invoice_01_row_2.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_02_ground_truth.json +0 -32
- package/benchmark/invoice_ocr/data/invoice_02_row_5.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_03_ground_truth.json +0 -26
- package/benchmark/invoice_ocr/data/invoice_03_row_6.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_04_ground_truth.json +0 -26
- package/benchmark/invoice_ocr/data/invoice_04_row_7.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_05_ground_truth.json +0 -38
- package/benchmark/invoice_ocr/data/invoice_05_row_947.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_06_ground_truth.json +0 -38
- package/benchmark/invoice_ocr/data/invoice_06_row_948.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_07_ground_truth.json +0 -20
- package/benchmark/invoice_ocr/data/invoice_07_row_949.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_08_ground_truth.json +0 -38
- package/benchmark/invoice_ocr/data/invoice_08_row_1888.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_09_ground_truth.json +0 -26
- package/benchmark/invoice_ocr/data/invoice_09_row_1890.jpg +0 -0
- package/benchmark/invoice_ocr/data/invoice_10_ground_truth.json +0 -20
- package/benchmark/invoice_ocr/data/invoice_10_row_1892.jpg +0 -0
- package/benchmark/invoice_ocr/data/manifest.json +0 -97
- package/dist/benchmarks.js +0 -98
- package/dist/catalog.js +0 -61
- package/dist/cli.js +0 -188
- package/dist/daemon.js +0 -407
- package/dist/diagnostics.js +0 -227
- package/dist/frontier.js +0 -56
- package/dist/harness.js +0 -1
- package/dist/integrations.js +0 -19
- package/dist/invoice-eval.js +0 -33
- package/dist/invoice-score.js +0 -124
- package/dist/judge.js +0 -43
- package/dist/llm.js +0 -207
- package/dist/pi-config.js +0 -46
- package/dist/pi-trials.js +0 -373
- package/dist/policy.js +0 -185
- package/dist/providers.js +0 -1
- package/dist/recommend.js +0 -76
- package/dist/routes.js +0 -74
- package/dist/standalone.js +0 -224
- package/dist/store.js +0 -89
- package/dist/strategist.js +0 -68
- package/dist/task-input.js +0 -54
- package/dist/traces.js +0 -127
- package/dist/trials.js +0 -140
- package/dist/types.js +0 -2
- package/examples/invoice-prompt.txt +0 -19
- package/examples/task.example.json +0 -7
- package/extension/openmerit.ts +0 -947
- package/instructions/OPENMERIT.md +0 -63
- package/instructions/openmerit.policy.json +0 -37
- package/rules.md +0 -43
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# OpenMerit — Model Merit Harness
|
|
2
|
-
|
|
3
|
-
You are running under a main agent harness that is observed by **OpenMerit**, an
|
|
4
|
-
external merit harness. OpenMerit's job is to make sure you are always running on
|
|
5
|
-
the best model for the task at hand, at the best price, with a vetted fallback.
|
|
6
|
-
|
|
7
|
-
## What OpenMerit does
|
|
8
|
-
|
|
9
|
-
1. **Observes** this harness's session traces (models used, tokens, cost,
|
|
10
|
-
latency, errors) without intercepting or slowing down your work.
|
|
11
|
-
2. **Evaluates** candidate models for each completed task sequentially through
|
|
12
|
-
pi and scores their outputs with a judge model. Candidate tools are disabled
|
|
13
|
-
by default.
|
|
14
|
-
3. **Maintains a pareto frontier** per task (quality vs. cost vs. latency) and
|
|
15
|
-
an aggregate frontier across all of your tasks.
|
|
16
|
-
4. **Watches for new model releases** (provider catalogs + public benchmarks)
|
|
17
|
-
and queues promising releases for trial against your existing frontier.
|
|
18
|
-
5. **Recommends or applies model swaps**, with reasoning, and keeps your
|
|
19
|
-
fallback model up to date.
|
|
20
|
-
|
|
21
|
-
## What you should do
|
|
22
|
-
|
|
23
|
-
- **Treat model changes as explicit routing decisions.** If you notice your
|
|
24
|
-
model identity change, it was approved by the user or passed their opt-in
|
|
25
|
-
auto-apply policy. Continue the task; your instructions and context are
|
|
26
|
-
unchanged.
|
|
27
|
-
- **Respect the fallback.** If your current model errors, rate-limits, or is
|
|
28
|
-
retired, OpenMerit can offer the current fallback or apply it under an
|
|
29
|
-
opt-in automatic policy. Treat an approved fallback as normal operation.
|
|
30
|
-
- **State your task clearly in your first message** of a session when possible.
|
|
31
|
-
OpenMerit keys its pareto frontier to task signatures; clear task statements
|
|
32
|
-
produce better model choices for you.
|
|
33
|
-
- **Do not edit OpenMerit state files** (`~/.openmerit/`). If something looks
|
|
34
|
-
wrong, tell the user.
|
|
35
|
-
|
|
36
|
-
## What you can ask the user for
|
|
37
|
-
|
|
38
|
-
- `/openmerit` — show current model, fallback, frontier position, and pending
|
|
39
|
-
recommendations.
|
|
40
|
-
- `/openmerit apply` / `/openmerit dismiss` — act on a pending recommendation
|
|
41
|
-
when automatic application is declined by the policy gate.
|
|
42
|
-
- `/openmerit pause` / `/openmerit resume` — stop or restart automatic task
|
|
43
|
-
comparisons without changing the saved policy.
|
|
44
|
-
- `/openmerit compare` — explicitly compare the latest completed task, even
|
|
45
|
-
while automatic comparisons are paused.
|
|
46
|
-
- `/openmerit doctor` — inspect sanitized installation, route, pricing, state,
|
|
47
|
-
and provider-extension diagnostics inside Pi.
|
|
48
|
-
- Policy changes (auto-apply thresholds, budgets, provider allow-lists) are
|
|
49
|
-
made by the user in `~/.openmerit/policy.json`, not by you.
|
|
50
|
-
|
|
51
|
-
## Guarantees
|
|
52
|
-
|
|
53
|
-
- Per-task comparisons send the task text, uploaded files or images (when
|
|
54
|
-
present), and candidate answers through the model routes configured in Pi
|
|
55
|
-
for model runs and judging. Candidate Pi runs default to no tools; any tool access is an
|
|
56
|
-
explicit user opt-in. Use non-sensitive examples while
|
|
57
|
-
evaluating this alpha.
|
|
58
|
-
- The shipped policy is supervised. Swaps happen automatically only after the
|
|
59
|
-
user opts in and the configured quality/cost guardrails pass; otherwise they
|
|
60
|
-
remain recommendations for a human to approve.
|
|
61
|
-
- Isolated subprocesses disable extension discovery. Provider-registration
|
|
62
|
-
extensions run only when the user lists their absolute file paths in
|
|
63
|
-
`policy.json`; OpenMerit refuses to load itself recursively.
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"mode": "recommend",
|
|
4
|
-
"auto_apply": {
|
|
5
|
-
"enabled": false,
|
|
6
|
-
"min_score_gain": 0.1,
|
|
7
|
-
"max_price_ratio": 1.5,
|
|
8
|
-
"require_frontier": true
|
|
9
|
-
},
|
|
10
|
-
"budgets": {
|
|
11
|
-
"max_usd_per_trial": 0.25,
|
|
12
|
-
"max_trials_per_day": 20,
|
|
13
|
-
"max_usd_per_day": 5.0
|
|
14
|
-
},
|
|
15
|
-
"providers": {
|
|
16
|
-
"allow": ["*"],
|
|
17
|
-
"deny": []
|
|
18
|
-
},
|
|
19
|
-
"watch": {
|
|
20
|
-
"catalog_interval_min": 360,
|
|
21
|
-
"traces_interval_sec": 5,
|
|
22
|
-
"trial_interval_min": 30,
|
|
23
|
-
"models_per_task": 3
|
|
24
|
-
},
|
|
25
|
-
"fallback": {
|
|
26
|
-
"auto_update": true,
|
|
27
|
-
"min_score": 0.6,
|
|
28
|
-
"apply_on_error": true
|
|
29
|
-
},
|
|
30
|
-
"judge_model": null,
|
|
31
|
-
"strategist_model": null,
|
|
32
|
-
"max_usd_per_m": 20.0,
|
|
33
|
-
"route_overrides": {},
|
|
34
|
-
"pi": {
|
|
35
|
-
"provider_extensions": []
|
|
36
|
-
}
|
|
37
|
-
}
|
package/rules.md
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
# OpenMerit product and architecture rules
|
|
2
|
-
|
|
3
|
-
- **Optimize for useful model choices.** OpenMerit exists to find better task-specific tradeoffs between quality, cost, and latency—not to become a general-purpose agent or telemetry platform.
|
|
4
|
-
|
|
5
|
-
- **Act as a control plane, not a gateway.** Normal traffic stays between the harness and provider; OpenMerit observes evidence, runs explicit trials, and returns recommendations without intercepting ordinary work.
|
|
6
|
-
|
|
7
|
-
- **Make Pi plug-and-play first.** Pi and Pi-based harnesses are the first supported user experience because that is where early users already work; broader harness support can follow without weakening this path.
|
|
8
|
-
|
|
9
|
-
- **Keep the core harness-neutral.** Pi is the first `HarnessAdapter`, not a permanent assumption in scoring, recommendations, policy, or stored data, so other harnesses can be added without rewriting the merit loop.
|
|
10
|
-
|
|
11
|
-
- **Keep model providers interchangeable.** OpenRouter is a first-class provider and discovery source, not the foundation of the domain model; provider-specific behavior belongs behind a `ModelProviderAdapter`.
|
|
12
|
-
|
|
13
|
-
- **Require end-to-end provider neutrality.** Discovery, authentication, execution, scoring, and swapping must preserve the selected route; a feature is not provider-neutral if only its API client is abstracted.
|
|
14
|
-
|
|
15
|
-
- **Separate model identity from execution route.** Keep logical model IDs in stable `vendor/model` form, while recording the actual provider or route separately, so the same model can be compared through OpenRouter, a native provider, or a local provider.
|
|
16
|
-
|
|
17
|
-
- **Respect the harness's eligible model pool.** Prefer models already available and configured in the active harness; external catalogs may enrich or expand discovery but must not silently override harness scope or credentials.
|
|
18
|
-
|
|
19
|
-
- **Require explicit metadata instead of price guesses.** Missing price, context, output, or modality data for a custom route may be supplied by an exact-route override; never assume a local route is free or copy metadata across providers.
|
|
20
|
-
|
|
21
|
-
- **Treat public benchmarks as priors, not proof.** Benchmarks help shortlist candidates, but merit comes from trials on the user's actual task.
|
|
22
|
-
|
|
23
|
-
- **Keep four integration boundaries distinct.** Model execution (`ModelProviderAdapter`), agent execution (`HarnessAdapter`), incoming traces (`ObservationSource`), and outgoing telemetry (`EventSink`) solve different problems and must not be coupled.
|
|
24
|
-
|
|
25
|
-
- **Use provider-neutral core records.** Normalize integrations into stable concepts such as `TaskObservation`, `CandidateRun`, `TrialScore`, `Frontier`, `Recommendation`, and `MeritEvent`, so integrations do not leak their schemas into the decision engine.
|
|
26
|
-
|
|
27
|
-
- **Optimize per task before aggregating per agent.** Agent-level conclusions must be built from measured task evidence rather than assumed from global model rankings.
|
|
28
|
-
|
|
29
|
-
- **Version persisted events and evolve them additively.** Existing 0.1.x state must remain readable, and append-only recommendation history must stay intact; migrations should normalize old records rather than invalidate them.
|
|
30
|
-
|
|
31
|
-
- **Keep policy as the sole auto-swap authority.** Trials and strategists may recommend changes, but only the policy gate may approve automatic application, and every recommendation must retain its gate reasons.
|
|
32
|
-
|
|
33
|
-
- **Default to safe, explicit trials.** Candidate tool access stays off unless deliberately allowed, trials remain isolated, and temporary workspaces are cleaned up because trying a model must not expose or damage a user's project by surprise.
|
|
34
|
-
|
|
35
|
-
- **Allowlist subprocess extensions.** Keep Pi extension discovery disabled in isolated trials and load only explicitly named provider-registration files; never recursively load OpenMerit or inherit unrelated harness extensions.
|
|
36
|
-
|
|
37
|
-
- **Keep the shadow track isolated, not necessarily concurrent.** Candidate trials may run sequentially to respect cost, rate, and safety limits while remaining separate from the user's live task.
|
|
38
|
-
|
|
39
|
-
- **Treat local JSONL as the default integration, not a lock-in.** Local traces and events should work without an external service; systems such as Langfuse can later plug in as observation sources or event sinks.
|
|
40
|
-
|
|
41
|
-
- **Keep integrations optional and the core lightweight.** New providers, harnesses, and observability services should not impose credentials, network calls, or heavy dependencies on users who do not enable them.
|
|
42
|
-
|
|
43
|
-
- **Keep 0.1.x focused.** The near-term bar is reliable, provider-neutral use for Pi tinkerers and solo hackers; additional harnesses and hosted observability integrations belong in later releases unless required to prove the boundaries work.
|