@aggc/or-info 0.1.1 → 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/README.md +35 -17
- package/bin/or-info.mjs +1 -1
- package/lib/lmarena.mjs +2 -1
- package/lib/openrouter.mjs +2 -1
- package/lib/version.mjs +3 -0
- package/mcp/server.mjs +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> CLI + MCP server to query OpenRouter model info: prices, ELO rankings, context and comparisons.
|
|
4
4
|
|
|
5
|
-
Any person or AI agent (Claude Code, Cursor, pi, etc.) can install it and use it
|
|
5
|
+
Any person or AI agent (Claude Code, Codex, Cursor, pi, etc.) can install it and use it
|
|
6
6
|
to make informed decisions about which model to use.
|
|
7
7
|
|
|
8
8
|
[](https://www.npmjs.com/package/@aggc/or-info)
|
|
@@ -172,46 +172,58 @@ or-info refresh # Force-refresh OpenRouter catalog + LMArena ELO
|
|
|
172
172
|
|------|-------------|
|
|
173
173
|
| `get_model_info` | Pricing, context, architecture, features and LMArena ELO for a model |
|
|
174
174
|
| `list_models` | List models with optional filter, sort and limit |
|
|
175
|
-
| `get_benchmarks` | LMArena ELO, rank,
|
|
175
|
+
| `get_benchmarks` | LMArena ELO score, global rank, vote count and confidence interval for a model |
|
|
176
176
|
| `compare_models` | Side-by-side comparison of two models |
|
|
177
177
|
| `best_for_task` | Ranked top models for coding/reasoning/general/vision/cheap |
|
|
178
178
|
| `refresh_cache` | Force-refresh OpenRouter catalog + LMArena ELO |
|
|
179
179
|
|
|
180
180
|
### Register in Claude Code
|
|
181
181
|
|
|
182
|
-
|
|
182
|
+
The recommended way is the `claude mcp add` command, which writes to `~/.claude.json`:
|
|
183
|
+
|
|
184
|
+
```bash
|
|
185
|
+
# Global — available in all projects
|
|
186
|
+
claude mcp add --scope user or-info -- or-info --mcp
|
|
187
|
+
|
|
188
|
+
# Project-only (run from the project directory)
|
|
189
|
+
claude mcp add or-info -- or-info --mcp
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
Then verify:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
claude mcp list
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Project `.mcp.json`** — commit this file to share the config with your team:
|
|
199
|
+
|
|
200
|
+
macOS / Linux:
|
|
183
201
|
|
|
184
202
|
```json
|
|
185
203
|
{
|
|
186
204
|
"mcpServers": {
|
|
187
205
|
"or-info": {
|
|
188
206
|
"command": "or-info",
|
|
189
|
-
"args": ["--mcp"]
|
|
190
|
-
"env": {
|
|
191
|
-
"OPENROUTER_API_KEY": "sk-or-..."
|
|
192
|
-
}
|
|
207
|
+
"args": ["--mcp"]
|
|
193
208
|
}
|
|
194
209
|
}
|
|
195
210
|
}
|
|
196
211
|
```
|
|
197
212
|
|
|
198
|
-
Windows
|
|
213
|
+
Windows:
|
|
199
214
|
|
|
200
215
|
```json
|
|
201
216
|
{
|
|
202
217
|
"mcpServers": {
|
|
203
218
|
"or-info": {
|
|
204
219
|
"command": "or-info.cmd",
|
|
205
|
-
"args": ["--mcp"]
|
|
206
|
-
"env": {
|
|
207
|
-
"OPENROUTER_API_KEY": "sk-or-..."
|
|
208
|
-
}
|
|
220
|
+
"args": ["--mcp"]
|
|
209
221
|
}
|
|
210
222
|
}
|
|
211
223
|
}
|
|
212
224
|
```
|
|
213
225
|
|
|
214
|
-
|
|
226
|
+
Without a global install (macOS/Linux):
|
|
215
227
|
|
|
216
228
|
```json
|
|
217
229
|
{
|
|
@@ -224,7 +236,7 @@ If you installed via `npx` (without global install) on macOS/Linux:
|
|
|
224
236
|
}
|
|
225
237
|
```
|
|
226
238
|
|
|
227
|
-
|
|
239
|
+
Without a global install (Windows):
|
|
228
240
|
|
|
229
241
|
```json
|
|
230
242
|
{
|
|
@@ -237,12 +249,18 @@ If you installed via `npx` on Windows:
|
|
|
237
249
|
}
|
|
238
250
|
```
|
|
239
251
|
|
|
240
|
-
|
|
252
|
+
### Register in Codex
|
|
241
253
|
|
|
242
|
-
|
|
243
|
-
|
|
254
|
+
Add to `~/.codex/config.toml`:
|
|
255
|
+
|
|
256
|
+
```toml
|
|
257
|
+
[mcp_servers.or-info]
|
|
258
|
+
command = "or-info"
|
|
259
|
+
args = ["--mcp"]
|
|
244
260
|
```
|
|
245
261
|
|
|
262
|
+
Then restart Codex for the change to take effect.
|
|
263
|
+
|
|
246
264
|
### Use from Pi
|
|
247
265
|
|
|
248
266
|
Pi does not use an `mcpServers` settings schema. The recommended integration is a Pi skill
|
package/bin/or-info.mjs
CHANGED
|
@@ -40,7 +40,7 @@ async function apiKey() {
|
|
|
40
40
|
program
|
|
41
41
|
.name('or-info')
|
|
42
42
|
.description('OpenRouter model info: prices, benchmarks, context and comparisons')
|
|
43
|
-
.version('0.1.
|
|
43
|
+
.version('0.1.5')
|
|
44
44
|
.option('--mcp', 'Start MCP server (stdio transport)');
|
|
45
45
|
|
|
46
46
|
// ── models ─────────────────────────────────────────────────────────────────
|
package/lib/lmarena.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { get, set, TTL } from './cache.mjs';
|
|
2
2
|
import { BENCHMARKS_CACHE } from './paths.mjs';
|
|
3
|
+
import { VERSION } from './version.mjs';
|
|
3
4
|
|
|
4
5
|
const HF_ROWS =
|
|
5
6
|
'https://datasets-server.huggingface.co/rows?dataset=lmarena-ai%2Fleaderboard-dataset&config=text&split=latest';
|
|
@@ -29,7 +30,7 @@ async function fetchPage(offset) {
|
|
|
29
30
|
let res;
|
|
30
31
|
try {
|
|
31
32
|
res = await fetch(url, {
|
|
32
|
-
headers: { 'User-Agent':
|
|
33
|
+
headers: { 'User-Agent': `or-info-cli/${VERSION}` },
|
|
33
34
|
signal: AbortSignal.timeout(15_000),
|
|
34
35
|
});
|
|
35
36
|
} catch (err) {
|
package/lib/openrouter.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { get, set, TTL } from './cache.mjs';
|
|
2
2
|
import { MODELS_CACHE } from './paths.mjs';
|
|
3
|
+
import { VERSION } from './version.mjs';
|
|
3
4
|
|
|
4
5
|
const OR_BASE = 'https://openrouter.ai/api/v1';
|
|
5
|
-
const USER_AGENT =
|
|
6
|
+
const USER_AGENT = `or-info-cli/${VERSION} (https://github.com/jmtrs/or-info)`;
|
|
6
7
|
const RETRYABLE_STATUSES = new Set([429, 500, 502, 503, 504]);
|
|
7
8
|
const MAX_FETCH_RETRIES = 2;
|
|
8
9
|
|
package/lib/version.mjs
ADDED
package/mcp/server.mjs
CHANGED
|
@@ -33,7 +33,7 @@ const TOOLS = [
|
|
|
33
33
|
},
|
|
34
34
|
{
|
|
35
35
|
name: 'get_benchmarks',
|
|
36
|
-
description: 'Get
|
|
36
|
+
description: 'Get LMArena ELO ranking for a model: score, global rank, vote count and confidence interval',
|
|
37
37
|
inputSchema: {
|
|
38
38
|
type: 'object',
|
|
39
39
|
properties: {
|
|
@@ -183,7 +183,7 @@ async function handleTool(name, args) {
|
|
|
183
183
|
|
|
184
184
|
export async function startMcp() {
|
|
185
185
|
const server = new Server(
|
|
186
|
-
{ name: 'or-info', version: '0.1.
|
|
186
|
+
{ name: 'or-info', version: '0.1.5' },
|
|
187
187
|
{ capabilities: { tools: {} } }
|
|
188
188
|
);
|
|
189
189
|
|