@nexus-cortex/core 4.46.0 → 4.47.3
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/adapters/ChatCompletionsAPIAdapter.d.ts.map +1 -1
- package/dist/adapters/ChatCompletionsAPIAdapter.js +3 -1
- package/dist/adapters/ChatCompletionsAPIAdapter.js.map +1 -1
- package/dist/adapters/GatewayTranslationLayer.d.ts.map +1 -1
- package/dist/adapters/GatewayTranslationLayer.js +11 -6
- package/dist/adapters/GatewayTranslationLayer.js.map +1 -1
- package/dist/config/RuntimeConfigRegistry.d.ts.map +1 -1
- package/dist/config/RuntimeConfigRegistry.js +1 -0
- package/dist/config/RuntimeConfigRegistry.js.map +1 -1
- package/dist/config/SettingsLoader.d.ts.map +1 -1
- package/dist/config/SettingsLoader.js +1 -0
- package/dist/config/SettingsLoader.js.map +1 -1
- package/dist/config/SettingsSchema.d.ts +3 -0
- package/dist/config/SettingsSchema.d.ts.map +1 -1
- package/dist/config/SettingsSchema.js +9 -0
- package/dist/config/SettingsSchema.js.map +1 -1
- package/dist/models/cards/huggingface/hf-router.d.ts +19 -0
- package/dist/models/cards/huggingface/hf-router.d.ts.map +1 -0
- package/dist/models/cards/huggingface/hf-router.js +33 -0
- package/dist/models/cards/huggingface/hf-router.js.map +1 -0
- package/dist/models/cards/huggingface/hf-space-models.d.ts +22 -0
- package/dist/models/cards/huggingface/hf-space-models.d.ts.map +1 -0
- package/dist/models/cards/huggingface/hf-space-models.js +56 -0
- package/dist/models/cards/huggingface/hf-space-models.js.map +1 -0
- package/dist/models/cards/huggingface/hf-space.d.ts +11 -0
- package/dist/models/cards/huggingface/hf-space.d.ts.map +1 -0
- package/dist/models/cards/huggingface/hf-space.js +27 -0
- package/dist/models/cards/huggingface/hf-space.js.map +1 -0
- package/dist/models/cards/huggingface/index.d.ts +3 -2
- package/dist/models/cards/huggingface/index.d.ts.map +1 -1
- package/dist/models/cards/huggingface/index.js +5 -2
- package/dist/models/cards/huggingface/index.js.map +1 -1
- package/dist/models/cards/local/index.d.ts +1 -0
- package/dist/models/cards/local/index.d.ts.map +1 -1
- package/dist/models/cards/local/index.js +2 -0
- package/dist/models/cards/local/index.js.map +1 -1
- package/dist/models/cards/local/local-openai.d.ts +17 -0
- package/dist/models/cards/local/local-openai.d.ts.map +1 -0
- package/dist/models/cards/local/local-openai.js +33 -0
- package/dist/models/cards/local/local-openai.js.map +1 -0
- package/dist/models/cards/xai/grok-4-5.d.ts +13 -0
- package/dist/models/cards/xai/grok-4-5.d.ts.map +1 -0
- package/dist/models/cards/xai/grok-4-5.js +25 -0
- package/dist/models/cards/xai/grok-4-5.js.map +1 -0
- package/dist/models/cards/xai/index.d.ts +1 -0
- package/dist/models/cards/xai/index.d.ts.map +1 -1
- package/dist/models/cards/xai/index.js +1 -0
- package/dist/models/cards/xai/index.js.map +1 -1
- package/dist/models/configurators/HFSpaceConfigurator.d.ts +42 -0
- package/dist/models/configurators/HFSpaceConfigurator.d.ts.map +1 -0
- package/dist/models/configurators/HFSpaceConfigurator.js +71 -0
- package/dist/models/configurators/HFSpaceConfigurator.js.map +1 -0
- package/dist/models/configurators/HuggingFaceConfigurator.d.ts +7 -7
- package/dist/models/configurators/HuggingFaceConfigurator.d.ts.map +1 -1
- package/dist/models/configurators/HuggingFaceConfigurator.js +13 -6
- package/dist/models/configurators/HuggingFaceConfigurator.js.map +1 -1
- package/dist/models/configurators/LocalModelConfigurator.d.ts +7 -0
- package/dist/models/configurators/LocalModelConfigurator.d.ts.map +1 -1
- package/dist/models/configurators/LocalModelConfigurator.js +11 -1
- package/dist/models/configurators/LocalModelConfigurator.js.map +1 -1
- package/dist/models/configurators/QwenConfigurator.d.ts +0 -4
- package/dist/models/configurators/QwenConfigurator.d.ts.map +1 -1
- package/dist/models/configurators/QwenConfigurator.js +6 -7
- package/dist/models/configurators/QwenConfigurator.js.map +1 -1
- package/dist/models/hfSpace/normalize.d.ts +34 -0
- package/dist/models/hfSpace/normalize.d.ts.map +1 -0
- package/dist/models/hfSpace/normalize.js +195 -0
- package/dist/models/hfSpace/normalize.js.map +1 -0
- package/dist/models/registry/ModularModelRegistry.d.ts.map +1 -1
- package/dist/models/registry/ModularModelRegistry.js +17 -1
- package/dist/models/registry/ModularModelRegistry.js.map +1 -1
- package/dist/orchestrator/APIClient.d.ts +18 -0
- package/dist/orchestrator/APIClient.d.ts.map +1 -1
- package/dist/orchestrator/APIClient.js +101 -0
- package/dist/orchestrator/APIClient.js.map +1 -1
- package/dist/system-messages/SystemMessageLoader.d.ts +13 -0
- package/dist/system-messages/SystemMessageLoader.d.ts.map +1 -1
- package/dist/system-messages/SystemMessageLoader.js +30 -2
- package/dist/system-messages/SystemMessageLoader.js.map +1 -1
- package/dist/system-messages/memoryArchive.d.ts +28 -0
- package/dist/system-messages/memoryArchive.d.ts.map +1 -0
- package/dist/system-messages/memoryArchive.js +125 -0
- package/dist/system-messages/memoryArchive.js.map +1 -0
- package/dist/tools/ServerSideTools.d.ts.map +1 -1
- package/dist/tools/ServerSideTools.js +9 -0
- package/dist/tools/ServerSideTools.js.map +1 -1
- package/package.json +4 -3
- package/dist/models/cards/huggingface/llama-3-8b-instruct.d.ts +0 -17
- package/dist/models/cards/huggingface/llama-3-8b-instruct.d.ts.map +0 -1
- package/dist/models/cards/huggingface/llama-3-8b-instruct.js +0 -25
- package/dist/models/cards/huggingface/llama-3-8b-instruct.js.map +0 -1
- package/dist/models/cards/huggingface/mistral-7b-instruct.d.ts +0 -10
- package/dist/models/cards/huggingface/mistral-7b-instruct.d.ts.map +0 -1
- package/dist/models/cards/huggingface/mistral-7b-instruct.js +0 -18
- package/dist/models/cards/huggingface/mistral-7b-instruct.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hf-router.js","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/hf-router.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAG9F,MAAM,GAAG,GAAG,CAAC,CAAqB,EAAE,CAAS,EAAE,EAAE;IAC/C,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,QAAQ,GAAuB,WAAW;IACrD,CAAC,CAAC,4BAA4B,CAAC;QAC3B,EAAE,EAAE,WAAW,EAAE,6CAA6C;QAC9D,WAAW,EAAE,OAAO,WAAW,EAAE;QACjC,MAAM,EAAE,aAAa;QACrB,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,KAAK,CAAC;QAC9D,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC;QACxD,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK,OAAO;KAC/D,CAAC;IACJ,CAAC,CAAC,IAAI,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ready-made cards for popular open sub-4B models served from your own HF Gradio
|
|
3
|
+
* Space (the hf-space transport; deploy the template at scripts/hf-space-template/).
|
|
4
|
+
*
|
|
5
|
+
* Each card registers only when its Space id env var is set:
|
|
6
|
+
* HF_SPACE_ID_<SLUG>=your-user/your-space (one Space per model — parallel use)
|
|
7
|
+
* or, to point ALL of them at one shared Space you swap via its MODEL_ID variable:
|
|
8
|
+
* HF_SPACE_CANDIDATES=true + HF_SPACE_ID=your-user/your-space (serial use)
|
|
9
|
+
*
|
|
10
|
+
* Every card pins the HF model repo it expects the Space to serve; the transport
|
|
11
|
+
* verifies the Space's [MODEL=...] output prefix against it and fails loudly on
|
|
12
|
+
* mismatch, so a card can never silently answer with the wrong model.
|
|
13
|
+
*
|
|
14
|
+
* Tool-call families (parsed by models/hfSpace/normalize.ts):
|
|
15
|
+
* Qwen3 / SmolLM3 — Hermes <tool_call>{json}</tool_call>
|
|
16
|
+
* Qwen3.5 — XML <function=name><parameter=k>v</parameter></function>
|
|
17
|
+
* Phi-4-mini — bare JSON array
|
|
18
|
+
* LFM2.5 — pythonic <|tool_call_start|>[f(k=v)]<|tool_call_end|>
|
|
19
|
+
*/
|
|
20
|
+
import type { ModelConfig } from '../../ModelConfig.interface.js';
|
|
21
|
+
export declare const hfSpaceModelCards: ModelConfig[];
|
|
22
|
+
//# sourceMappingURL=hf-space-models.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hf-space-models.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/hf-space-models.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAsDlE,eAAO,MAAM,iBAAiB,EAAE,WAAW,EAE1C,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ready-made cards for popular open sub-4B models served from your own HF Gradio
|
|
3
|
+
* Space (the hf-space transport; deploy the template at scripts/hf-space-template/).
|
|
4
|
+
*
|
|
5
|
+
* Each card registers only when its Space id env var is set:
|
|
6
|
+
* HF_SPACE_ID_<SLUG>=your-user/your-space (one Space per model — parallel use)
|
|
7
|
+
* or, to point ALL of them at one shared Space you swap via its MODEL_ID variable:
|
|
8
|
+
* HF_SPACE_CANDIDATES=true + HF_SPACE_ID=your-user/your-space (serial use)
|
|
9
|
+
*
|
|
10
|
+
* Every card pins the HF model repo it expects the Space to serve; the transport
|
|
11
|
+
* verifies the Space's [MODEL=...] output prefix against it and fails loudly on
|
|
12
|
+
* mismatch, so a card can never silently answer with the wrong model.
|
|
13
|
+
*
|
|
14
|
+
* Tool-call families (parsed by models/hfSpace/normalize.ts):
|
|
15
|
+
* Qwen3 / SmolLM3 — Hermes <tool_call>{json}</tool_call>
|
|
16
|
+
* Qwen3.5 — XML <function=name><parameter=k>v</parameter></function>
|
|
17
|
+
* Phi-4-mini — bare JSON array
|
|
18
|
+
* LFM2.5 — pythonic <|tool_call_start|>[f(k=v)]<|tool_call_end|>
|
|
19
|
+
*/
|
|
20
|
+
import { createHFSpaceModelConfig } from '../../configurators/HFSpaceConfigurator.js';
|
|
21
|
+
// defaultTemperature = the VENDOR-recommended sampling temperature for each model
|
|
22
|
+
// (Qwen thinking 0.6 — greedy explicitly discouraged; SmolLM3 0.6; LFM2.5 0.3;
|
|
23
|
+
// Phi-4-mini greedy for function calling). Pair with Space-side GEN_TOP_P /
|
|
24
|
+
// GEN_MIN_P / GEN_REP_PENALTY variables (see scripts/hf-space-template/).
|
|
25
|
+
const SPECS = [
|
|
26
|
+
// Routers (sub-1B)
|
|
27
|
+
{ envSlug: 'QWEN3_0_6B', id: 'qwen3-0.6b-space', displayName: 'Qwen3 0.6B (HF Space)', family: 'qwen3', repo: 'Qwen/Qwen3-0.6B', contextWindow: 32768, reasoning: true, defaultTemperature: 0.6 },
|
|
28
|
+
{ envSlug: 'QWEN3_5_0_8B', id: 'qwen3.5-0.8b-space', displayName: 'Qwen3.5 0.8B (HF Space)', family: 'qwen3.5', repo: 'Qwen/Qwen3.5-0.8B', contextWindow: 32768, reasoning: true, defaultTemperature: 0.6 },
|
|
29
|
+
{ envSlug: 'LFM2_5_350M', id: 'lfm2.5-350m-space', displayName: 'LFM2.5 350M (HF Space)', family: 'lfm2.5', repo: 'LiquidAI/LFM2.5-350M', contextWindow: 32768, reasoning: false, defaultTemperature: 0.3 },
|
|
30
|
+
{ envSlug: 'LFM2_5_1_2B', id: 'lfm2.5-1.2b-space', displayName: 'LFM2.5 1.2B (HF Space)', family: 'lfm2.5', repo: 'LiquidAI/LFM2.5-1.2B-Instruct', contextWindow: 32768, reasoning: false, defaultTemperature: 0.3 },
|
|
31
|
+
{ envSlug: 'LFM2_5_1_2B_THINKING', id: 'lfm2.5-1.2b-thinking-space', displayName: 'LFM2.5 1.2B Thinking (HF Space)', family: 'lfm2.5', repo: 'LiquidAI/LFM2.5-1.2B-Thinking', contextWindow: 32768, reasoning: true, defaultTemperature: 0.3 },
|
|
32
|
+
// Reasoners (1.5-4B)
|
|
33
|
+
{ envSlug: 'QWEN3_1_7B', id: 'qwen3-1.7b-space', displayName: 'Qwen3 1.7B (HF Space)', family: 'qwen3', repo: 'Qwen/Qwen3-1.7B', contextWindow: 32768, reasoning: true, defaultTemperature: 0.6 },
|
|
34
|
+
{ envSlug: 'QWEN3_5_4B', id: 'qwen3.5-4b-space', displayName: 'Qwen3.5 4B (HF Space)', family: 'qwen3.5', repo: 'Qwen/Qwen3.5-4B', contextWindow: 32768, reasoning: true, defaultTemperature: 0.6 },
|
|
35
|
+
{ envSlug: 'SMOLLM3_3B', id: 'smollm3-3b-space', displayName: 'SmolLM3 3B (HF Space)', family: 'smollm3', repo: 'HuggingFaceTB/SmolLM3-3B', contextWindow: 32768, reasoning: true, defaultTemperature: 0.6 },
|
|
36
|
+
{ envSlug: 'PHI_4_MINI', id: 'phi-4-mini-space', displayName: 'Phi-4-mini 3.8B (HF Space)', family: 'phi-4', repo: 'microsoft/Phi-4-mini-instruct', contextWindow: 32768, reasoning: false, defaultTemperature: 0.0 },
|
|
37
|
+
];
|
|
38
|
+
function buildCard(spec) {
|
|
39
|
+
const spaceId = process.env[`HF_SPACE_ID_${spec.envSlug}`]?.trim() ||
|
|
40
|
+
(process.env.HF_SPACE_CANDIDATES === 'true' ? process.env.HF_SPACE_ID?.trim() : undefined);
|
|
41
|
+
if (!spaceId)
|
|
42
|
+
return null;
|
|
43
|
+
return createHFSpaceModelConfig({
|
|
44
|
+
id: spec.id,
|
|
45
|
+
displayName: spec.displayName,
|
|
46
|
+
family: spec.family,
|
|
47
|
+
spaceId,
|
|
48
|
+
contextWindow: spec.contextWindow,
|
|
49
|
+
outputTokens: 4096,
|
|
50
|
+
supportsTools: true,
|
|
51
|
+
supportsReasoning: spec.reasoning,
|
|
52
|
+
expectedSpaceModel: spec.repo,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
export const hfSpaceModelCards = SPECS.map(buildCard).filter((c) => c !== null);
|
|
56
|
+
//# sourceMappingURL=hf-space-models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hf-space-models.js","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/hf-space-models.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model served from a HuggingFace Gradio Space (native, via the hf-space transport).
|
|
3
|
+
*
|
|
4
|
+
* Set HF_SPACE_ID to your Gradio Space (e.g. "your-user/your-space"), HF_TOKEN for auth,
|
|
5
|
+
* then select it with DEFAULT_MODEL_ID=hf-space (or HF_SPACE_MODEL_ID for a custom id) /
|
|
6
|
+
* HELPER_MODEL_ID=hf-space. The Space must expose the `/run` API (see
|
|
7
|
+
* scripts/hf-space-template/). Only registers when HF_SPACE_ID is set.
|
|
8
|
+
*/
|
|
9
|
+
import type { ModelConfig } from '../../ModelConfig.interface.js';
|
|
10
|
+
export declare const hfSpace: ModelConfig | null;
|
|
11
|
+
//# sourceMappingURL=hf-space.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hf-space.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/hf-space.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AASlE,eAAO,MAAM,OAAO,EAAE,WAAW,GAAG,IAW5B,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model served from a HuggingFace Gradio Space (native, via the hf-space transport).
|
|
3
|
+
*
|
|
4
|
+
* Set HF_SPACE_ID to your Gradio Space (e.g. "your-user/your-space"), HF_TOKEN for auth,
|
|
5
|
+
* then select it with DEFAULT_MODEL_ID=hf-space (or HF_SPACE_MODEL_ID for a custom id) /
|
|
6
|
+
* HELPER_MODEL_ID=hf-space. The Space must expose the `/run` API (see
|
|
7
|
+
* scripts/hf-space-template/). Only registers when HF_SPACE_ID is set.
|
|
8
|
+
*/
|
|
9
|
+
import { createHFSpaceModelConfig } from '../../configurators/HFSpaceConfigurator.js';
|
|
10
|
+
const num = (v, d) => {
|
|
11
|
+
const n = v ? parseInt(v, 10) : NaN;
|
|
12
|
+
return Number.isFinite(n) ? n : d;
|
|
13
|
+
};
|
|
14
|
+
const HF_SPACE_ID = process.env.HF_SPACE_ID?.trim();
|
|
15
|
+
export const hfSpace = HF_SPACE_ID
|
|
16
|
+
? createHFSpaceModelConfig({
|
|
17
|
+
id: process.env.HF_SPACE_MODEL_ID?.trim() || 'hf-space',
|
|
18
|
+
displayName: `HF Space: ${HF_SPACE_ID}`,
|
|
19
|
+
family: 'hf-space',
|
|
20
|
+
spaceId: HF_SPACE_ID,
|
|
21
|
+
contextWindow: num(process.env.HF_SPACE_CONTEXT_WINDOW, 32768),
|
|
22
|
+
outputTokens: num(process.env.HF_SPACE_MAX_OUTPUT, 4096),
|
|
23
|
+
supportsTools: process.env.HF_SPACE_SUPPORTS_TOOLS !== 'false',
|
|
24
|
+
supportsReasoning: process.env.HF_SPACE_REASONING === 'true',
|
|
25
|
+
})
|
|
26
|
+
: null;
|
|
27
|
+
//# sourceMappingURL=hf-space.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hf-space.js","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/hf-space.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,wBAAwB,EAAE,MAAM,4CAA4C,CAAC;AAGtF,MAAM,GAAG,GAAG,CAAC,CAAqB,EAAE,CAAS,EAAE,EAAE;IAC/C,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;AAEpD,MAAM,CAAC,MAAM,OAAO,GAAuB,WAAW;IACpD,CAAC,CAAC,wBAAwB,CAAC;QACvB,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,IAAI,EAAE,IAAI,UAAU;QACvD,WAAW,EAAE,aAAa,WAAW,EAAE;QACvC,MAAM,EAAE,UAAU;QAClB,OAAO,EAAE,WAAW;QACpB,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,uBAAuB,EAAE,KAAK,CAAC;QAC9D,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC;QACxD,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK,OAAO;QAC9D,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM;KAC7D,CAAC;IACJ,CAAC,CAAC,IAAI,CAAC"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* FREE but rate-limited. For production, use dedicated endpoints.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
8
|
+
export { hfRouter } from './hf-router.js';
|
|
9
|
+
export { hfSpace } from './hf-space.js';
|
|
10
|
+
export { hfSpaceModelCards } from './hf-space-models.js';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* FREE but rate-limited. For production, use dedicated endpoints.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
export {
|
|
8
|
+
// Generic HF Inference Providers model (HF_MODEL_ID → router.huggingface.co)
|
|
9
|
+
export { hfRouter } from './hf-router.js';
|
|
10
|
+
export { hfSpace } from './hf-space.js';
|
|
11
|
+
// Ready-made per-model Space cards (HF_SPACE_ID_<SLUG> / HF_SPACE_CANDIDATES)
|
|
12
|
+
export { hfSpaceModelCards } from './hf-space-models.js';
|
|
10
13
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/cards/huggingface/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,6EAA6E;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,8EAA8E;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -14,4 +14,5 @@
|
|
|
14
14
|
export { llama38bLocal } from './llama-3-8b-local.js';
|
|
15
15
|
export { mistral7bOllama } from './mistral-7b-ollama.js';
|
|
16
16
|
export { codellama13bLocal } from './codellama-13b-local.js';
|
|
17
|
+
export { localOpenAI } from './local-openai.js';
|
|
17
18
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/local/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/local/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -14,4 +14,6 @@
|
|
|
14
14
|
export { llama38bLocal } from './llama-3-8b-local.js';
|
|
15
15
|
export { mistral7bOllama } from './mistral-7b-ollama.js';
|
|
16
16
|
export { codellama13bLocal } from './codellama-13b-local.js';
|
|
17
|
+
// Generic local / self-hosted OpenAI-compatible model (LOCAL_MODEL_ENDPOINT)
|
|
18
|
+
export { localOpenAI } from './local-openai.js';
|
|
17
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/cards/local/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/cards/local/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,6EAA6E;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local / self-hosted OpenAI-compatible model for the harness or helper model.
|
|
3
|
+
*
|
|
4
|
+
* Point `LOCAL_MODEL_ENDPOINT` at any OpenAI-compatible `/v1/chat/completions`
|
|
5
|
+
* server — LM Studio (default :1234), llama-server, vLLM, Ollama, etc. Then select
|
|
6
|
+
* it with `DEFAULT_MODEL_ID=local` (main) and/or `HELPER_MODEL_ID=local`.
|
|
7
|
+
*
|
|
8
|
+
* Specs are env-flexible so the card matches whatever model you load — set the
|
|
9
|
+
* context window / output cap so compaction triggers correctly, and toggle tool
|
|
10
|
+
* support. TOOL CALLING: the harness expects native OpenAI `tool_calls[]`, so run
|
|
11
|
+
* your server with tool parsing on (e.g. `llama-server --jinja`, vLLM
|
|
12
|
+
* `--enable-auto-tool-choice`, LM Studio's tool support). No API key required
|
|
13
|
+
* unless your server enforces one (`LOCAL_MODEL_API_KEY`).
|
|
14
|
+
*/
|
|
15
|
+
import type { ModelConfig } from '../../ModelConfig.interface.js';
|
|
16
|
+
export declare const localOpenAI: ModelConfig;
|
|
17
|
+
//# sourceMappingURL=local-openai.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-openai.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/local/local-openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAOlE,eAAO,MAAM,WAAW,EAAE,WAYxB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Local / self-hosted OpenAI-compatible model for the harness or helper model.
|
|
3
|
+
*
|
|
4
|
+
* Point `LOCAL_MODEL_ENDPOINT` at any OpenAI-compatible `/v1/chat/completions`
|
|
5
|
+
* server — LM Studio (default :1234), llama-server, vLLM, Ollama, etc. Then select
|
|
6
|
+
* it with `DEFAULT_MODEL_ID=local` (main) and/or `HELPER_MODEL_ID=local`.
|
|
7
|
+
*
|
|
8
|
+
* Specs are env-flexible so the card matches whatever model you load — set the
|
|
9
|
+
* context window / output cap so compaction triggers correctly, and toggle tool
|
|
10
|
+
* support. TOOL CALLING: the harness expects native OpenAI `tool_calls[]`, so run
|
|
11
|
+
* your server with tool parsing on (e.g. `llama-server --jinja`, vLLM
|
|
12
|
+
* `--enable-auto-tool-choice`, LM Studio's tool support). No API key required
|
|
13
|
+
* unless your server enforces one (`LOCAL_MODEL_API_KEY`).
|
|
14
|
+
*/
|
|
15
|
+
import { createLocalModelConfig } from '../../configurators/LocalModelConfigurator.js';
|
|
16
|
+
const num = (v, d) => {
|
|
17
|
+
const n = v ? parseInt(v, 10) : NaN;
|
|
18
|
+
return Number.isFinite(n) ? n : d;
|
|
19
|
+
};
|
|
20
|
+
export const localOpenAI = createLocalModelConfig({
|
|
21
|
+
id: 'local',
|
|
22
|
+
displayName: 'Local (OpenAI-compatible)',
|
|
23
|
+
family: 'local',
|
|
24
|
+
contextWindow: num(process.env.LOCAL_MODEL_CONTEXT_WINDOW, 32768),
|
|
25
|
+
outputTokens: num(process.env.LOCAL_MODEL_MAX_OUTPUT, 4096),
|
|
26
|
+
endpoint: process.env.LOCAL_MODEL_ENDPOINT || 'http://localhost:1234/v1/chat/completions',
|
|
27
|
+
apiKeyEnvVar: 'LOCAL_MODEL_API_KEY',
|
|
28
|
+
supportsTools: process.env.LOCAL_MODEL_SUPPORTS_TOOLS !== 'false',
|
|
29
|
+
// Set LOCAL_MODEL_REASONING=true for a reasoning model that emits a separate
|
|
30
|
+
// reasoning_content field (run it with thinking on). Off by default.
|
|
31
|
+
supportsReasoning: process.env.LOCAL_MODEL_REASONING === 'true',
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=local-openai.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-openai.js","sourceRoot":"","sources":["../../../../src/models/cards/local/local-openai.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAGvF,MAAM,GAAG,GAAG,CAAC,CAAqB,EAAE,CAAS,EAAE,EAAE;IAC/C,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACpC,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,WAAW,GAAgB,sBAAsB,CAAC;IAC7D,EAAE,EAAE,OAAO;IACX,WAAW,EAAE,2BAA2B;IACxC,MAAM,EAAE,OAAO;IACf,aAAa,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,KAAK,CAAC;IACjE,YAAY,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC3D,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,2CAA2C;IACzF,YAAY,EAAE,qBAAqB;IACnC,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,0BAA0B,KAAK,OAAO;IACjE,6EAA6E;IAC7E,qEAAqE;IACrE,iBAAiB,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,KAAK,MAAM;CAChE,CAAC,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grok 4.5 (grok-4.5)
|
|
3
|
+
* xAI flagship as of July 2026 — reasoning, function calling, structured
|
|
4
|
+
* outputs, vision input. Aliases: grok-4.5-latest, grok-build-latest.
|
|
5
|
+
*
|
|
6
|
+
* Specs from the xAI docs (developers/models/grok-4.5, pulled 2026-07-09):
|
|
7
|
+
* 500K context · $2.00 input / $0.50 cached input / $6.00 output per M ·
|
|
8
|
+
* 150 RPS / 50M TPM. Max output tokens not published — using the grok-4
|
|
9
|
+
* family default (131072).
|
|
10
|
+
*/
|
|
11
|
+
import type { ModelConfig } from '../../ModelConfig.interface.js';
|
|
12
|
+
export declare const grok45: ModelConfig;
|
|
13
|
+
//# sourceMappingURL=grok-4-5.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-4-5.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/xai/grok-4-5.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAElE,eAAO,MAAM,MAAM,EAAE,WAYnB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grok 4.5 (grok-4.5)
|
|
3
|
+
* xAI flagship as of July 2026 — reasoning, function calling, structured
|
|
4
|
+
* outputs, vision input. Aliases: grok-4.5-latest, grok-build-latest.
|
|
5
|
+
*
|
|
6
|
+
* Specs from the xAI docs (developers/models/grok-4.5, pulled 2026-07-09):
|
|
7
|
+
* 500K context · $2.00 input / $0.50 cached input / $6.00 output per M ·
|
|
8
|
+
* 150 RPS / 50M TPM. Max output tokens not published — using the grok-4
|
|
9
|
+
* family default (131072).
|
|
10
|
+
*/
|
|
11
|
+
import { createXAIModelConfig } from '../../configurators/XAIConfigurator.js';
|
|
12
|
+
export const grok45 = createXAIModelConfig({
|
|
13
|
+
id: 'grok-4.5',
|
|
14
|
+
displayName: 'Grok 4.5',
|
|
15
|
+
family: 'grok-4',
|
|
16
|
+
contextWindow: 500000,
|
|
17
|
+
outputTokens: 131072,
|
|
18
|
+
inputCost: 2.00,
|
|
19
|
+
cachedInputCost: 0.50,
|
|
20
|
+
outputCost: 6.00,
|
|
21
|
+
supportsReasoning: true,
|
|
22
|
+
reasoningToggleable: false,
|
|
23
|
+
reasoningEffort: 'high',
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=grok-4-5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-4-5.js","sourceRoot":"","sources":["../../../../src/models/cards/xai/grok-4-5.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAG9E,MAAM,CAAC,MAAM,MAAM,GAAgB,oBAAoB,CAAC;IACtD,EAAE,EAAE,UAAU;IACd,WAAW,EAAE,UAAU;IACvB,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,MAAM;IACrB,YAAY,EAAE,MAAM;IACpB,SAAS,EAAE,IAAI;IACf,eAAe,EAAE,IAAI;IACrB,UAAU,EAAE,IAAI;IAChB,iBAAiB,EAAE,IAAI;IACvB,mBAAmB,EAAE,KAAK;IAC1B,eAAe,EAAE,MAAM;CACxB,CAAC,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* XAI Grok Model Cards
|
|
3
3
|
* Auto-exported for easy discovery
|
|
4
4
|
*/
|
|
5
|
+
export { grok45 } from './grok-4-5.js';
|
|
5
6
|
export { grok43 } from './grok-4-3.js';
|
|
6
7
|
export { grok420Reasoning } from './grok-4-20-reasoning.js';
|
|
7
8
|
export { grok420NonReasoning } from './grok-4-20-non-reasoning.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/xai/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/models/cards/xai/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAGrE,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* XAI Grok Model Cards
|
|
3
3
|
* Auto-exported for easy discovery
|
|
4
4
|
*/
|
|
5
|
+
export { grok45 } from './grok-4-5.js';
|
|
5
6
|
export { grok43 } from './grok-4-3.js';
|
|
6
7
|
export { grok420Reasoning } from './grok-4-20-reasoning.js';
|
|
7
8
|
export { grok420NonReasoning } from './grok-4-20-non-reasoning.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/cards/xai/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,qCAAqC;AACrC,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/models/cards/xai/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,qCAAqC;AACrC,OAAO,EAAE,mBAAmB,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HuggingFace Gradio Space Model Configurator
|
|
3
|
+
*
|
|
4
|
+
* Serve a model from a HuggingFace Gradio Space and use it in the harness natively.
|
|
5
|
+
* The Space must expose a Gradio API named `/run` with the signature
|
|
6
|
+
* run(messages_json: str, tools_json: str, max_new_tokens: int, temperature: float) -> str
|
|
7
|
+
* returning the model's raw text (native tool-call + <think> syntax). The harness calls
|
|
8
|
+
* it via @gradio/client (provider 'hf-space', APIClient.sendHFSpaceAPI) and normalizes
|
|
9
|
+
* the raw output to the OpenAI shape in-process (see models/hfSpace/normalize.ts).
|
|
10
|
+
*
|
|
11
|
+
* A ready-to-deploy Space template lives at scripts/hf-space-template/ (app.py etc.).
|
|
12
|
+
* Non-streaming: the Gradio predict() call is blocking.
|
|
13
|
+
*/
|
|
14
|
+
import type { ModelConfig } from '../ModelConfig.interface.js';
|
|
15
|
+
export interface HFSpaceModelOptions {
|
|
16
|
+
id: string;
|
|
17
|
+
displayName: string;
|
|
18
|
+
family: string;
|
|
19
|
+
/** The Gradio Space id, e.g. "your-user/your-space". */
|
|
20
|
+
spaceId: string;
|
|
21
|
+
contextWindow: number;
|
|
22
|
+
outputTokens: number;
|
|
23
|
+
supportsTools?: boolean;
|
|
24
|
+
/** Model exposes chain-of-thought (Qwen3/SmolLM3 thinking) -> reasoning_content. */
|
|
25
|
+
supportsReasoning?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The HF model repo this card expects the Space to be serving (e.g. "Qwen/Qwen3-0.6B").
|
|
28
|
+
* The template Space prefixes every completion with [MODEL=<repo>]; when set, the
|
|
29
|
+
* transport verifies the prefix and fails loudly on mismatch instead of silently
|
|
30
|
+
* benchmarking/serving a mislabeled model.
|
|
31
|
+
*/
|
|
32
|
+
expectedSpaceModel?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Force this sampling temperature for the Space regardless of inherited request
|
|
35
|
+
* defaults. Format-fragile tool callers (Phi-4-mini) emit clean structured calls
|
|
36
|
+
* only near-greedy; at 0.7 they degenerate (language flips, prose instead of the
|
|
37
|
+
* call array). The transport prefers this over the request's inherited value.
|
|
38
|
+
*/
|
|
39
|
+
defaultTemperature?: number;
|
|
40
|
+
}
|
|
41
|
+
export declare function createHFSpaceModelConfig(options: HFSpaceModelOptions): ModelConfig;
|
|
42
|
+
//# sourceMappingURL=HFSpaceConfigurator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HFSpaceConfigurator.d.ts","sourceRoot":"","sources":["../../../src/models/configurators/HFSpaceConfigurator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,wDAAwD;IACxD,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oFAAoF;IACpF,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,mBAAmB,GAAG,WAAW,CAkElF"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HuggingFace Gradio Space Model Configurator
|
|
3
|
+
*
|
|
4
|
+
* Serve a model from a HuggingFace Gradio Space and use it in the harness natively.
|
|
5
|
+
* The Space must expose a Gradio API named `/run` with the signature
|
|
6
|
+
* run(messages_json: str, tools_json: str, max_new_tokens: int, temperature: float) -> str
|
|
7
|
+
* returning the model's raw text (native tool-call + <think> syntax). The harness calls
|
|
8
|
+
* it via @gradio/client (provider 'hf-space', APIClient.sendHFSpaceAPI) and normalizes
|
|
9
|
+
* the raw output to the OpenAI shape in-process (see models/hfSpace/normalize.ts).
|
|
10
|
+
*
|
|
11
|
+
* A ready-to-deploy Space template lives at scripts/hf-space-template/ (app.py etc.).
|
|
12
|
+
* Non-streaming: the Gradio predict() call is blocking.
|
|
13
|
+
*/
|
|
14
|
+
export function createHFSpaceModelConfig(options) {
|
|
15
|
+
const supportsTools = options.supportsTools !== undefined ? options.supportsTools : true;
|
|
16
|
+
return {
|
|
17
|
+
id: options.id,
|
|
18
|
+
provider: 'hf-space',
|
|
19
|
+
displayName: options.displayName,
|
|
20
|
+
family: options.family,
|
|
21
|
+
api: {
|
|
22
|
+
pattern: 'hf-space', // APIClient -> sendHFSpaceAPI (Gradio transport)
|
|
23
|
+
endpoint: options.spaceId, // the Space id, NOT a URL
|
|
24
|
+
apiKeyEnvVar: 'HF_TOKEN',
|
|
25
|
+
authHeader: 'Authorization',
|
|
26
|
+
authPrefix: 'Bearer',
|
|
27
|
+
},
|
|
28
|
+
tools: {
|
|
29
|
+
supported: supportsTools,
|
|
30
|
+
adapter: 'ChatCompletionsAPIAdapter', // request-building reuses the OpenAI adapter
|
|
31
|
+
namingConvention: 'snake_case',
|
|
32
|
+
maxTools: supportsTools ? 128 : 0,
|
|
33
|
+
parallelToolCalls: supportsTools,
|
|
34
|
+
},
|
|
35
|
+
parameters: {
|
|
36
|
+
temperature: {
|
|
37
|
+
supported: true, paramName: 'temperature', min: 0.0, max: 2.0,
|
|
38
|
+
...(options.defaultTemperature !== undefined && { default: options.defaultTemperature }),
|
|
39
|
+
},
|
|
40
|
+
maxTokens: { supported: true, paramName: 'max_tokens', default: 2048, min: 1, max: options.outputTokens },
|
|
41
|
+
topP: { supported: true, paramName: 'top_p', default: 1.0, min: 0.0, max: 1.0 },
|
|
42
|
+
},
|
|
43
|
+
limits: {
|
|
44
|
+
contextWindow: options.contextWindow,
|
|
45
|
+
outputTokens: options.outputTokens,
|
|
46
|
+
requestsPerMinute: 60,
|
|
47
|
+
tokensPerMinute: 100000,
|
|
48
|
+
},
|
|
49
|
+
// Non-streaming: the Gradio predict() call returns the full completion at once.
|
|
50
|
+
streaming: { supported: false, format: 'sse' },
|
|
51
|
+
compaction: {
|
|
52
|
+
strategy: 'auto',
|
|
53
|
+
thresholdCalculation: { method: 'percentage', percentage: 0.8, safetyMargin: 4000 },
|
|
54
|
+
behavior: { preserveRecent: 10, compactOlder: true, useHelperModel: false },
|
|
55
|
+
},
|
|
56
|
+
cost: { inputPerMillion: 0.0, outputPerMillion: 0.0 },
|
|
57
|
+
...(options.expectedSpaceModel && {
|
|
58
|
+
metadata: { hfSpaceExpectedModel: options.expectedSpaceModel },
|
|
59
|
+
}),
|
|
60
|
+
// DeepSeek/CF reasoner pattern: reasoning arrives as a separate reasoning_content field.
|
|
61
|
+
...(options.supportsReasoning && {
|
|
62
|
+
reasoning: {
|
|
63
|
+
supported: true,
|
|
64
|
+
format: 'reasoning_content',
|
|
65
|
+
extractionMethod: 'separate_field',
|
|
66
|
+
pattern: 'interleaved',
|
|
67
|
+
},
|
|
68
|
+
}),
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=HFSpaceConfigurator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HFSpaceConfigurator.js","sourceRoot":"","sources":["../../../src/models/configurators/HFSpaceConfigurator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA+BH,MAAM,UAAU,wBAAwB,CAAC,OAA4B;IACnE,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;IAEzF,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE;QACd,QAAQ,EAAE,UAAU;QACpB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,MAAM,EAAE,OAAO,CAAC,MAAM;QAEtB,GAAG,EAAE;YACH,OAAO,EAAE,UAAU,EAAS,iDAAiD;YAC7E,QAAQ,EAAE,OAAO,CAAC,OAAO,EAAG,0BAA0B;YACtD,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,QAAQ;SACrB;QAED,KAAK,EAAE;YACL,SAAS,EAAE,aAAa;YACxB,OAAO,EAAE,2BAA2B,EAAE,6CAA6C;YACnF,gBAAgB,EAAE,YAAY;YAC9B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,iBAAiB,EAAE,aAAa;SACjC;QAED,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG;gBAC7D,GAAG,CAAC,OAAO,CAAC,kBAAkB,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,kBAAkB,EAAE,CAAC;aACzF;YACD,SAAS,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,YAAY,EAAE;YACzG,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE;SAChF;QAED,MAAM,EAAE;YACN,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,iBAAiB,EAAE,EAAE;YACrB,eAAe,EAAE,MAAM;SACxB;QAED,gFAAgF;QAChF,SAAS,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE;QAE9C,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM;YAChB,oBAAoB,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE;YACnF,QAAQ,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE;SAC5E;QAED,IAAI,EAAE,EAAE,eAAe,EAAE,GAAG,EAAE,gBAAgB,EAAE,GAAG,EAAE;QAErD,GAAG,CAAC,OAAO,CAAC,kBAAkB,IAAI;YAChC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,OAAO,CAAC,kBAAkB,EAAE;SAC/D,CAAC;QAEF,yFAAyF;QACzF,GAAG,CAAC,OAAO,CAAC,iBAAiB,IAAI;YAC/B,SAAS,EAAE;gBACT,SAAS,EAAE,IAAI;gBACf,MAAM,EAAE,mBAAmB;gBAC3B,gBAAgB,EAAE,gBAAgB;gBAClC,OAAO,EAAE,aAAa;aACvB;SACF,CAAC;KACH,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hugging Face Model Configurator
|
|
3
3
|
*
|
|
4
|
-
* Factory
|
|
5
|
-
*
|
|
4
|
+
* Factory for HF Inference Providers model configs. Routes through the OpenAI-compatible
|
|
5
|
+
* router (router.huggingface.co) with server-side provider selection.
|
|
6
6
|
*
|
|
7
|
-
* API Docs: https://huggingface.co/docs/
|
|
7
|
+
* API Docs: https://huggingface.co/docs/inference-providers/index
|
|
8
8
|
*/
|
|
9
9
|
import type { ModelConfig } from '../ModelConfig.interface.js';
|
|
10
10
|
export interface HuggingFaceModelOptions {
|
|
@@ -17,13 +17,13 @@ export interface HuggingFaceModelOptions {
|
|
|
17
17
|
outputCost?: number;
|
|
18
18
|
supportsTools?: boolean;
|
|
19
19
|
/**
|
|
20
|
-
* Hugging Face model ID (e.g., '
|
|
21
|
-
* If not provided, uses the 'id' field
|
|
20
|
+
* Hugging Face model ID (e.g., 'openai/gpt-oss-120b'). Sent as the request-body
|
|
21
|
+
* "model". If not provided, uses the 'id' field.
|
|
22
22
|
*/
|
|
23
23
|
huggingFaceModelId?: string;
|
|
24
24
|
/**
|
|
25
|
-
* For dedicated
|
|
26
|
-
* Format: https://[endpoint-id].
|
|
25
|
+
* For a dedicated HF Inference Endpoint (optional)
|
|
26
|
+
* Format: https://[endpoint-id].[region].aws.endpoints.huggingface.cloud/v1/chat/completions
|
|
27
27
|
*/
|
|
28
28
|
customEndpoint?: string;
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HuggingFaceConfigurator.d.ts","sourceRoot":"","sources":["../../../src/models/configurators/HuggingFaceConfigurator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,uBAAuB,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"HuggingFaceConfigurator.d.ts","sourceRoot":"","sources":["../../../src/models/configurators/HuggingFaceConfigurator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,uBAAuB,GAAG,WAAW,CA2F1F"}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Hugging Face Model Configurator
|
|
3
3
|
*
|
|
4
|
-
* Factory
|
|
5
|
-
*
|
|
4
|
+
* Factory for HF Inference Providers model configs. Routes through the OpenAI-compatible
|
|
5
|
+
* router (router.huggingface.co) with server-side provider selection.
|
|
6
6
|
*
|
|
7
|
-
* API Docs: https://huggingface.co/docs/
|
|
7
|
+
* API Docs: https://huggingface.co/docs/inference-providers/index
|
|
8
8
|
*/
|
|
9
9
|
export function createHuggingFaceModelConfig(options) {
|
|
10
10
|
const supportsTools = options.supportsTools !== undefined ? options.supportsTools : false;
|
|
11
|
+
// The HF repo id (e.g. "meta-llama/Llama-3.1-8B-Instruct"). Sent as the request-body
|
|
12
|
+
// "model" (= config.id), matching the OpenAI card convention (id === API model name).
|
|
13
|
+
// Append a policy/provider suffix to steer routing: ":fastest" (default), ":cheapest",
|
|
14
|
+
// or ":together" / ":groq" / etc. for a specific provider.
|
|
11
15
|
const modelId = options.huggingFaceModelId || options.id;
|
|
12
|
-
//
|
|
16
|
+
// HF Inference Providers OpenAI-compatible router (auto provider selection). The legacy
|
|
17
|
+
// api-inference.huggingface.co host is deprecated. NOTE: the router hosts mostly larger
|
|
18
|
+
// popular models via partner providers — small models are typically NOT served, so use
|
|
19
|
+
// a local card for those. Override with customEndpoint for a dedicated endpoint.
|
|
13
20
|
const endpoint = options.customEndpoint ||
|
|
14
|
-
|
|
21
|
+
'https://router.huggingface.co/v1/chat/completions';
|
|
15
22
|
return {
|
|
16
|
-
id:
|
|
23
|
+
id: modelId,
|
|
17
24
|
provider: 'huggingface',
|
|
18
25
|
displayName: options.displayName,
|
|
19
26
|
family: options.family,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HuggingFaceConfigurator.js","sourceRoot":"","sources":["../../../src/models/configurators/HuggingFaceConfigurator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2BH,MAAM,UAAU,4BAA4B,CAAC,OAAgC;IAC3E,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1F,MAAM,OAAO,GAAG,OAAO,CAAC,kBAAkB,IAAI,OAAO,CAAC,EAAE,CAAC;IAEzD,
|
|
1
|
+
{"version":3,"file":"HuggingFaceConfigurator.js","sourceRoot":"","sources":["../../../src/models/configurators/HuggingFaceConfigurator.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA2BH,MAAM,UAAU,4BAA4B,CAAC,OAAgC;IAC3E,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,KAAK,CAAC;IAC1F,qFAAqF;IACrF,sFAAsF;IACtF,uFAAuF;IACvF,2DAA2D;IAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,kBAAkB,IAAI,OAAO,CAAC,EAAE,CAAC;IAEzD,wFAAwF;IACxF,wFAAwF;IACxF,uFAAuF;IACvF,iFAAiF;IACjF,MAAM,QAAQ,GAAG,OAAO,CAAC,cAAc;QACvB,mDAAmD,CAAC;IAEpE,OAAO;QACL,EAAE,EAAE,OAAO;QACX,QAAQ,EAAE,aAAa;QACvB,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,MAAM,EAAE,OAAO,CAAC,MAAM;QAEtB,GAAG,EAAE;YACH,OAAO,EAAE,kBAAkB,EAAG,6CAA6C;YAC3E,QAAQ,EAAE,QAAQ;YAClB,YAAY,EAAE,qBAAqB;YACnC,UAAU,EAAE,eAAe;YAC3B,UAAU,EAAE,QAAQ;SACrB;QAED,KAAK,EAAE;YACL,SAAS,EAAE,aAAa;YACxB,OAAO,EAAE,2BAA2B;YACpC,gBAAgB,EAAE,YAAY;YAC9B,QAAQ,EAAE,aAAa,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACjC,iBAAiB,EAAE,aAAa;SACjC;QAED,UAAU,EAAE;YACV,WAAW,EAAE;gBACX,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,aAAa;gBACxB,GAAG,EAAE,GAAG;gBACR,GAAG,EAAE,GAAG;aACT;YACD,SAAS,EAAE;gBACT,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,YAAY;gBACvB,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,CAAC;gBACN,GAAG,EAAE,OAAO,CAAC,YAAY;aAC1B;YACD,IAAI,EAAE;gBACJ,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,OAAO;gBAClB,OAAO,EAAE,IAAI;gBACb,GAAG,EAAE,GAAG;gBACR,GAAG,EAAE,GAAG;aACT;SACF;QAED,MAAM,EAAE;YACN,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,YAAY,EAAE,OAAO,CAAC,YAAY;YAClC,iBAAiB,EAAE,GAAG,EAAK,wBAAwB;YACnD,eAAe,EAAE,MAAM,CAAI,iBAAiB;SAC7C;QAED,SAAS,EAAE;YACT,SAAS,EAAE,IAAI;YACf,MAAM,EAAE,KAAK;SACd;QAED,UAAU,EAAE;YACV,QAAQ,EAAE,MAAM;YAChB,oBAAoB,EAAE;gBACpB,MAAM,EAAE,YAAY;gBACpB,UAAU,EAAE,GAAG;gBACf,YAAY,EAAE,IAAI;aACnB;YACD,QAAQ,EAAE;gBACR,cAAc,EAAE,EAAE;gBAClB,YAAY,EAAE,IAAI;gBAClB,cAAc,EAAE,KAAK;aACtB;SACF;QAED,IAAI,EAAE;YACJ,eAAe,EAAE,OAAO,CAAC,SAAS,IAAI,GAAG,EAAI,oCAAoC;YACjF,gBAAgB,EAAE,OAAO,CAAC,UAAU,IAAI,GAAG;SAC5C;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -23,6 +23,13 @@ export interface LocalModelOptions {
|
|
|
23
23
|
apiKeyEnvVar?: string;
|
|
24
24
|
/** Whether the model supports tool calling */
|
|
25
25
|
supportsTools?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Whether the model exposes reasoning / chain-of-thought as a separate
|
|
28
|
+
* `reasoning_content` field (like DeepSeek / CF reasoners: gpt-oss, qwq, kimi,
|
|
29
|
+
* and Qwen3 / SmolLM3 in thinking mode). The server (or proxy) must emit
|
|
30
|
+
* `reasoning_content`; run the model with thinking enabled.
|
|
31
|
+
*/
|
|
32
|
+
supportsReasoning?: boolean;
|
|
26
33
|
/** Custom provider name (default: 'local') */
|
|
27
34
|
provider?: string;
|
|
28
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocalModelConfigurator.d.ts","sourceRoot":"","sources":["../../../src/models/configurators/LocalModelConfigurator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IAErB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,
|
|
1
|
+
{"version":3,"file":"LocalModelConfigurator.d.ts","sourceRoot":"","sources":["../../../src/models/configurators/LocalModelConfigurator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IAErB,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,kFAAkF;IAClF,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAE5B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,WAAW,CA6F9E"}
|
|
@@ -82,7 +82,17 @@ export function createLocalModelConfig(options) {
|
|
|
82
82
|
cost: {
|
|
83
83
|
inputPerMillion: 0.0, // FREE - local inference
|
|
84
84
|
outputPerMillion: 0.0 // FREE - local inference
|
|
85
|
-
}
|
|
85
|
+
},
|
|
86
|
+
// Mirrors the DeepSeek / Cloudflare reasoner pattern: reasoning arrives as a
|
|
87
|
+
// separate `reasoning_content` field, which the harness reads generically.
|
|
88
|
+
...(options.supportsReasoning && {
|
|
89
|
+
reasoning: {
|
|
90
|
+
supported: true,
|
|
91
|
+
format: 'reasoning_content',
|
|
92
|
+
extractionMethod: 'separate_field',
|
|
93
|
+
pattern: 'interleaved'
|
|
94
|
+
}
|
|
95
|
+
})
|
|
86
96
|
};
|
|
87
97
|
}
|
|
88
98
|
//# sourceMappingURL=LocalModelConfigurator.js.map
|