@pipeworx/mcp-ai-model-experiments 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mojibake Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,139 @@
1
+ # @pipeworx/ai-model-experiments
2
+
3
+ **Model Lab** — run the same prompt(s) across many AI models at once (Anthropic,
4
+ OpenAI, Google, Meta, Mistral, DeepSeek, Qwen and more via OpenRouter) and
5
+ compare their outputs, cost, and latency side by side, with an optional
6
+ AI-written comparison summary when the run completes.
7
+
8
+ Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1558+ live data sources.
9
+
10
+ ## Tools
11
+
12
+ - `experiment_models(search?, min_context?, max_price_per_mtok?, limit?)` — browse ~300 available model ids with context window and our billed per-token price (provider cost × 1.5). Use the returned ids in `experiment_create`.
13
+ - `experiment_estimate(prompts[], models[], reps?, params?, summary?)` — free dry-run: cell count + estimated billed cost range for a spec, before creating it.
14
+ - `experiment_create(name?, prompts[], models[], reps?, params?, summary?, max_spend_usd)` — creates and starts an experiment (prompts × models × reps). **Async**: returns `experiment_id` immediately; execution happens on a separate cron worker within ~1 minute. Requires prepaid balance ≥ `max_spend_usd`.
15
+ - `experiment_status(experiment_id)` — cell counts by state, spend vs cap, whether complete. Poll this after create.
16
+ - `experiment_results(experiment_id, include_outputs?)` — per-model aggregates (latency, tokens, cost, error rate), per-cell outputs, and the AI-written comparison summary.
17
+ - `experiment_list(limit?)` — caller's experiments, newest first.
18
+ - `experiment_cancel(experiment_id)` — skips pending cells (unbilled); in-flight cells finish and bill.
19
+ - `experiment_topup(amount_usd?)` — current balance + the x402 top-up flow.
20
+
21
+ ## Auth
22
+
23
+ **Prepaid only — no free tier, no BYO-key mode.** Every call to `experiment_create`
24
+ requires a Pipeworx platform credit balance ≥ `max_spend_usd` (1 credit = $0.0001).
25
+ Top up via x402: `POST https://gateway.pipeworx.io/credits/topup?amount_usd=N`
26
+ returns an HTTP 402 payment challenge (USDC on Base); retry with a
27
+ `PAYMENT-SIGNATURE` header to settle, and credits land instantly. See
28
+ `experiment_topup` for the exact flow and current balance.
29
+
30
+ Billing is **provider cost × 1.5**, floored at $0.10/experiment. Model prices
31
+ returned by `experiment_models` are already the billed (marked-up) price, never
32
+ the raw provider cost.
33
+
34
+ Execution is handled by a separate cron worker (`workers/experiment-runner`,
35
+ fires every minute) — a created experiment is not synchronous. Poll
36
+ `experiment_status` rather than expecting `experiment_create` to block until
37
+ done.
38
+
39
+ ## Data sources
40
+
41
+ - <https://openrouter.ai/api/v1/models> — the model catalog (id, context window, provider pricing) that `experiment_models` wraps and re-prices.
42
+ - Inference for each cell is executed against OpenRouter's chat completions API by `workers/experiment-runner`, which also reads OpenRouter's `/generation` endpoint for the actual per-call cost so the 1.5× markup is billed on real cost, not an estimate.
43
+
44
+ Full build plan, architecture, and current live-vs-planned status:
45
+ `docs/model-lab-plan.md`.
46
+
47
+ ## Quick Start
48
+
49
+ Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "ai-model-experiments": {
55
+ "url": "https://gateway.pipeworx.io/ai-model-experiments/mcp"
56
+ }
57
+ }
58
+ }
59
+ ```
60
+
61
+ ### What this endpoint actually serves
62
+
63
+ `tools/list` at `https://gateway.pipeworx.io/ai-model-experiments/mcp` returns the tools in the table
64
+ above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
65
+ `discover_tools`, `search_within`, `remember`/`recall` and the rest of the
66
+ gateway-wide set. So the tool count you see is larger than this table: a
67
+ single-pack endpoint currently lists roughly 30 shared tools alongside the
68
+ pack's own. The connection's `initialize` response states its exact scope, and
69
+ is the authoritative answer for a given day.
70
+
71
+ This is deliberate, not multiplexing by accident. The meta-tools are what let a
72
+ scoped connection answer a question this pack does not cover — via
73
+ `ask_pipeworx`, which routes across the whole catalog — without you adding a
74
+ second MCP server. There is currently no way to mount a pack endpoint without
75
+ them; if the extra schemas cost you more context than the routing is worth,
76
+ connect to the full gateway once rather than to several pack endpoints.
77
+
78
+ Or connect to the full Pipeworx gateway to get every pack's tools listed
79
+ directly, instead of just this one's:
80
+
81
+ ```json
82
+ {
83
+ "mcpServers": {
84
+ "pipeworx": {
85
+ "url": "https://gateway.pipeworx.io/mcp"
86
+ }
87
+ }
88
+ }
89
+ ```
90
+
91
+ Both URLs reach the same gateway and the same 1558+ data sources. The
92
+ only difference is which pack's tools are listed **directly**; `ask_pipeworx`
93
+ reaches all of them from either one.
94
+
95
+ ## Standalone (no gateway account)
96
+
97
+ This package also runs as a local stdio MCP server — no Pipeworx account, no
98
+ gateway round-trip:
99
+
100
+ ```json
101
+ {
102
+ "mcpServers": {
103
+ "ai-model-experiments": {
104
+ "command": "npx",
105
+ "args": ["-y", "@pipeworx/mcp-ai-model-experiments"]
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ Or run it directly to confirm it starts:
112
+
113
+ ```bash
114
+ npx -y @pipeworx/mcp-ai-model-experiments
115
+ ```
116
+
117
+ It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
118
+ for **only** this pack's tools — none of the shared meta-tools the gateway
119
+ connection above adds. Same source, same tools, no ask_pipeworx routing.
120
+
121
+ ## Using with ask_pipeworx
122
+
123
+ Instead of calling tools directly, you can ask questions in plain English —
124
+ this works on the pack endpoint above as well as on the full gateway:
125
+
126
+ ```
127
+ ask_pipeworx({ question: "your question about Ai Model Experiments data" })
128
+ ```
129
+
130
+ The gateway picks the right tool and fills the arguments automatically.
131
+
132
+ ## More
133
+
134
+ - [Docs and guides](https://pipeworx.io/docs)
135
+ - [pipeworx.io](https://pipeworx.io)
136
+
137
+ ## License
138
+
139
+ MIT
package/bin/cli.js ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ //
3
+ // Entry point for `npx @pipeworx/mcp-<slug>`.
4
+ //
5
+ // Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
6
+ // tsx sidesteps every extensionless-import / bare-JSON-import edge case a
7
+ // per-pack tsc build would have to solve one pack at a time). This file
8
+ // registers tsx's ESM loader programmatically, then hands off to src/server.ts,
9
+ // which wraps the pack's {tools, callTool} export in a stdio MCP server.
10
+ //
11
+ // Copied verbatim into every published pack repo by scripts/publish-pack.sh —
12
+ // edit this file, not a per-pack copy.
13
+ import { register } from 'tsx/esm/api';
14
+
15
+ register();
16
+
17
+ await import('../src/server.ts');
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "@pipeworx/mcp-ai-model-experiments",
3
+ "version": "0.1.0",
4
+ "description": "AI Model Experiments MCP ('Model Lab') — run the same prompts across many",
5
+ "type": "module",
6
+ "main": "src/index.ts",
7
+ "types": "src/index.ts",
8
+ "bin": {
9
+ "mcp-ai-model-experiments": "bin/cli.js"
10
+ },
11
+ "keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "ai-model-experiments"],
12
+ "license": "MIT",
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/pipeworx-io/mcp-ai-model-experiments.git"
16
+ },
17
+ "scripts": {
18
+ "typecheck": "tsc --noEmit"
19
+ },
20
+ "dependencies": {
21
+ "@modelcontextprotocol/sdk": "^1.30.0",
22
+ "tsx": "^4.19.0"
23
+ },
24
+ "devDependencies": {
25
+ "typescript": "^5.7.0"
26
+ }
27
+ }
package/server.json ADDED
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.pipeworx-io/ai-model-experiments",
4
+ "title": "Ai Model Experiments",
5
+ "description": "AI Model Experiments MCP ('Model Lab') — run the same prompts across many",
6
+ "version": "0.1.0",
7
+ "websiteUrl": "https://pipeworx.io/packs/ai-model-experiments",
8
+ "repository": {
9
+ "url": "https://github.com/pipeworx-io/mcp-ai-model-experiments",
10
+ "source": "github"
11
+ },
12
+ "remotes": [
13
+ {
14
+ "type": "streamable-http",
15
+ "url": "https://gateway.pipeworx.io/ai-model-experiments/mcp"
16
+ }
17
+ ]
18
+ }