@index9/mcp 1.0.32 → 4.0.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/README.md +16 -64
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +868 -0
- package/manifest.json +55 -0
- package/package.json +25 -42
- package/LICENSE +0 -21
- package/dist/client.d.ts +0 -5
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -39
- package/dist/config.d.ts +0 -8
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -9
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -32
- package/dist/logger.d.ts +0 -4
- package/dist/logger.d.ts.map +0 -1
- package/dist/logger.js +0 -8
- package/dist/mcp.d.ts +0 -4
- package/dist/mcp.d.ts.map +0 -1
- package/dist/mcp.js +0 -147
- package/dist/schemas.d.ts +0 -162
- package/dist/schemas.d.ts.map +0 -1
- package/dist/schemas.js +0 -208
- package/dist/tools/find_models.d.ts +0 -3
- package/dist/tools/find_models.d.ts.map +0 -1
- package/dist/tools/find_models.js +0 -4
- package/dist/tools/get_model.d.ts +0 -3
- package/dist/tools/get_model.d.ts.map +0 -1
- package/dist/tools/get_model.js +0 -4
- package/dist/tools/test_model.d.ts +0 -3
- package/dist/tools/test_model.d.ts.map +0 -1
- package/dist/tools/test_model.js +0 -5
- package/dist/types/api.d.ts +0 -107
- package/dist/types/api.d.ts.map +0 -1
- package/dist/types/api.js +0 -1
- package/dist/types/index.d.ts +0 -3
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/models.d.ts +0 -63
- package/dist/types/models.d.ts.map +0 -1
- package/dist/types/models.js +0 -1
- package/dist/utils/rateLimiter.d.ts +0 -7
- package/dist/utils/rateLimiter.d.ts.map +0 -1
- package/dist/utils/rateLimiter.js +0 -20
package/dist/schemas.js
DELETED
|
@@ -1,208 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
/**
|
|
3
|
-
* Find Models Tool Schema
|
|
4
|
-
* Unified search and filter for AI models
|
|
5
|
-
*/
|
|
6
|
-
export const findModelsSchema = z.object({
|
|
7
|
-
query: z
|
|
8
|
-
.string()
|
|
9
|
-
.max(500)
|
|
10
|
-
.describe("Natural language search query describing desired model characteristics (e.g., 'fastest coding model under $1', 'vision model with 128k context', 'cheapest tool-calling model'). Uses semantic search with fuzzy matching. Optional - omit to use filters only.")
|
|
11
|
-
.optional(),
|
|
12
|
-
provider: z
|
|
13
|
-
.string()
|
|
14
|
-
.describe("Filter by provider name(s). Comma-separated for multiple (e.g., 'openai,anthropic'). Case-insensitive.")
|
|
15
|
-
.optional(),
|
|
16
|
-
min_context: z
|
|
17
|
-
.number()
|
|
18
|
-
.min(0)
|
|
19
|
-
.describe("Minimum context window size in tokens (e.g., 8192, 32000, 128000). Filters out models with smaller context windows. Common values: 4096 (small), 32000 (medium), 128000+ (large).")
|
|
20
|
-
.optional(),
|
|
21
|
-
max_context: z
|
|
22
|
-
.number()
|
|
23
|
-
.min(0)
|
|
24
|
-
.describe("Maximum context window size in tokens. Filters out models with larger context windows. Use to find smaller, faster models.")
|
|
25
|
-
.optional(),
|
|
26
|
-
max_price_per_m: z
|
|
27
|
-
.number()
|
|
28
|
-
.min(0)
|
|
29
|
-
.describe("Maximum acceptable price per million input tokens in USD (e.g., 0.5 for $0.50/M tokens). Filters out more expensive models. Note: only considers input pricing for filtering.")
|
|
30
|
-
.optional(),
|
|
31
|
-
capabilities: z
|
|
32
|
-
.array(z.enum(["vision", "audio", "tool_calling", "json_mode", "video"]))
|
|
33
|
-
.describe("Required capabilities array - model must support ALL specified capabilities (AND logic). Examples: ['vision'] for image input, ['tool_calling', 'json_mode'] for structured outputs, ['vision', 'tool_calling'] for multimodal agents. Available: vision, audio, tool_calling, json_mode, video.")
|
|
34
|
-
.optional(),
|
|
35
|
-
sort_by: z
|
|
36
|
-
.enum(["relevance", "price_asc", "price_desc", "date_desc", "context_desc"])
|
|
37
|
-
.default("relevance")
|
|
38
|
-
.describe("Sort order for results. Options: 'relevance' (best semantic match, default), 'price_asc' (cheapest first by input price), 'price_desc' (most expensive first), 'date_desc' (newest models first), 'context_desc' (largest context window first). Defaults to 'relevance'.")
|
|
39
|
-
.optional(),
|
|
40
|
-
limit: z
|
|
41
|
-
.number()
|
|
42
|
-
.min(1)
|
|
43
|
-
.max(100)
|
|
44
|
-
.default(10)
|
|
45
|
-
.describe("Maximum number of results to return (1-100). Defaults to 10. Use higher values (20-50) for broad exploration, lower values (5-10) for focused comparisons."),
|
|
46
|
-
offset: z
|
|
47
|
-
.number()
|
|
48
|
-
.min(0)
|
|
49
|
-
.default(0)
|
|
50
|
-
.describe("Number of results to skip for pagination (0-based). Defaults to 0. Example: offset=10 with limit=10 returns results 11-20. Use with 'total' in response for pagination."),
|
|
51
|
-
});
|
|
52
|
-
/**
|
|
53
|
-
* Get Model Tool Schema
|
|
54
|
-
* Retrieve complete details for a specific model
|
|
55
|
-
*/
|
|
56
|
-
export const getModelSchema = z.object({
|
|
57
|
-
model_id: z
|
|
58
|
-
.string()
|
|
59
|
-
.min(1)
|
|
60
|
-
.describe("Exact model identifier in format 'provider/model-name' (e.g., 'openai/gpt-5.2', 'anthropic/claude-opus-4.5', 'google/gemini-2.5-flash-preview-09-2025'). Case-sensitive. Use find_models first to discover valid model IDs. Returns 404 if model not found."),
|
|
61
|
-
});
|
|
62
|
-
/**
|
|
63
|
-
* Test Model Tool Schema
|
|
64
|
-
* Run live API tests against models via OpenRouter
|
|
65
|
-
*/
|
|
66
|
-
export const testModelSchema = z.object({
|
|
67
|
-
model_ids: z
|
|
68
|
-
.array(z.string())
|
|
69
|
-
.min(1)
|
|
70
|
-
.max(5)
|
|
71
|
-
.describe("Array of 1-5 model IDs to test simultaneously in format 'provider/model-name' (e.g., ['openai/gpt-5.1-codex-max', 'anthropic/claude-haiku-4.5']). All models receive identical prompts. Use find_models or get_model first to identify model IDs."),
|
|
72
|
-
test_type: z
|
|
73
|
-
.enum(["quick", "code", "reasoning", "instruction", "tool_calling"])
|
|
74
|
-
.default("quick")
|
|
75
|
-
.describe("Preset test scenario. Ignored if custom 'prompt' provided. Options: 'quick' (simple math, fastest), 'code' (function generation), 'reasoning' (logic puzzle), 'instruction' (following complex directions), 'tool_calling' (function calling capability). Defaults to 'quick'."),
|
|
76
|
-
prompt: z
|
|
77
|
-
.string()
|
|
78
|
-
.describe("Custom user message to send to all models. Overrides 'test_type' when provided. Use for debugging specific issues, comparing exact outputs, or testing domain-specific prompts. Example: 'Write a Python function to validate email addresses'.")
|
|
79
|
-
.optional(),
|
|
80
|
-
max_tokens: z
|
|
81
|
-
.number()
|
|
82
|
-
.min(1)
|
|
83
|
-
.max(8192)
|
|
84
|
-
.default(1000)
|
|
85
|
-
.describe("Maximum tokens for model response (1-8192). Higher values allow longer outputs but increase cost and latency. Defaults to 1000. Use 100-500 for quick tests, 1000-2000 for code/reasoning, 4000+ for long-form content.")
|
|
86
|
-
.optional(),
|
|
87
|
-
temperature: z
|
|
88
|
-
.number()
|
|
89
|
-
.min(0)
|
|
90
|
-
.max(2)
|
|
91
|
-
.describe("Sampling temperature (0-2). Lower values are more deterministic, higher values more creative. Defaults to 0.7.")
|
|
92
|
-
.optional(),
|
|
93
|
-
system_prompt: z
|
|
94
|
-
.string()
|
|
95
|
-
.max(4000)
|
|
96
|
-
.describe("System message to set model behavior. Example: 'You are a helpful coding assistant.'")
|
|
97
|
-
.optional(),
|
|
98
|
-
});
|
|
99
|
-
/**
|
|
100
|
-
* Output Schemas for Tool Results
|
|
101
|
-
* Define expected return structures for better LLM understanding
|
|
102
|
-
*/
|
|
103
|
-
export const findModelsOutputSchema = z.object({
|
|
104
|
-
results: z.array(z.object({
|
|
105
|
-
id: z.string(),
|
|
106
|
-
name: z.string(),
|
|
107
|
-
description: z.string().nullable(),
|
|
108
|
-
score: z.number(),
|
|
109
|
-
provider: z.string(),
|
|
110
|
-
context_window: z.number().nullable(),
|
|
111
|
-
pricing: z.object({
|
|
112
|
-
input: z.number().nullable(),
|
|
113
|
-
output: z.number().nullable(),
|
|
114
|
-
}),
|
|
115
|
-
capabilities: z.object({
|
|
116
|
-
vision: z.boolean().nullable(),
|
|
117
|
-
audio: z.boolean().nullable(),
|
|
118
|
-
tool_calling: z.boolean().nullable(),
|
|
119
|
-
json_mode: z.boolean().nullable(),
|
|
120
|
-
video: z.boolean().nullable(),
|
|
121
|
-
}),
|
|
122
|
-
matched_features: z.array(z.string()).optional(),
|
|
123
|
-
hugging_face_id: z.string().nullable().optional(),
|
|
124
|
-
release_date: z.string().nullable().optional(),
|
|
125
|
-
})),
|
|
126
|
-
total: z.number().optional(),
|
|
127
|
-
});
|
|
128
|
-
export const getModelOutputSchema = z.object({
|
|
129
|
-
id: z.string(),
|
|
130
|
-
name: z.string(),
|
|
131
|
-
provider: z.string(),
|
|
132
|
-
description: z.string().nullable(),
|
|
133
|
-
family: z.string().nullable(),
|
|
134
|
-
version: z.string().nullable(),
|
|
135
|
-
release_date: z.string().nullable(),
|
|
136
|
-
limits: z.object({
|
|
137
|
-
context_window: z.number(),
|
|
138
|
-
max_output_tokens: z.number().nullable(),
|
|
139
|
-
}),
|
|
140
|
-
pricing: z.object({
|
|
141
|
-
input: z.number().nullable(),
|
|
142
|
-
output: z.number().nullable(),
|
|
143
|
-
}),
|
|
144
|
-
extended_pricing: z
|
|
145
|
-
.object({
|
|
146
|
-
image: z.number().nullable(),
|
|
147
|
-
audio: z.number().nullable(),
|
|
148
|
-
web_search: z.number().nullable(),
|
|
149
|
-
cache_read: z.number().nullable(),
|
|
150
|
-
cache_write: z.number().nullable(),
|
|
151
|
-
discount: z.number().nullable(),
|
|
152
|
-
internal_reasoning: z.number().nullable(),
|
|
153
|
-
})
|
|
154
|
-
.nullable(),
|
|
155
|
-
capabilities: z.object({
|
|
156
|
-
vision: z.boolean(),
|
|
157
|
-
audio: z.boolean(),
|
|
158
|
-
tool_calling: z.boolean(),
|
|
159
|
-
json_mode: z.boolean(),
|
|
160
|
-
video: z.boolean(),
|
|
161
|
-
function_calling: z.boolean(),
|
|
162
|
-
custom: z.array(z.string()),
|
|
163
|
-
}),
|
|
164
|
-
supported_parameters: z.array(z.string()),
|
|
165
|
-
is_moderated: z.boolean(),
|
|
166
|
-
input_modalities: z.array(z.string()),
|
|
167
|
-
output_modalities: z.array(z.string()),
|
|
168
|
-
architecture: z.object({
|
|
169
|
-
tokenizer: z.string().nullable(),
|
|
170
|
-
instruct_type: z.string().nullable(),
|
|
171
|
-
}),
|
|
172
|
-
per_request_limits: z
|
|
173
|
-
.object({
|
|
174
|
-
prompt_tokens: z.number().nullable(),
|
|
175
|
-
completion_tokens: z.number().nullable(),
|
|
176
|
-
})
|
|
177
|
-
.nullable(),
|
|
178
|
-
});
|
|
179
|
-
export const testModelOutputSchema = z.object({
|
|
180
|
-
test_type: z.string(),
|
|
181
|
-
prompt: z.string(),
|
|
182
|
-
results: z.array(z.object({
|
|
183
|
-
model_id: z.string(),
|
|
184
|
-
model_name: z.string(),
|
|
185
|
-
latency_ms: z.number(),
|
|
186
|
-
output: z.string().nullable(),
|
|
187
|
-
tokens_used: z
|
|
188
|
-
.object({
|
|
189
|
-
prompt_tokens: z.number(),
|
|
190
|
-
completion_tokens: z.number(),
|
|
191
|
-
total_tokens: z.number(),
|
|
192
|
-
})
|
|
193
|
-
.nullable(),
|
|
194
|
-
cost_estimate: z.object({
|
|
195
|
-
input_cost: z.number().nullable(),
|
|
196
|
-
output_cost: z.number().nullable(),
|
|
197
|
-
total_cost: z.number().nullable(),
|
|
198
|
-
}),
|
|
199
|
-
tool_calls_detected: z.boolean().optional(),
|
|
200
|
-
tool_calls: z
|
|
201
|
-
.array(z.object({
|
|
202
|
-
name: z.string(),
|
|
203
|
-
arguments: z.record(z.string(), z.unknown()),
|
|
204
|
-
}))
|
|
205
|
-
.optional(),
|
|
206
|
-
error: z.string().nullable(),
|
|
207
|
-
})),
|
|
208
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"find_models.d.ts","sourceRoot":"","sources":["../../src/tools/find_models.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD,wBAAsB,cAAc,CAAC,KAAK,EAAE,eAAe,qDAE1D"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get_model.d.ts","sourceRoot":"","sources":["../../src/tools/get_model.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,wBAAsB,YAAY,CAAC,KAAK,EAAE,aAAa,mDAEtD"}
|
package/dist/tools/get_model.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test_model.d.ts","sourceRoot":"","sources":["../../src/tools/test_model.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,wBAAsB,aAAa,CAAC,KAAK,EAAE,cAAc,oDAUxD"}
|
package/dist/tools/test_model.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { testModel } from "../client.js";
|
|
2
|
-
import { OPENROUTER_API_KEY } from "../config.js";
|
|
3
|
-
export async function testModelTool(input) {
|
|
4
|
-
return testModel(input.model_ids, input.test_type, OPENROUTER_API_KEY, input.prompt, input.max_tokens, input.temperature, input.system_prompt);
|
|
5
|
-
}
|
package/dist/types/api.d.ts
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
import type { ModelPricing, ModelCapabilities, ModelArchitecture, ExtendedPricing, PerRequestLimits } from "./models.js";
|
|
2
|
-
export interface ListModelsResponse {
|
|
3
|
-
models: Array<{
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
provider: string;
|
|
7
|
-
context_window: number | null;
|
|
8
|
-
max_output_tokens: number | null;
|
|
9
|
-
input_modalities: string[];
|
|
10
|
-
output_modalities: string[];
|
|
11
|
-
pricing: ModelPricing;
|
|
12
|
-
capabilities: ModelCapabilities;
|
|
13
|
-
architecture: Pick<ModelArchitecture, "tokenizer">;
|
|
14
|
-
}>;
|
|
15
|
-
}
|
|
16
|
-
export interface GetModelResponse {
|
|
17
|
-
id: string;
|
|
18
|
-
name: string;
|
|
19
|
-
provider: string;
|
|
20
|
-
description: string | null;
|
|
21
|
-
family: string | null;
|
|
22
|
-
version: string | null;
|
|
23
|
-
release_date: string | null;
|
|
24
|
-
limits: {
|
|
25
|
-
context_window: number;
|
|
26
|
-
max_output_tokens: number | null;
|
|
27
|
-
};
|
|
28
|
-
pricing: ModelPricing;
|
|
29
|
-
extended_pricing: ExtendedPricing | null;
|
|
30
|
-
capabilities: {
|
|
31
|
-
vision: boolean;
|
|
32
|
-
audio: boolean;
|
|
33
|
-
tool_calling: boolean;
|
|
34
|
-
json_mode: boolean;
|
|
35
|
-
video: boolean;
|
|
36
|
-
function_calling: boolean;
|
|
37
|
-
custom: string[];
|
|
38
|
-
};
|
|
39
|
-
supported_parameters: string[];
|
|
40
|
-
is_moderated: boolean;
|
|
41
|
-
input_modalities: string[];
|
|
42
|
-
output_modalities: string[];
|
|
43
|
-
architecture: ModelArchitecture;
|
|
44
|
-
per_request_limits: PerRequestLimits | null;
|
|
45
|
-
}
|
|
46
|
-
export interface FindModelsRequest {
|
|
47
|
-
query?: string;
|
|
48
|
-
provider?: string;
|
|
49
|
-
min_context?: number;
|
|
50
|
-
max_context?: number;
|
|
51
|
-
max_price_per_m?: number;
|
|
52
|
-
capabilities?: string[];
|
|
53
|
-
sort_by?: "relevance" | "price_asc" | "price_desc" | "date_desc" | "context_desc";
|
|
54
|
-
limit?: number;
|
|
55
|
-
offset?: number;
|
|
56
|
-
}
|
|
57
|
-
export interface FindModelsResponse {
|
|
58
|
-
results: Array<{
|
|
59
|
-
id: string;
|
|
60
|
-
name: string;
|
|
61
|
-
description: string | null;
|
|
62
|
-
score: number;
|
|
63
|
-
provider: string;
|
|
64
|
-
context_window: number | null;
|
|
65
|
-
pricing: ModelPricing;
|
|
66
|
-
capabilities: {
|
|
67
|
-
vision: boolean | null;
|
|
68
|
-
audio: boolean | null;
|
|
69
|
-
tool_calling: boolean | null;
|
|
70
|
-
json_mode: boolean | null;
|
|
71
|
-
video: boolean | null;
|
|
72
|
-
};
|
|
73
|
-
matched_features?: string[];
|
|
74
|
-
hugging_face_id?: string | null;
|
|
75
|
-
release_date: string | null;
|
|
76
|
-
}>;
|
|
77
|
-
total?: number;
|
|
78
|
-
}
|
|
79
|
-
export interface CostEstimate {
|
|
80
|
-
input_cost: number | null;
|
|
81
|
-
output_cost: number | null;
|
|
82
|
-
total_cost: number | null;
|
|
83
|
-
}
|
|
84
|
-
export interface TestModelResult {
|
|
85
|
-
model_id: string;
|
|
86
|
-
model_name: string;
|
|
87
|
-
latency_ms: number;
|
|
88
|
-
output: string | null;
|
|
89
|
-
tokens_used: {
|
|
90
|
-
prompt_tokens: number;
|
|
91
|
-
completion_tokens: number;
|
|
92
|
-
total_tokens: number;
|
|
93
|
-
} | null;
|
|
94
|
-
cost_estimate: CostEstimate;
|
|
95
|
-
tool_calls_detected?: boolean;
|
|
96
|
-
tool_calls?: Array<{
|
|
97
|
-
name: string;
|
|
98
|
-
arguments: Record<string, unknown>;
|
|
99
|
-
}>;
|
|
100
|
-
error: string | null;
|
|
101
|
-
}
|
|
102
|
-
export interface TestModelResponse {
|
|
103
|
-
test_type: string;
|
|
104
|
-
prompt: string;
|
|
105
|
-
results: TestModelResult[];
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=api.d.ts.map
|
package/dist/types/api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/types/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EACjB,MAAM,aAAa,CAAC;AAErB,MAAM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I,CAAC;KAC7B,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE;QACX,aAAa,EAAE,MAAM,CAAC;QACtB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,YAAY,EAAE,MAAM,CAAC;KACtB,GAAG,IAAI,CAAC;IACT,aAAa,EAAE,YAAY,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,CAAC,CAAC;IACH,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B"}
|
package/dist/types/api.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/types/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
package/dist/types/index.js
DELETED
package/dist/types/models.d.ts
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
export interface ModelPricing {
|
|
2
|
-
input: number | null;
|
|
3
|
-
output: number | null;
|
|
4
|
-
}
|
|
5
|
-
export interface ModelCapabilities {
|
|
6
|
-
vision: boolean;
|
|
7
|
-
audio: boolean;
|
|
8
|
-
tool_calling: boolean;
|
|
9
|
-
json_mode: boolean;
|
|
10
|
-
}
|
|
11
|
-
export interface ModelArchitecture {
|
|
12
|
-
tokenizer: string | null;
|
|
13
|
-
instruct_type: string | null;
|
|
14
|
-
}
|
|
15
|
-
export interface ExtendedPricing {
|
|
16
|
-
image: number | null;
|
|
17
|
-
audio: number | null;
|
|
18
|
-
web_search: number | null;
|
|
19
|
-
cache_read: number | null;
|
|
20
|
-
cache_write: number | null;
|
|
21
|
-
discount: number | null;
|
|
22
|
-
internal_reasoning: number | null;
|
|
23
|
-
}
|
|
24
|
-
export interface PerRequestLimits {
|
|
25
|
-
prompt_tokens: number | null;
|
|
26
|
-
completion_tokens: number | null;
|
|
27
|
-
}
|
|
28
|
-
export interface NormalizedModel {
|
|
29
|
-
id: string;
|
|
30
|
-
name: string;
|
|
31
|
-
provider: string;
|
|
32
|
-
context_window: number | null;
|
|
33
|
-
max_output_tokens: number | null;
|
|
34
|
-
pricing: ModelPricing;
|
|
35
|
-
capabilities: ModelCapabilities;
|
|
36
|
-
description: string | null;
|
|
37
|
-
release_date: string | null;
|
|
38
|
-
input_modalities: string[];
|
|
39
|
-
output_modalities: string[];
|
|
40
|
-
supported_parameters: string[];
|
|
41
|
-
architecture: ModelArchitecture;
|
|
42
|
-
extended_pricing: ExtendedPricing | null;
|
|
43
|
-
is_moderated: boolean;
|
|
44
|
-
per_request_limits: PerRequestLimits | null;
|
|
45
|
-
hugging_face_id: string | null;
|
|
46
|
-
}
|
|
47
|
-
export interface ProviderAdapter {
|
|
48
|
-
id: string;
|
|
49
|
-
name: string;
|
|
50
|
-
fetchModels(): Promise<NormalizedModel[]>;
|
|
51
|
-
}
|
|
52
|
-
export interface ListModelsFilters {
|
|
53
|
-
provider?: string;
|
|
54
|
-
min_context?: number;
|
|
55
|
-
modality?: "text" | "vision" | "audio" | "video" | "image";
|
|
56
|
-
max_price_per_m?: number;
|
|
57
|
-
supports_tool_calling?: boolean;
|
|
58
|
-
supports_json_mode?: boolean;
|
|
59
|
-
tokenizer?: string;
|
|
60
|
-
output_modality?: "text" | "image" | "embeddings";
|
|
61
|
-
limit?: number;
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=models.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/types/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,YAAY,EAAE,OAAO,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC;AAED,MAAM,WAAW,gBAAgB;IAC/B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,e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AChB"}
|
package/dist/types/models.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check if a tool request should be rate limited
|
|
3
|
-
* @param toolName - The tool name (e.g., "find_models", "get_model", "test_model")
|
|
4
|
-
* @returns true if allowed, false if rate limited
|
|
5
|
-
*/
|
|
6
|
-
export declare function checkRateLimit(toolName: string): boolean;
|
|
7
|
-
//# sourceMappingURL=rateLimiter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rateLimiter.d.ts","sourceRoot":"","sources":["../../src/utils/rateLimiter.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAexD"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { RATE_LIMIT_WINDOW_MS, RATE_LIMIT_MAX_REQUESTS } from "../config.js";
|
|
2
|
-
const requestCounts = new Map();
|
|
3
|
-
/**
|
|
4
|
-
* Check if a tool request should be rate limited
|
|
5
|
-
* @param toolName - The tool name (e.g., "find_models", "get_model", "test_model")
|
|
6
|
-
* @returns true if allowed, false if rate limited
|
|
7
|
-
*/
|
|
8
|
-
export function checkRateLimit(toolName) {
|
|
9
|
-
const now = Date.now();
|
|
10
|
-
const current = requestCounts.get(toolName);
|
|
11
|
-
if (!current || now > current.resetTime) {
|
|
12
|
-
requestCounts.set(toolName, { count: 1, resetTime: now + RATE_LIMIT_WINDOW_MS });
|
|
13
|
-
return true;
|
|
14
|
-
}
|
|
15
|
-
if (current.count >= RATE_LIMIT_MAX_REQUESTS) {
|
|
16
|
-
return false;
|
|
17
|
-
}
|
|
18
|
-
current.count++;
|
|
19
|
-
return true;
|
|
20
|
-
}
|