@maintainabilityai/research-runner 0.1.3 → 0.1.4
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/dist/llm/llm-router.js +12 -3
- package/package.json +1 -1
package/dist/llm/llm-router.js
CHANGED
|
@@ -10,7 +10,16 @@ const MODEL_BY_TIER = {
|
|
|
10
10
|
};
|
|
11
11
|
async function callLlm(opts) {
|
|
12
12
|
const tierModels = MODEL_BY_TIER[opts.tier];
|
|
13
|
-
|
|
13
|
+
// Hybrid routing: GitHub Models free tier caps requests at ~8K input
|
|
14
|
+
// tokens — too small for the synthesis step (full brief + every search
|
|
15
|
+
// result + mesh context routinely exceeds that). When the brief asks
|
|
16
|
+
// for github-models AND an Anthropic key is available, route synth →
|
|
17
|
+
// Anthropic and keep plan (small prompt) on github-models. Caller can
|
|
18
|
+
// force pure github-models by not setting anthropicApiKey.
|
|
19
|
+
const effectiveProvider = opts.provider === 'github-models' && opts.tier === 'synth' && opts.anthropicApiKey
|
|
20
|
+
? 'anthropic'
|
|
21
|
+
: opts.provider;
|
|
22
|
+
if (effectiveProvider === 'anthropic') {
|
|
14
23
|
if (!opts.anthropicApiKey) {
|
|
15
24
|
throw new Error(`callLlm: provider=anthropic requires anthropicApiKey (set ANTHROPIC_API_KEY).`);
|
|
16
25
|
}
|
|
@@ -33,7 +42,7 @@ async function callLlm(opts) {
|
|
|
33
42
|
httpStatus: r.httpStatus,
|
|
34
43
|
};
|
|
35
44
|
}
|
|
36
|
-
if (
|
|
45
|
+
if (effectiveProvider === 'github-models') {
|
|
37
46
|
if (!opts.githubToken) {
|
|
38
47
|
throw new Error(`callLlm: provider=github-models requires githubToken (set GITHUB_TOKEN; workflow needs \`permissions: models: read\`).`);
|
|
39
48
|
}
|
|
@@ -56,5 +65,5 @@ async function callLlm(opts) {
|
|
|
56
65
|
httpStatus: r.httpStatus,
|
|
57
66
|
};
|
|
58
67
|
}
|
|
59
|
-
throw new Error(`callLlm: provider "${
|
|
68
|
+
throw new Error(`callLlm: provider "${effectiveProvider}" not yet implemented (phase 2c.1 ships anthropic + github-models; openai + azure-openai land later).`);
|
|
60
69
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maintainabilityai/research-runner",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Research + PRD agent runner — orchestrates the Archeologist and PRD pipelines for the MaintainabilityAI governance mesh",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MaintainabilityAI",
|