tryaii-dre 0.2.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 +190 -0
- package/README.md +234 -0
- package/dist/banner.d.ts +24 -0
- package/dist/banner.d.ts.map +1 -0
- package/dist/banner.js +125 -0
- package/dist/banner.js.map +1 -0
- package/dist/benchmarks/index.d.ts +4 -0
- package/dist/benchmarks/index.d.ts.map +1 -0
- package/dist/benchmarks/index.js +3 -0
- package/dist/benchmarks/index.js.map +1 -0
- package/dist/benchmarks/registry.d.ts +69 -0
- package/dist/benchmarks/registry.d.ts.map +1 -0
- package/dist/benchmarks/registry.js +128 -0
- package/dist/benchmarks/registry.js.map +1 -0
- package/dist/benchmarks/standard.d.ts +6 -0
- package/dist/benchmarks/standard.d.ts.map +1 -0
- package/dist/benchmarks/standard.js +115 -0
- package/dist/benchmarks/standard.js.map +1 -0
- package/dist/budget.d.ts +65 -0
- package/dist/budget.d.ts.map +1 -0
- package/dist/budget.js +344 -0
- package/dist/budget.js.map +1 -0
- package/dist/cache/index.d.ts +27 -0
- package/dist/cache/index.d.ts.map +1 -0
- package/dist/cache/index.js +63 -0
- package/dist/cache/index.js.map +1 -0
- package/dist/centroids/data/centroids_all-MiniLM-L6-v2.json +1 -0
- package/dist/centroids/data/trainingQueries.json +246 -0
- package/dist/centroids/generator.d.ts +63 -0
- package/dist/centroids/generator.d.ts.map +1 -0
- package/dist/centroids/generator.js +120 -0
- package/dist/centroids/generator.js.map +1 -0
- package/dist/centroids/index.d.ts +3 -0
- package/dist/centroids/index.d.ts.map +1 -0
- package/dist/centroids/index.js +3 -0
- package/dist/centroids/index.js.map +1 -0
- package/dist/centroids/loader.d.ts +87 -0
- package/dist/centroids/loader.d.ts.map +1 -0
- package/dist/centroids/loader.js +236 -0
- package/dist/centroids/loader.js.map +1 -0
- package/dist/classifiers/base.d.ts +56 -0
- package/dist/classifiers/base.d.ts.map +1 -0
- package/dist/classifiers/base.js +42 -0
- package/dist/classifiers/base.js.map +1 -0
- package/dist/classifiers/embedding.d.ts +68 -0
- package/dist/classifiers/embedding.d.ts.map +1 -0
- package/dist/classifiers/embedding.js +0 -0
- package/dist/classifiers/embedding.js.map +1 -0
- package/dist/classifiers/hybrid.d.ts +31 -0
- package/dist/classifiers/hybrid.d.ts.map +1 -0
- package/dist/classifiers/hybrid.js +61 -0
- package/dist/classifiers/hybrid.js.map +1 -0
- package/dist/classifiers/index.d.ts +4 -0
- package/dist/classifiers/index.d.ts.map +1 -0
- package/dist/classifiers/index.js +3 -0
- package/dist/classifiers/index.js.map +1 -0
- package/dist/classifiers/keyword.d.ts +29 -0
- package/dist/classifiers/keyword.d.ts.map +1 -0
- package/dist/classifiers/keyword.js +264 -0
- package/dist/classifiers/keyword.js.map +1 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +597 -0
- package/dist/cli.js.map +1 -0
- package/dist/client-types.d.ts +101 -0
- package/dist/client-types.d.ts.map +1 -0
- package/dist/client-types.js +5 -0
- package/dist/client-types.js.map +1 -0
- package/dist/client.d.ts +50 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +279 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +45 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +37 -0
- package/dist/config.js.map +1 -0
- package/dist/dashboard/index.d.ts +48 -0
- package/dist/dashboard/index.d.ts.map +1 -0
- package/dist/dashboard/index.js +166 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/embeddings/base.d.ts +66 -0
- package/dist/embeddings/base.d.ts.map +1 -0
- package/dist/embeddings/base.js +77 -0
- package/dist/embeddings/base.js.map +1 -0
- package/dist/embeddings/index.d.ts +3 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/index.js +3 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/embeddings/local.d.ts +42 -0
- package/dist/embeddings/local.d.ts.map +1 -0
- package/dist/embeddings/local.js +89 -0
- package/dist/embeddings/local.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/index.d.ts +3 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +2 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/openrouter.d.ts +84 -0
- package/dist/integrations/openrouter.d.ts.map +1 -0
- package/dist/integrations/openrouter.js +253 -0
- package/dist/integrations/openrouter.js.map +1 -0
- package/dist/registry/index.d.ts +2 -0
- package/dist/registry/index.d.ts.map +1 -0
- package/dist/registry/index.js +2 -0
- package/dist/registry/index.js.map +1 -0
- package/dist/registry/models.d.ts +76 -0
- package/dist/registry/models.d.ts.map +1 -0
- package/dist/registry/models.js +170 -0
- package/dist/registry/models.js.map +1 -0
- package/dist/registry/presets/defaultModels.json +435 -0
- package/dist/router.d.ts +178 -0
- package/dist/router.d.ts.map +1 -0
- package/dist/router.js +259 -0
- package/dist/router.js.map +1 -0
- package/dist/scoring/benchmarks.d.ts +35 -0
- package/dist/scoring/benchmarks.d.ts.map +1 -0
- package/dist/scoring/benchmarks.js +68 -0
- package/dist/scoring/benchmarks.js.map +1 -0
- package/dist/scoring/engine.d.ts +43 -0
- package/dist/scoring/engine.d.ts.map +1 -0
- package/dist/scoring/engine.js +267 -0
- package/dist/scoring/engine.js.map +1 -0
- package/dist/scoring/index.d.ts +6 -0
- package/dist/scoring/index.d.ts.map +1 -0
- package/dist/scoring/index.js +4 -0
- package/dist/scoring/index.js.map +1 -0
- package/dist/scoring/priorities.d.ts +41 -0
- package/dist/scoring/priorities.d.ts.map +1 -0
- package/dist/scoring/priorities.js +49 -0
- package/dist/scoring/priorities.js.map +1 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/cosine.d.ts +10 -0
- package/dist/utils/cosine.d.ts.map +1 -0
- package/dist/utils/cosine.js +18 -0
- package/dist/utils/cosine.js.map +1 -0
- package/dist/utils/math.d.ts +18 -0
- package/dist/utils/math.d.ts.map +1 -0
- package/dist/utils/math.js +54 -0
- package/dist/utils/math.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,435 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "0.1.0",
|
|
3
|
+
"updated": "2026-01",
|
|
4
|
+
"models": [
|
|
5
|
+
{
|
|
6
|
+
"model_id": "gpt-4o",
|
|
7
|
+
"provider": "OpenAI",
|
|
8
|
+
"benchmark_scores": {
|
|
9
|
+
"MMLU": 86.4, "HellaSwag": 95.3, "HumanEval": 90.2, "SWE-bench": 30.7,
|
|
10
|
+
"TruthfulQA": 71.5, "ARC": 85.0, "GSM8K": 92.0, "DROP": 83.4,
|
|
11
|
+
"SuperGLUE": 90.0, "Chatbot Arena (LMSys)": 1441, "MT-Bench": 9.0
|
|
12
|
+
},
|
|
13
|
+
"capabilities": ["vision", "web-search", "multimodal"],
|
|
14
|
+
"pricing": {"input_per_1k": 0.0025, "output_per_1k": 0.01},
|
|
15
|
+
"latency": "fast",
|
|
16
|
+
"description": "GPT-4o: High-capability multimodal model"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"model_id": "gpt-4o-mini",
|
|
20
|
+
"provider": "OpenAI",
|
|
21
|
+
"benchmark_scores": {
|
|
22
|
+
"MMLU": 70.0, "HellaSwag": 85.5, "HumanEval": 87.2, "SWE-bench": 8.7,
|
|
23
|
+
"TruthfulQA": 47.0, "ARC": 82.0, "GSM8K": 87.0, "DROP": 65.0,
|
|
24
|
+
"SuperGLUE": 70.0, "Chatbot Arena (LMSys)": 1315, "MT-Bench": 7.5
|
|
25
|
+
},
|
|
26
|
+
"capabilities": ["fast-response", "cost-effective"],
|
|
27
|
+
"pricing": {"input_per_1k": 0.00015, "output_per_1k": 0.0006},
|
|
28
|
+
"latency": "very fast",
|
|
29
|
+
"description": "GPT-4o Mini: Fast and cost-effective"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"model_id": "o1",
|
|
33
|
+
"provider": "OpenAI",
|
|
34
|
+
"benchmark_scores": {
|
|
35
|
+
"MMLU": 83.5, "HellaSwag": 95.0, "HumanEval": 92.0, "SWE-bench": 48.9,
|
|
36
|
+
"TruthfulQA": 50.0, "ARC": 85.0, "GSM8K": 95.0, "DROP": 60.0,
|
|
37
|
+
"SuperGLUE": 75.0, "Chatbot Arena (LMSys)": 1398, "MT-Bench": 8.0
|
|
38
|
+
},
|
|
39
|
+
"capabilities": ["advanced-reasoning", "complex-problem-solving"],
|
|
40
|
+
"pricing": {"input_per_1k": 0.015, "output_per_1k": 0.06},
|
|
41
|
+
"latency": "slow",
|
|
42
|
+
"description": "O1: Advanced reasoning model"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"model_id": "o3",
|
|
46
|
+
"provider": "OpenAI",
|
|
47
|
+
"benchmark_scores": {
|
|
48
|
+
"MMLU": 85.6, "HellaSwag": 94.0, "HumanEval": 88.0, "SWE-bench": 69.1,
|
|
49
|
+
"TruthfulQA": 60.0, "ARC": 92.0, "GSM8K": 90.0, "DROP": 80.0,
|
|
50
|
+
"SuperGLUE": 85.0, "Chatbot Arena (LMSys)": 1450, "MT-Bench": 9.0
|
|
51
|
+
},
|
|
52
|
+
"capabilities": ["advanced-reasoning", "latest-model"],
|
|
53
|
+
"pricing": {"input_per_1k": 0.01, "output_per_1k": 0.04},
|
|
54
|
+
"latency": "medium",
|
|
55
|
+
"description": "O3: Latest reasoning model"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"model_id": "o4-mini",
|
|
59
|
+
"provider": "OpenAI",
|
|
60
|
+
"benchmark_scores": {
|
|
61
|
+
"MMLU": 80.6, "HellaSwag": 90.0, "HumanEval": 70.0, "SWE-bench": 68.1,
|
|
62
|
+
"TruthfulQA": 55.0, "ARC": 85.0, "GSM8K": 80.0, "DROP": 75.0,
|
|
63
|
+
"SuperGLUE": 78.0, "Chatbot Arena (LMSys)": 1397, "MT-Bench": 8.5
|
|
64
|
+
},
|
|
65
|
+
"capabilities": ["advanced-reasoning", "fast-response"],
|
|
66
|
+
"pricing": {"input_per_1k": 0.00110, "output_per_1k": 0.0044},
|
|
67
|
+
"latency": "fast",
|
|
68
|
+
"description": "O4 Mini: Fast reasoning"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"model_id": "gpt-5",
|
|
72
|
+
"provider": "OpenAI",
|
|
73
|
+
"benchmark_scores": {
|
|
74
|
+
"MMLU": 91.0, "HellaSwag": 95.0, "HumanEval": 92.0, "SWE-bench": 74.9,
|
|
75
|
+
"TruthfulQA": 78.0, "ARC": 93.0, "GSM8K": 95.0, "DROP": 86.0,
|
|
76
|
+
"SuperGLUE": 90.0, "Chatbot Arena (LMSys)": 1461, "MT-Bench": 9.6
|
|
77
|
+
},
|
|
78
|
+
"capabilities": ["advanced-reasoning", "multimodal", "latest-model"],
|
|
79
|
+
"pricing": {"input_per_1k": 0.00125, "output_per_1k": 0.01},
|
|
80
|
+
"latency": "medium",
|
|
81
|
+
"description": "GPT-5: Flagship model"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"model_id": "gpt-5-mini",
|
|
85
|
+
"provider": "OpenAI",
|
|
86
|
+
"benchmark_scores": {
|
|
87
|
+
"MMLU": 82.0, "HellaSwag": 88.0, "HumanEval": 88.0, "SWE-bench": 71.0,
|
|
88
|
+
"TruthfulQA": 60.0, "ARC": 88.0, "GSM8K": 92.0, "DROP": 82.0,
|
|
89
|
+
"SuperGLUE": 78.0, "Chatbot Arena (LMSys)": 1392, "MT-Bench": 9.0
|
|
90
|
+
},
|
|
91
|
+
"capabilities": ["fast-response", "cost-effective"],
|
|
92
|
+
"pricing": {"input_per_1k": 0.000375, "output_per_1k": 0.0015},
|
|
93
|
+
"latency": "fast",
|
|
94
|
+
"description": "GPT-5 Mini: Efficient lightweight"
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
"model_id": "gpt-5.1",
|
|
98
|
+
"provider": "OpenAI",
|
|
99
|
+
"benchmark_scores": {
|
|
100
|
+
"MMLU": 90.8, "HellaSwag": 96.0, "HumanEval": 93.0, "SWE-bench": 76.5,
|
|
101
|
+
"TruthfulQA": 80.0, "ARC": 94.0, "GSM8K": 96.5, "DROP": 87.0,
|
|
102
|
+
"SuperGLUE": 91.0, "Chatbot Arena (LMSys)": 1475, "MT-Bench": 9.7, "LiveBench": 75.0
|
|
103
|
+
},
|
|
104
|
+
"capabilities": ["advanced-reasoning", "multimodal", "vision", "latest-model"],
|
|
105
|
+
"pricing": {"input_per_1k": 0.00125, "output_per_1k": 0.01},
|
|
106
|
+
"latency": "medium",
|
|
107
|
+
"description": "GPT-5.1: Enhanced flagship"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"model_id": "gpt-5.2",
|
|
111
|
+
"provider": "OpenAI",
|
|
112
|
+
"benchmark_scores": {
|
|
113
|
+
"MMLU": 92.0, "HellaSwag": 97.0, "HumanEval": 95.0, "SWE-bench": 79.5,
|
|
114
|
+
"TruthfulQA": 82.0, "ARC": 90.5, "GSM8K": 98.0, "DROP": 89.0,
|
|
115
|
+
"SuperGLUE": 93.0, "Chatbot Arena (LMSys)": 1490, "MT-Bench": 9.8, "LiveBench": 78.0
|
|
116
|
+
},
|
|
117
|
+
"capabilities": ["advanced-reasoning", "multimodal", "vision", "agentic", "latest-model"],
|
|
118
|
+
"pricing": {"input_per_1k": 0.00125, "output_per_1k": 0.01},
|
|
119
|
+
"latency": "medium",
|
|
120
|
+
"description": "GPT-5.2: Latest flagship with agentic capabilities"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"model_id": "gpt-4.1",
|
|
124
|
+
"provider": "OpenAI",
|
|
125
|
+
"benchmark_scores": {
|
|
126
|
+
"MMLU": 90.2, "HellaSwag": 98.0, "HumanEval": 90.0, "SWE-bench": 54.6,
|
|
127
|
+
"TruthfulQA": 75.0, "ARC": 88.0, "GSM8K": 97.0, "DROP": 85.4,
|
|
128
|
+
"SuperGLUE": 90.0, "Chatbot Arena (LMSys)": 1406, "MT-Bench": 9.2
|
|
129
|
+
},
|
|
130
|
+
"capabilities": ["advanced-reasoning", "multimodal"],
|
|
131
|
+
"pricing": {"input_per_1k": 0.002, "output_per_1k": 0.008},
|
|
132
|
+
"latency": "fast",
|
|
133
|
+
"description": "GPT-4.1: Refined general-purpose model"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"model_id": "gpt-4.1-nano",
|
|
137
|
+
"provider": "OpenAI",
|
|
138
|
+
"benchmark_scores": {
|
|
139
|
+
"MMLU": 80.1, "HellaSwag": 88.0, "HumanEval": 85.0, "SWE-bench": 20.0,
|
|
140
|
+
"TruthfulQA": 50.0, "ARC": 72.0, "GSM8K": 80.0, "DROP": 70.0,
|
|
141
|
+
"SuperGLUE": 70.0, "Chatbot Arena (LMSys)": 1320, "MT-Bench": 7.0
|
|
142
|
+
},
|
|
143
|
+
"capabilities": ["fast-response", "cost-effective"],
|
|
144
|
+
"pricing": {"input_per_1k": 0.0001, "output_per_1k": 0.0004},
|
|
145
|
+
"latency": "very fast",
|
|
146
|
+
"description": "GPT-4.1 Nano: Ultra-cheap, ultra-fast"
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"model_id": "gpt-5-nano",
|
|
150
|
+
"provider": "OpenAI",
|
|
151
|
+
"benchmark_scores": {
|
|
152
|
+
"MMLU": 80.0, "HellaSwag": 85.0, "HumanEval": 80.0, "SWE-bench": 54.7,
|
|
153
|
+
"TruthfulQA": 50.0, "ARC": 75.0, "GSM8K": 90.0, "DROP": 75.0,
|
|
154
|
+
"SuperGLUE": 70.0, "Chatbot Arena (LMSys)": 1346, "MT-Bench": 8.0
|
|
155
|
+
},
|
|
156
|
+
"capabilities": ["fast-response", "cost-effective"],
|
|
157
|
+
"pricing": {"input_per_1k": 0.000075, "output_per_1k": 0.0003},
|
|
158
|
+
"latency": "very fast",
|
|
159
|
+
"description": "GPT-5 Nano: Smallest, cheapest GPT-5 variant"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"model_id": "claude-3-7-sonnet-20250219",
|
|
163
|
+
"provider": "Anthropic",
|
|
164
|
+
"benchmark_scores": {
|
|
165
|
+
"MMLU": 80.7, "HellaSwag": 80.0, "HumanEval": 85.0, "SWE-bench": 62.3,
|
|
166
|
+
"TruthfulQA": 65.0, "ARC": 84.0, "GSM8K": 90.0, "DROP": 80.0,
|
|
167
|
+
"SuperGLUE": 80.0, "Chatbot Arena (LMSys)": 1385, "MT-Bench": 8.5
|
|
168
|
+
},
|
|
169
|
+
"capabilities": ["long-context", "code-generation", "analysis"],
|
|
170
|
+
"pricing": {"input_per_1k": 0.003, "output_per_1k": 0.015},
|
|
171
|
+
"latency": "medium",
|
|
172
|
+
"description": "Claude 3.7 Sonnet: Strong all-rounder"
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"model_id": "claude-sonnet-4-20250514",
|
|
176
|
+
"provider": "Anthropic",
|
|
177
|
+
"benchmark_scores": {
|
|
178
|
+
"MMLU": 86.5, "HellaSwag": 89.0, "HumanEval": 92.0, "SWE-bench": 72.7,
|
|
179
|
+
"TruthfulQA": 75.0, "ARC": 87.0, "GSM8K": 91.0, "DROP": 85.0,
|
|
180
|
+
"SuperGLUE": 90.0, "Chatbot Arena (LMSys)": 1400, "MT-Bench": 9.5
|
|
181
|
+
},
|
|
182
|
+
"capabilities": ["advanced-reasoning", "long-context", "code-generation"],
|
|
183
|
+
"pricing": {"input_per_1k": 0.003, "output_per_1k": 0.015},
|
|
184
|
+
"latency": "medium",
|
|
185
|
+
"description": "Claude Sonnet 4: Advanced coding and reasoning"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"model_id": "claude-sonnet-4-5-20250929",
|
|
189
|
+
"provider": "Anthropic",
|
|
190
|
+
"benchmark_scores": {
|
|
191
|
+
"MMLU": 89.1, "HellaSwag": 92.0, "HumanEval": 93.0, "SWE-bench": 77.2,
|
|
192
|
+
"TruthfulQA": 75.0, "ARC": 90.0, "GSM8K": 95.0, "DROP": 85.0,
|
|
193
|
+
"SuperGLUE": 90.0, "Chatbot Arena (LMSys)": 1446, "MT-Bench": 9.5, "LiveBench": 73.0
|
|
194
|
+
},
|
|
195
|
+
"capabilities": ["advanced-reasoning", "long-context"],
|
|
196
|
+
"pricing": {"input_per_1k": 0.003, "output_per_1k": 0.015},
|
|
197
|
+
"latency": "medium",
|
|
198
|
+
"description": "Claude Sonnet 4.5: Enhanced reasoning"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"model_id": "claude-haiku-4-5-20251001",
|
|
202
|
+
"provider": "Anthropic",
|
|
203
|
+
"benchmark_scores": {
|
|
204
|
+
"MMLU": 65.4, "HellaSwag": 82.0, "HumanEval": 88.3, "SWE-bench": 73.3,
|
|
205
|
+
"TruthfulQA": 55.0, "ARC": 82.0, "GSM8K": 85.0, "DROP": 85.0,
|
|
206
|
+
"SuperGLUE": 72.0, "Chatbot Arena (LMSys)": 1378, "MT-Bench": 7.5, "LiveBench": 71.38
|
|
207
|
+
},
|
|
208
|
+
"capabilities": ["fast-response", "cost-effective", "computer-use"],
|
|
209
|
+
"pricing": {"input_per_1k": 0.0008, "output_per_1k": 0.004},
|
|
210
|
+
"latency": "fast",
|
|
211
|
+
"description": "Claude Haiku 4.5: Fast and affordable"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"model_id": "claude-opus-4-5-20251101",
|
|
215
|
+
"provider": "Anthropic",
|
|
216
|
+
"benchmark_scores": {
|
|
217
|
+
"MMLU": 90.8, "HellaSwag": 97.0, "HumanEval": 94.0, "SWE-bench": 80.9,
|
|
218
|
+
"TruthfulQA": 78.0, "ARC": 93.0, "GSM8K": 96.0, "DROP": 88.0,
|
|
219
|
+
"SuperGLUE": 92.0, "Chatbot Arena (LMSys)": 1493, "MT-Bench": 9.7, "LiveBench": 76.0
|
|
220
|
+
},
|
|
221
|
+
"capabilities": ["advanced-reasoning", "long-context", "agentic", "computer-use", "code-generation"],
|
|
222
|
+
"pricing": {"input_per_1k": 0.015, "output_per_1k": 0.075},
|
|
223
|
+
"latency": "slow",
|
|
224
|
+
"description": "Claude Opus 4.5: Most capable Anthropic model"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"model_id": "gemini-2.5-pro",
|
|
228
|
+
"provider": "Google",
|
|
229
|
+
"benchmark_scores": {
|
|
230
|
+
"MMLU": 84.1, "HellaSwag": 95.0, "HumanEval": 90.0, "SWE-bench": 63.8,
|
|
231
|
+
"TruthfulQA": 72.0, "ARC": 91.0, "GSM8K": 96.0, "DROP": 85.0,
|
|
232
|
+
"SuperGLUE": 88.0, "Chatbot Arena (LMSys)": 1458, "MT-Bench": 9.3
|
|
233
|
+
},
|
|
234
|
+
"capabilities": ["multimodal", "long-context"],
|
|
235
|
+
"pricing": {"input_per_1k": 0.00075, "output_per_1k": 0.003},
|
|
236
|
+
"latency": "medium",
|
|
237
|
+
"description": "Gemini 2.5 Pro: Strong multimodal model"
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"model_id": "gemini-2.0-flash",
|
|
241
|
+
"provider": "Google",
|
|
242
|
+
"benchmark_scores": {
|
|
243
|
+
"MMLU": 82.0, "HellaSwag": 90.0, "HumanEval": 80.0, "SWE-bench": 55.0,
|
|
244
|
+
"TruthfulQA": 68.0, "ARC": 83.0, "GSM8K": 90.0, "DROP": 80.0,
|
|
245
|
+
"SuperGLUE": 82.0, "Chatbot Arena (LMSys)": 1365, "MT-Bench": 8.5
|
|
246
|
+
},
|
|
247
|
+
"capabilities": ["fast-response", "multimodal"],
|
|
248
|
+
"pricing": {"input_per_1k": 0.0001, "output_per_1k": 0.0004},
|
|
249
|
+
"latency": "fast",
|
|
250
|
+
"description": "Gemini 2.0 Flash: Fast and affordable"
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
"model_id": "gemini-2.5-flash",
|
|
254
|
+
"provider": "Google",
|
|
255
|
+
"benchmark_scores": {
|
|
256
|
+
"MMLU": 84.0, "HellaSwag": 93.0, "HumanEval": 78.0, "SWE-bench": 50.0,
|
|
257
|
+
"TruthfulQA": 68.0, "ARC": 85.0, "GSM8K": 92.0, "DROP": 82.0,
|
|
258
|
+
"SuperGLUE": 85.0, "Chatbot Arena (LMSys)": 1406, "MT-Bench": 9.0
|
|
259
|
+
},
|
|
260
|
+
"capabilities": ["fast-response", "multimodal"],
|
|
261
|
+
"pricing": {"input_per_1k": 0.00015, "output_per_1k": 0.00035},
|
|
262
|
+
"latency": "fast",
|
|
263
|
+
"description": "Gemini 2.5 Flash: Balanced speed and quality"
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"model_id": "gemini-2.5-flash-lite",
|
|
267
|
+
"provider": "Google",
|
|
268
|
+
"benchmark_scores": {
|
|
269
|
+
"MMLU": 84.5, "HellaSwag": 88.0, "HumanEval": 72.0, "SWE-bench": 45.0,
|
|
270
|
+
"TruthfulQA": 65.0, "ARC": 78.0, "GSM8K": 88.0, "DROP": 75.0,
|
|
271
|
+
"SuperGLUE": 80.0, "Chatbot Arena (LMSys)": 1340, "MT-Bench": 8.0
|
|
272
|
+
},
|
|
273
|
+
"capabilities": ["fast-response", "cost-effective", "multimodal"],
|
|
274
|
+
"pricing": {"input_per_1k": 0.000075, "output_per_1k": 0.0003},
|
|
275
|
+
"latency": "very fast",
|
|
276
|
+
"description": "Gemini 2.5 Flash Lite: Ultra-affordable"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"model_id": "gemini-3-pro-preview",
|
|
280
|
+
"provider": "Google",
|
|
281
|
+
"benchmark_scores": {
|
|
282
|
+
"MMLU": 91.8, "HellaSwag": 96.0, "HumanEval": 92.0, "SWE-bench": 76.2,
|
|
283
|
+
"TruthfulQA": 75.0, "ARC": 93.0, "GSM8K": 97.0, "DROP": 87.0,
|
|
284
|
+
"SuperGLUE": 91.0, "Chatbot Arena (LMSys)": 1501, "MT-Bench": 9.5, "LiveBench": 74.0
|
|
285
|
+
},
|
|
286
|
+
"capabilities": ["advanced-reasoning", "multimodal", "long-context", "agentic", "deep-think"],
|
|
287
|
+
"pricing": {"input_per_1k": 0.00075, "output_per_1k": 0.003},
|
|
288
|
+
"latency": "medium",
|
|
289
|
+
"description": "Gemini 3 Pro: Top-tier multimodal reasoning"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
"model_id": "gemini-3-flash-preview",
|
|
293
|
+
"provider": "Google",
|
|
294
|
+
"benchmark_scores": {
|
|
295
|
+
"MMLU": 88.5, "HellaSwag": 94.0, "HumanEval": 88.0, "SWE-bench": 78.0,
|
|
296
|
+
"TruthfulQA": 72.0, "ARC": 88.0, "GSM8K": 94.0, "DROP": 84.0,
|
|
297
|
+
"SuperGLUE": 88.0, "Chatbot Arena (LMSys)": 1465, "MT-Bench": 9.2, "LiveBench": 72.0
|
|
298
|
+
},
|
|
299
|
+
"capabilities": ["fast-response", "multimodal", "agentic", "code-generation"],
|
|
300
|
+
"pricing": {"input_per_1k": 0.00015, "output_per_1k": 0.0006},
|
|
301
|
+
"latency": "fast",
|
|
302
|
+
"description": "Gemini 3 Flash: Fast agentic model"
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
"model_id": "deepseek-reasoner",
|
|
306
|
+
"provider": "DeepSeek",
|
|
307
|
+
"benchmark_scores": {
|
|
308
|
+
"MMLU": 90.8, "HellaSwag": 88.0, "HumanEval": 65.0, "SWE-bench": 49.2,
|
|
309
|
+
"TruthfulQA": 65.0, "ARC": 82.0, "GSM8K": 94.5, "DROP": 70.0,
|
|
310
|
+
"SuperGLUE": 80.0, "Chatbot Arena (LMSys)": 1394, "MT-Bench": 8.0
|
|
311
|
+
},
|
|
312
|
+
"capabilities": ["advanced-reasoning", "mathematical"],
|
|
313
|
+
"pricing": {"input_per_1k": 0.00055, "output_per_1k": 0.00219},
|
|
314
|
+
"latency": "medium",
|
|
315
|
+
"description": "DeepSeek Reasoner: Strong math and reasoning"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"model_id": "deepseek-chat",
|
|
319
|
+
"provider": "DeepSeek",
|
|
320
|
+
"benchmark_scores": {
|
|
321
|
+
"MMLU": 88.5, "HellaSwag": 88.9, "HumanEval": 65.2, "SWE-bench": 50.0,
|
|
322
|
+
"TruthfulQA": 60.0, "ARC": 78.0, "GSM8K": 89.3, "DROP": 80.0,
|
|
323
|
+
"SuperGLUE": 80.0, "Chatbot Arena (LMSys)": 1356, "MT-Bench": 8.5
|
|
324
|
+
},
|
|
325
|
+
"capabilities": ["cost-effective", "code-capable"],
|
|
326
|
+
"pricing": {"input_per_1k": 0.00027, "output_per_1k": 0.0011},
|
|
327
|
+
"latency": "fast",
|
|
328
|
+
"description": "DeepSeek Chat: Affordable general-purpose"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
"model_id": "grok-3-latest",
|
|
332
|
+
"provider": "xAI",
|
|
333
|
+
"benchmark_scores": {
|
|
334
|
+
"MMLU": 92.7, "HellaSwag": 95.0, "HumanEval": 86.5, "SWE-bench": 60.0,
|
|
335
|
+
"TruthfulQA": 70.0, "ARC": 85.0, "GSM8K": 89.3, "DROP": 85.0,
|
|
336
|
+
"SuperGLUE": 88.0, "Chatbot Arena (LMSys)": 1409, "MT-Bench": 9.2
|
|
337
|
+
},
|
|
338
|
+
"capabilities": ["real-time-info", "web-access"],
|
|
339
|
+
"pricing": {"input_per_1k": 0.003, "output_per_1k": 0.015},
|
|
340
|
+
"latency": "medium",
|
|
341
|
+
"description": "Grok 3: Real-time information access"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"model_id": "grok-3-mini-latest",
|
|
345
|
+
"provider": "xAI",
|
|
346
|
+
"benchmark_scores": {
|
|
347
|
+
"MMLU": 78.9, "HellaSwag": 85.0, "HumanEval": 50.0, "SWE-bench": 40.0,
|
|
348
|
+
"TruthfulQA": 55.0, "ARC": 75.0, "GSM8K": 75.0, "DROP": 65.0,
|
|
349
|
+
"SuperGLUE": 70.0, "Chatbot Arena (LMSys)": 1362, "MT-Bench": 7.5
|
|
350
|
+
},
|
|
351
|
+
"capabilities": ["cost-effective", "real-time-info"],
|
|
352
|
+
"pricing": {"input_per_1k": 0.0003, "output_per_1k": 0.0005},
|
|
353
|
+
"latency": "fast",
|
|
354
|
+
"description": "Grok 3 Mini: Affordable with web access"
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
"model_id": "grok-4-latest",
|
|
358
|
+
"provider": "xAI",
|
|
359
|
+
"benchmark_scores": {
|
|
360
|
+
"MMLU": 92.1, "HellaSwag": 95.0, "HumanEval": 94.7, "SWE-bench": 75.0,
|
|
361
|
+
"TruthfulQA": 70.0, "ARC": 92.0, "GSM8K": 95.2, "DROP": 85.0,
|
|
362
|
+
"SuperGLUE": 88.0, "Chatbot Arena (LMSys)": 1480, "MT-Bench": 9.3
|
|
363
|
+
},
|
|
364
|
+
"capabilities": ["advanced-reasoning", "real-time-info", "web-access", "tool-use"],
|
|
365
|
+
"pricing": {"input_per_1k": 0.002, "output_per_1k": 0.01},
|
|
366
|
+
"latency": "medium",
|
|
367
|
+
"description": "Grok 4: Premium reasoning with web"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"model_id": "grok-4-fast",
|
|
371
|
+
"provider": "xAI",
|
|
372
|
+
"benchmark_scores": {
|
|
373
|
+
"MMLU": 90.5, "HellaSwag": 93.0, "HumanEval": 91.0, "SWE-bench": 70.0,
|
|
374
|
+
"TruthfulQA": 68.0, "ARC": 88.0, "GSM8K": 92.0, "DROP": 82.0,
|
|
375
|
+
"SuperGLUE": 85.0, "Chatbot Arena (LMSys)": 1450, "MT-Bench": 9.0
|
|
376
|
+
},
|
|
377
|
+
"capabilities": ["fast-response", "real-time-info", "web-access"],
|
|
378
|
+
"pricing": {"input_per_1k": 0.0005, "output_per_1k": 0.0025},
|
|
379
|
+
"latency": "fast",
|
|
380
|
+
"description": "Grok 4 Fast: Balanced speed and capability"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
"model_id": "grok-4-1-fast-reasoning-latest",
|
|
384
|
+
"provider": "xAI",
|
|
385
|
+
"benchmark_scores": {
|
|
386
|
+
"MMLU": 94.2, "HellaSwag": 93.0, "HumanEval": 89.3, "SWE-bench": 68.0,
|
|
387
|
+
"TruthfulQA": 72.0, "ARC": 87.0, "GSM8K": 92.0, "DROP": 82.0,
|
|
388
|
+
"SuperGLUE": 86.0, "Chatbot Arena (LMSys)": 1455, "MT-Bench": 9.0, "LiveBench": 70.0
|
|
389
|
+
},
|
|
390
|
+
"capabilities": ["fast-response", "tool-use", "agentic", "real-time-info"],
|
|
391
|
+
"pricing": {"input_per_1k": 0.0005, "output_per_1k": 0.0025},
|
|
392
|
+
"latency": "fast",
|
|
393
|
+
"description": "Grok 4.1 Fast Reasoning: Fast agentic reasoning"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
"model_id": "grok-code-fast",
|
|
397
|
+
"provider": "xAI",
|
|
398
|
+
"benchmark_scores": {
|
|
399
|
+
"MMLU": 82.0, "HellaSwag": 88.0, "HumanEval": 92.0, "SWE-bench": 70.8,
|
|
400
|
+
"TruthfulQA": 65.0, "ARC": 82.0, "GSM8K": 85.0, "DROP": 78.0,
|
|
401
|
+
"SuperGLUE": 80.0, "Chatbot Arena (LMSys)": 1400, "MT-Bench": 8.5, "LiveBench": 68.0
|
|
402
|
+
},
|
|
403
|
+
"capabilities": ["fast-response", "cost-effective", "agentic", "code-generation"],
|
|
404
|
+
"pricing": {"input_per_1k": 0.00015, "output_per_1k": 0.0006},
|
|
405
|
+
"latency": "fast",
|
|
406
|
+
"description": "Grok Code Fast: Specialized for coding tasks"
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
"model_id": "mistral-large-latest",
|
|
410
|
+
"provider": "Mistral",
|
|
411
|
+
"benchmark_scores": {
|
|
412
|
+
"MMLU": 84.0, "HellaSwag": 90.0, "HumanEval": 65.0, "SWE-bench": 40.0,
|
|
413
|
+
"TruthfulQA": 60.0, "ARC": 82.0, "GSM8K": 81.0, "DROP": 70.0,
|
|
414
|
+
"SuperGLUE": 75.0, "Chatbot Arena (LMSys)": 1313, "MT-Bench": 7.5
|
|
415
|
+
},
|
|
416
|
+
"capabilities": ["cost-effective", "code-capable"],
|
|
417
|
+
"pricing": {"input_per_1k": 0.002, "output_per_1k": 0.006},
|
|
418
|
+
"latency": "medium",
|
|
419
|
+
"description": "Mistral Large: European AI model"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"model_id": "mistral-small-latest",
|
|
423
|
+
"provider": "Mistral",
|
|
424
|
+
"benchmark_scores": {
|
|
425
|
+
"MMLU": 39.9, "HellaSwag": 70.0, "HumanEval": 30.0, "SWE-bench": 20.0,
|
|
426
|
+
"TruthfulQA": 40.0, "ARC": 72.0, "GSM8K": 66.7, "DROP": 50.0,
|
|
427
|
+
"SuperGLUE": 50.0, "Chatbot Arena (LMSys)": 1351, "MT-Bench": 6.0
|
|
428
|
+
},
|
|
429
|
+
"capabilities": ["cost-effective", "fast-response"],
|
|
430
|
+
"pricing": {"input_per_1k": 0.0001, "output_per_1k": 0.0003},
|
|
431
|
+
"latency": "very fast",
|
|
432
|
+
"description": "Mistral Small: Ultra-affordable"
|
|
433
|
+
}
|
|
434
|
+
]
|
|
435
|
+
}
|
package/dist/router.d.ts
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Main Router -- the primary public API for TryAii-DRE.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* import { Router } from 'tryaii-dre';
|
|
6
|
+
*
|
|
7
|
+
* const router = new Router();
|
|
8
|
+
* const result = await router.route('Write a Python function to merge sorted arrays');
|
|
9
|
+
* console.log(result.bestModel); // e.g., "gpt-5.2"
|
|
10
|
+
* console.log(result.scores); // Top models with scores and reasoning
|
|
11
|
+
*
|
|
12
|
+
* The default `LocalEmbeddingProvider` is async-only, so `route()` itself is
|
|
13
|
+
* async. Callers that have injected a sync embedding provider can use the
|
|
14
|
+
* niche `routeSync()` method for a blocking call.
|
|
15
|
+
*/
|
|
16
|
+
import { BenchmarkRegistry } from './benchmarks/registry.js';
|
|
17
|
+
import { ClassificationResult } from './classifiers/base.js';
|
|
18
|
+
import { TryaiiDreConfig } from './config.js';
|
|
19
|
+
import { BaseEmbeddingProvider } from './embeddings/base.js';
|
|
20
|
+
import { ModelRegistry, ModelInfo } from './registry/models.js';
|
|
21
|
+
import { ModelScore } from './scoring/engine.js';
|
|
22
|
+
import { Priorities } from './scoring/priorities.js';
|
|
23
|
+
import type { LatencyTier } from './types.js';
|
|
24
|
+
/**
|
|
25
|
+
* Maximum allowed prompt length (characters). Prompts longer than this are
|
|
26
|
+
* truncated before classification to avoid OOM in the embedding model. Must
|
|
27
|
+
* stay in sync with the Python SDK's MAX_PROMPT_LENGTH (classifiers/base.py).
|
|
28
|
+
*/
|
|
29
|
+
export declare const MAX_PROMPT_LENGTH = 100000;
|
|
30
|
+
/**
|
|
31
|
+
* Result of routing a prompt.
|
|
32
|
+
*
|
|
33
|
+
* Contains the recommended model, all scored models, and classification details.
|
|
34
|
+
*/
|
|
35
|
+
export interface RouteResult {
|
|
36
|
+
/** The top recommended model ID. */
|
|
37
|
+
bestModel: string;
|
|
38
|
+
/** All scored models (sorted by score descending). */
|
|
39
|
+
scores: ModelScore[];
|
|
40
|
+
/** Classification details (what kind of task was detected). */
|
|
41
|
+
classification: ClassificationResult | null;
|
|
42
|
+
/** Priorities used for this routing decision. */
|
|
43
|
+
priorities: Priorities;
|
|
44
|
+
}
|
|
45
|
+
/** Get list of model IDs in ranked order from a RouteResult. */
|
|
46
|
+
export declare function routeResultTopK(result: RouteResult): string[];
|
|
47
|
+
/** Get the score of the top model. */
|
|
48
|
+
export declare function routeResultBestScore(result: RouteResult): number;
|
|
49
|
+
/** Get the reasoning for why the top model was chosen. */
|
|
50
|
+
export declare function routeResultBestReasoning(result: RouteResult): string;
|
|
51
|
+
/** Options for route(). */
|
|
52
|
+
export interface RouteOptions {
|
|
53
|
+
/** Quality/cost/speed priorities. Defaults to balanced. */
|
|
54
|
+
priorities?: Priorities;
|
|
55
|
+
/** Number of top models to return. */
|
|
56
|
+
topK?: number;
|
|
57
|
+
/** Only consider models from this provider. */
|
|
58
|
+
filterProvider?: string;
|
|
59
|
+
/** Only consider models with this capability. */
|
|
60
|
+
filterCapability?: string;
|
|
61
|
+
/** Only consider models cheaper than this (input $/1k tokens). */
|
|
62
|
+
filterMaxCost?: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Semantic AI model router.
|
|
66
|
+
*
|
|
67
|
+
* Analyzes user prompts using embeddings, matches them against benchmark
|
|
68
|
+
* centroids, and recommends the best AI model based on benchmark performance,
|
|
69
|
+
* pricing, latency, and user priorities.
|
|
70
|
+
*/
|
|
71
|
+
export declare class Router {
|
|
72
|
+
private _config;
|
|
73
|
+
private _registry;
|
|
74
|
+
private _benchmarkRegistry;
|
|
75
|
+
private _scoringEngine;
|
|
76
|
+
private _embeddingProvider;
|
|
77
|
+
private _centroidLoader;
|
|
78
|
+
private _classifier;
|
|
79
|
+
constructor(opts?: {
|
|
80
|
+
config?: Partial<TryaiiDreConfig>;
|
|
81
|
+
registry?: ModelRegistry;
|
|
82
|
+
benchmarkRegistry?: BenchmarkRegistry;
|
|
83
|
+
embeddingProvider?: BaseEmbeddingProvider;
|
|
84
|
+
});
|
|
85
|
+
/**
|
|
86
|
+
* Lazy-initialize the embedding provider + centroid loader.
|
|
87
|
+
*
|
|
88
|
+
* The loader is stored on `this` so that `addBenchmark()` mutates the
|
|
89
|
+
* same instance the classifier reads from -- custom benchmarks added
|
|
90
|
+
* via the Router become visible to subsequent `route()` calls without
|
|
91
|
+
* re-instantiating anything.
|
|
92
|
+
*/
|
|
93
|
+
private _ensureCentroidLoader;
|
|
94
|
+
/** Lazy-initialize the embedding classifier on first use. */
|
|
95
|
+
private _ensureClassifier;
|
|
96
|
+
/**
|
|
97
|
+
* Route a prompt to the best AI model.
|
|
98
|
+
*
|
|
99
|
+
* Async by default -- works with any embedding provider, including the
|
|
100
|
+
* default async `LocalEmbeddingProvider`. For a blocking call backed by a
|
|
101
|
+
* sync provider, see `routeSync()`.
|
|
102
|
+
*
|
|
103
|
+
* @param prompt - The user's input text to classify and route.
|
|
104
|
+
* @param opts - Routing options (priorities, filters, topK).
|
|
105
|
+
* @returns RouteResult with the best model and full scoring breakdown.
|
|
106
|
+
*/
|
|
107
|
+
route(prompt: string, opts?: RouteOptions): Promise<RouteResult>;
|
|
108
|
+
/**
|
|
109
|
+
* Synchronous version of `route()`.
|
|
110
|
+
*
|
|
111
|
+
* Requires the injected embedding provider to support sync calls
|
|
112
|
+
* (`supportsSync === true`). Throws otherwise -- the default
|
|
113
|
+
* `LocalEmbeddingProvider` is async-only, so calling `routeSync()` on a
|
|
114
|
+
* default `Router` will fail. Inject a sync provider (e.g. a custom
|
|
115
|
+
* cached provider) to use this path.
|
|
116
|
+
*/
|
|
117
|
+
routeSync(prompt: string, opts?: RouteOptions): RouteResult;
|
|
118
|
+
/**
|
|
119
|
+
* Validate and normalize a prompt before classification.
|
|
120
|
+
*
|
|
121
|
+
* Rejects empty/non-string prompts and truncates to MAX_PROMPT_LENGTH,
|
|
122
|
+
* matching the Python Router (which raises ValueError on empty/non-string
|
|
123
|
+
* and slices to the same limit) so both SDKs behave identically.
|
|
124
|
+
*/
|
|
125
|
+
private static _normalizePrompt;
|
|
126
|
+
/** Shared post-classification path: filter models, score, return RouteResult. */
|
|
127
|
+
private _buildResult;
|
|
128
|
+
/**
|
|
129
|
+
* Shortcut to add a model to the registry.
|
|
130
|
+
*
|
|
131
|
+
* @see ModelRegistry.add()
|
|
132
|
+
*/
|
|
133
|
+
addModel(opts: {
|
|
134
|
+
modelId: string;
|
|
135
|
+
provider: string;
|
|
136
|
+
benchmarks?: Record<string, number>;
|
|
137
|
+
pricing?: [number, number];
|
|
138
|
+
latency?: LatencyTier;
|
|
139
|
+
capabilities?: string[];
|
|
140
|
+
description?: string;
|
|
141
|
+
}): ModelInfo;
|
|
142
|
+
/**
|
|
143
|
+
* Add a custom benchmark to the routing system.
|
|
144
|
+
*
|
|
145
|
+
* Async by default -- works with any embedding provider, including the
|
|
146
|
+
* async-only `LocalEmbeddingProvider`. The new centroid is generated
|
|
147
|
+
* immediately and added to the shared centroid loader, so subsequent
|
|
148
|
+
* `route()` calls see it without any restart.
|
|
149
|
+
*
|
|
150
|
+
* For sync-provider callers who want a blocking setup step, use
|
|
151
|
+
* `addBenchmarkSync()`.
|
|
152
|
+
*
|
|
153
|
+
* @param name - Benchmark name (e.g., "CustomerSupportQA").
|
|
154
|
+
* @param queries - Representative prompts for this benchmark (10-20 recommended).
|
|
155
|
+
* @param description - Human-readable description.
|
|
156
|
+
* @param minScore - Minimum score for normalization.
|
|
157
|
+
* @param maxScore - Maximum score for normalization.
|
|
158
|
+
*/
|
|
159
|
+
addBenchmark(name: string, queries: string[], description?: string, minScore?: number, maxScore?: number): Promise<void>;
|
|
160
|
+
/**
|
|
161
|
+
* Synchronous version of `addBenchmark()`.
|
|
162
|
+
*
|
|
163
|
+
* Requires the injected embedding provider to support sync calls
|
|
164
|
+
* (`supportsSync === true`). The default `LocalEmbeddingProvider` is
|
|
165
|
+
* async-only, so calling `addBenchmarkSync()` on a default `Router`
|
|
166
|
+
* will throw.
|
|
167
|
+
*/
|
|
168
|
+
addBenchmarkSync(name: string, queries: string[], description?: string, minScore?: number, maxScore?: number): void;
|
|
169
|
+
/** Register a benchmark in the registry and rebuild the scoring normalizer. */
|
|
170
|
+
private _registerBenchmark;
|
|
171
|
+
/** Access the model registry. */
|
|
172
|
+
get models(): ModelRegistry;
|
|
173
|
+
/** Access the benchmark registry. */
|
|
174
|
+
get benchmarks(): BenchmarkRegistry;
|
|
175
|
+
/** Access the configuration. */
|
|
176
|
+
get config(): TryaiiDre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