llmist 0.2.0 → 0.2.1

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/cli.cjs CHANGED
@@ -86,17 +86,17 @@ var init_model_shortcuts = __esm({
86
86
  "gpt5-mini": "openai:gpt-5-mini",
87
87
  "gpt5-nano": "openai:gpt-5-nano",
88
88
  // Anthropic aliases
89
- sonnet: "anthropic:claude-3-5-sonnet-latest",
90
- "claude-sonnet": "anthropic:claude-3-5-sonnet-latest",
91
- haiku: "anthropic:claude-3-5-haiku-latest",
92
- "claude-haiku": "anthropic:claude-3-5-haiku-latest",
93
- opus: "anthropic:claude-3-opus-latest",
94
- "claude-opus": "anthropic:claude-3-opus-latest",
89
+ sonnet: "anthropic:claude-sonnet-4-5",
90
+ "claude-sonnet": "anthropic:claude-sonnet-4-5",
91
+ haiku: "anthropic:claude-haiku-4-5",
92
+ "claude-haiku": "anthropic:claude-haiku-4-5",
93
+ opus: "anthropic:claude-opus-4-5",
94
+ "claude-opus": "anthropic:claude-opus-4-5",
95
95
  // Gemini aliases
96
96
  flash: "gemini:gemini-2.0-flash",
97
97
  "gemini-flash": "gemini:gemini-2.0-flash",
98
- "gemini-pro": "gemini:gemini-2.0-pro",
99
- pro: "gemini:gemini-2.0-pro"
98
+ "gemini-pro": "gemini:gemini-2.5-pro",
99
+ pro: "gemini:gemini-2.5-pro"
100
100
  };
101
101
  KNOWN_MODEL_PATTERNS = [
102
102
  /^gpt-?\d/i,
@@ -2070,30 +2070,6 @@ var init_anthropic_models = __esm({
2070
2070
  "src/providers/anthropic-models.ts"() {
2071
2071
  "use strict";
2072
2072
  ANTHROPIC_MODELS = [
2073
- {
2074
- provider: "anthropic",
2075
- modelId: "claude-opus-4-5-20251124",
2076
- displayName: "Claude Opus 4.5",
2077
- contextWindow: 2e5,
2078
- maxOutputTokens: 64e3,
2079
- pricing: {
2080
- input: 5,
2081
- output: 25,
2082
- cachedInput: 0.5
2083
- },
2084
- knowledgeCutoff: "2025-03",
2085
- features: {
2086
- streaming: true,
2087
- functionCalling: true,
2088
- vision: true,
2089
- reasoning: true
2090
- },
2091
- metadata: {
2092
- family: "Claude 4",
2093
- releaseDate: "2025-11-24",
2094
- notes: "Most powerful model. 80.9% SWE-bench Verified, 66.3% OSWorld. Best for coding and computer use."
2095
- }
2096
- },
2097
2073
  {
2098
2074
  provider: "anthropic",
2099
2075
  modelId: "claude-sonnet-4-5-20250929",
@@ -2282,6 +2258,79 @@ var init_anthropic_models = __esm({
2282
2258
  releaseDate: "2024-03-07",
2283
2259
  notes: "Legacy model - upgrade to Haiku 4.5 for better performance"
2284
2260
  }
2261
+ },
2262
+ // Modern aliases (recommended by Anthropic)
2263
+ {
2264
+ provider: "anthropic",
2265
+ modelId: "claude-haiku-4-5",
2266
+ displayName: "Claude Haiku 4.5",
2267
+ contextWindow: 2e5,
2268
+ maxOutputTokens: 64e3,
2269
+ pricing: {
2270
+ input: 1,
2271
+ output: 5,
2272
+ cachedInput: 0.1
2273
+ },
2274
+ knowledgeCutoff: "2025-02",
2275
+ features: {
2276
+ streaming: true,
2277
+ functionCalling: true,
2278
+ vision: true,
2279
+ reasoning: true
2280
+ },
2281
+ metadata: {
2282
+ family: "Claude 4",
2283
+ releaseDate: "2025-10-01",
2284
+ notes: "Alias for claude-haiku-4-5-20251001. Fastest model with near-frontier intelligence."
2285
+ }
2286
+ },
2287
+ {
2288
+ provider: "anthropic",
2289
+ modelId: "claude-sonnet-4-5",
2290
+ displayName: "Claude Sonnet 4.5",
2291
+ contextWindow: 2e5,
2292
+ maxOutputTokens: 64e3,
2293
+ pricing: {
2294
+ input: 3,
2295
+ output: 15,
2296
+ cachedInput: 0.3
2297
+ },
2298
+ knowledgeCutoff: "2025-01",
2299
+ features: {
2300
+ streaming: true,
2301
+ functionCalling: true,
2302
+ vision: true,
2303
+ reasoning: true
2304
+ },
2305
+ metadata: {
2306
+ family: "Claude 4",
2307
+ releaseDate: "2025-09-29",
2308
+ notes: "Alias for claude-sonnet-4-5-20250929. Smartest model for complex agents and coding."
2309
+ }
2310
+ },
2311
+ {
2312
+ provider: "anthropic",
2313
+ modelId: "claude-opus-4-5",
2314
+ displayName: "Claude Opus 4.5",
2315
+ contextWindow: 2e5,
2316
+ maxOutputTokens: 64e3,
2317
+ pricing: {
2318
+ input: 5,
2319
+ output: 25,
2320
+ cachedInput: 0.5
2321
+ },
2322
+ knowledgeCutoff: "2025-03",
2323
+ features: {
2324
+ streaming: true,
2325
+ functionCalling: true,
2326
+ vision: true,
2327
+ reasoning: true
2328
+ },
2329
+ metadata: {
2330
+ family: "Claude 4",
2331
+ releaseDate: "2025-11-24",
2332
+ notes: "Alias for claude-opus-4-5-20251124. Most powerful model for coding and computer use."
2333
+ }
2285
2334
  }
2286
2335
  ];
2287
2336
  }
@@ -4216,7 +4265,8 @@ var CLI_NAME = "llmist";
4216
4265
  var CLI_DESCRIPTION = "Command line utilities for llmist agents and direct LLM access.";
4217
4266
  var COMMANDS = {
4218
4267
  complete: "complete",
4219
- agent: "agent"
4268
+ agent: "agent",
4269
+ models: "models"
4220
4270
  };
4221
4271
  var LOG_LEVELS = ["silly", "trace", "debug", "info", "warn", "error", "fatal"];
4222
4272
  var DEFAULT_MODEL = "openai:gpt-5-nano";
@@ -4234,7 +4284,7 @@ var OPTION_FLAGS = {
4234
4284
  noBuiltins: "--no-builtins"
4235
4285
  };
4236
4286
  var OPTION_DESCRIPTIONS = {
4237
- model: "Model identifier, e.g. openai:gpt-5-nano or anthropic:claude-3-5-sonnet-latest.",
4287
+ model: "Model identifier, e.g. openai:gpt-5-nano or anthropic:claude-sonnet-4-5.",
4238
4288
  systemPrompt: "Optional system prompt prepended to the conversation.",
4239
4289
  temperature: "Sampling temperature between 0 and 2.",
4240
4290
  maxTokens: "Maximum number of output tokens requested from the model.",
@@ -5285,9 +5335,169 @@ function registerCompleteCommand(program, env) {
5285
5335
  );
5286
5336
  }
5287
5337
 
5338
+ // src/cli/models-command.ts
5339
+ var import_chalk3 = __toESM(require("chalk"), 1);
5340
+ init_model_shortcuts();
5341
+ async function handleModelsCommand(options, env) {
5342
+ const client = env.createClient();
5343
+ const models = client.modelRegistry.listModels(options.provider);
5344
+ if (options.format === "json") {
5345
+ renderJSON(models, env.stdout);
5346
+ } else {
5347
+ renderTable(models, options.verbose || false, env.stdout);
5348
+ }
5349
+ }
5350
+ function renderTable(models, verbose, stream2) {
5351
+ const grouped = /* @__PURE__ */ new Map();
5352
+ for (const model of models) {
5353
+ const provider = model.provider;
5354
+ if (!grouped.has(provider)) {
5355
+ grouped.set(provider, []);
5356
+ }
5357
+ grouped.get(provider).push(model);
5358
+ }
5359
+ stream2.write(import_chalk3.default.bold.cyan("\nAvailable Models\n"));
5360
+ stream2.write(import_chalk3.default.cyan("=".repeat(80)) + "\n\n");
5361
+ const providers = Array.from(grouped.keys()).sort();
5362
+ for (const provider of providers) {
5363
+ const providerModels = grouped.get(provider);
5364
+ const providerName = provider.charAt(0).toUpperCase() + provider.slice(1);
5365
+ stream2.write(import_chalk3.default.bold.yellow(`${providerName} Models
5366
+ `));
5367
+ if (verbose) {
5368
+ renderVerboseTable(providerModels, stream2);
5369
+ } else {
5370
+ renderCompactTable(providerModels, stream2);
5371
+ }
5372
+ stream2.write("\n");
5373
+ }
5374
+ stream2.write(import_chalk3.default.bold.magenta("Model Shortcuts\n"));
5375
+ stream2.write(import_chalk3.default.dim("\u2500".repeat(80)) + "\n");
5376
+ const shortcuts = Object.entries(MODEL_ALIASES).sort((a, b) => a[0].localeCompare(b[0]));
5377
+ for (const [shortcut, fullName] of shortcuts) {
5378
+ stream2.write(import_chalk3.default.cyan(` ${shortcut.padEnd(15)}`) + import_chalk3.default.dim(" \u2192 ") + import_chalk3.default.white(fullName) + "\n");
5379
+ }
5380
+ stream2.write("\n");
5381
+ }
5382
+ function renderCompactTable(models, stream2) {
5383
+ const idWidth = 25;
5384
+ const nameWidth = 22;
5385
+ const contextWidth = 13;
5386
+ const inputWidth = 10;
5387
+ const outputWidth = 10;
5388
+ stream2.write(import_chalk3.default.dim("\u2500".repeat(idWidth + nameWidth + contextWidth + inputWidth + outputWidth + 8)) + "\n");
5389
+ stream2.write(
5390
+ import_chalk3.default.bold(
5391
+ "Model ID".padEnd(idWidth) + " " + "Display Name".padEnd(nameWidth) + " " + "Context".padEnd(contextWidth) + " " + "Input".padEnd(inputWidth) + " " + "Output".padEnd(outputWidth)
5392
+ ) + "\n"
5393
+ );
5394
+ stream2.write(import_chalk3.default.dim("\u2500".repeat(idWidth + nameWidth + contextWidth + inputWidth + outputWidth + 8)) + "\n");
5395
+ for (const model of models) {
5396
+ const contextFormatted = formatTokens(model.contextWindow);
5397
+ const inputPrice = `$${model.pricing.input.toFixed(2)}`;
5398
+ const outputPrice = `$${model.pricing.output.toFixed(2)}`;
5399
+ stream2.write(
5400
+ import_chalk3.default.green(model.modelId.padEnd(idWidth)) + " " + import_chalk3.default.white(model.displayName.padEnd(nameWidth)) + " " + import_chalk3.default.yellow(contextFormatted.padEnd(contextWidth)) + " " + import_chalk3.default.cyan(inputPrice.padEnd(inputWidth)) + " " + import_chalk3.default.cyan(outputPrice.padEnd(outputWidth)) + "\n"
5401
+ );
5402
+ }
5403
+ stream2.write(import_chalk3.default.dim("\u2500".repeat(idWidth + nameWidth + contextWidth + inputWidth + outputWidth + 8)) + "\n");
5404
+ stream2.write(import_chalk3.default.dim(` * Prices are per 1M tokens
5405
+ `));
5406
+ }
5407
+ function renderVerboseTable(models, stream2) {
5408
+ for (const model of models) {
5409
+ stream2.write(import_chalk3.default.bold.green(`
5410
+ ${model.modelId}
5411
+ `));
5412
+ stream2.write(import_chalk3.default.dim(" " + "\u2500".repeat(60)) + "\n");
5413
+ stream2.write(` ${import_chalk3.default.dim("Name:")} ${import_chalk3.default.white(model.displayName)}
5414
+ `);
5415
+ stream2.write(` ${import_chalk3.default.dim("Context:")} ${import_chalk3.default.yellow(formatTokens(model.contextWindow))}
5416
+ `);
5417
+ stream2.write(` ${import_chalk3.default.dim("Max Output:")} ${import_chalk3.default.yellow(formatTokens(model.maxOutputTokens))}
5418
+ `);
5419
+ stream2.write(` ${import_chalk3.default.dim("Pricing:")} ${import_chalk3.default.cyan(`$${model.pricing.input.toFixed(2)} input`)} ${import_chalk3.default.dim("/")} ${import_chalk3.default.cyan(`$${model.pricing.output.toFixed(2)} output`)} ${import_chalk3.default.dim("(per 1M tokens)")}
5420
+ `);
5421
+ if (model.pricing.cachedInput !== void 0) {
5422
+ stream2.write(` ${import_chalk3.default.dim("Cached Input:")} ${import_chalk3.default.cyan(`$${model.pricing.cachedInput.toFixed(2)} per 1M tokens`)}
5423
+ `);
5424
+ }
5425
+ if (model.knowledgeCutoff) {
5426
+ stream2.write(` ${import_chalk3.default.dim("Knowledge:")} ${model.knowledgeCutoff}
5427
+ `);
5428
+ }
5429
+ const features = [];
5430
+ if (model.features.streaming) features.push("streaming");
5431
+ if (model.features.functionCalling) features.push("function-calling");
5432
+ if (model.features.vision) features.push("vision");
5433
+ if (model.features.reasoning) features.push("reasoning");
5434
+ if (model.features.structuredOutputs) features.push("structured-outputs");
5435
+ if (model.features.fineTuning) features.push("fine-tuning");
5436
+ if (features.length > 0) {
5437
+ stream2.write(` ${import_chalk3.default.dim("Features:")} ${import_chalk3.default.blue(features.join(", "))}
5438
+ `);
5439
+ }
5440
+ if (model.metadata) {
5441
+ if (model.metadata.family) {
5442
+ stream2.write(` ${import_chalk3.default.dim("Family:")} ${model.metadata.family}
5443
+ `);
5444
+ }
5445
+ if (model.metadata.releaseDate) {
5446
+ stream2.write(` ${import_chalk3.default.dim("Released:")} ${model.metadata.releaseDate}
5447
+ `);
5448
+ }
5449
+ if (model.metadata.notes) {
5450
+ stream2.write(` ${import_chalk3.default.dim("Notes:")} ${import_chalk3.default.italic(model.metadata.notes)}
5451
+ `);
5452
+ }
5453
+ }
5454
+ }
5455
+ stream2.write("\n");
5456
+ }
5457
+ function renderJSON(models, stream2) {
5458
+ const output = {
5459
+ models: models.map((model) => ({
5460
+ provider: model.provider,
5461
+ modelId: model.modelId,
5462
+ displayName: model.displayName,
5463
+ contextWindow: model.contextWindow,
5464
+ maxOutputTokens: model.maxOutputTokens,
5465
+ pricing: {
5466
+ input: model.pricing.input,
5467
+ output: model.pricing.output,
5468
+ cachedInput: model.pricing.cachedInput,
5469
+ currency: "USD",
5470
+ per: "1M tokens"
5471
+ },
5472
+ knowledgeCutoff: model.knowledgeCutoff,
5473
+ features: model.features,
5474
+ metadata: model.metadata
5475
+ })),
5476
+ shortcuts: MODEL_ALIASES
5477
+ };
5478
+ stream2.write(JSON.stringify(output, null, 2) + "\n");
5479
+ }
5480
+ function formatTokens(count) {
5481
+ if (count >= 1e6) {
5482
+ return `${(count / 1e6).toFixed(1)}M tokens`;
5483
+ } else if (count >= 1e3) {
5484
+ return `${(count / 1e3).toFixed(0)}K tokens`;
5485
+ } else {
5486
+ return `${count} tokens`;
5487
+ }
5488
+ }
5489
+ function registerModelsCommand(program, env) {
5490
+ program.command(COMMANDS.models).description("List all available LLM models with pricing and capabilities.").option("--provider <name>", "Filter by provider (openai, anthropic, gemini)").option("--format <format>", "Output format: table or json", "table").option("--verbose", "Show detailed model information", false).action(
5491
+ (options) => executeAction(
5492
+ () => handleModelsCommand(options, env),
5493
+ env
5494
+ )
5495
+ );
5496
+ }
5497
+
5288
5498
  // src/cli/environment.ts
5289
5499
  var import_node_readline = __toESM(require("readline"), 1);
5290
- var import_chalk3 = __toESM(require("chalk"), 1);
5500
+ var import_chalk4 = __toESM(require("chalk"), 1);
5291
5501
  init_client();
5292
5502
  init_logger();
5293
5503
  var LOG_LEVEL_MAP = {
@@ -5333,14 +5543,14 @@ function createPromptFunction(stdin, stdout) {
5333
5543
  output: stdout
5334
5544
  });
5335
5545
  stdout.write("\n");
5336
- stdout.write(`${import_chalk3.default.cyan("\u2500".repeat(60))}
5546
+ stdout.write(`${import_chalk4.default.cyan("\u2500".repeat(60))}
5337
5547
  `);
5338
- stdout.write(import_chalk3.default.cyan.bold("\u{1F916} Agent asks:\n"));
5548
+ stdout.write(import_chalk4.default.cyan.bold("\u{1F916} Agent asks:\n"));
5339
5549
  stdout.write(`${question}
5340
5550
  `);
5341
- stdout.write(`${import_chalk3.default.cyan("\u2500".repeat(60))}
5551
+ stdout.write(`${import_chalk4.default.cyan("\u2500".repeat(60))}
5342
5552
  `);
5343
- rl.question(import_chalk3.default.green.bold("You: "), (answer) => {
5553
+ rl.question(import_chalk4.default.green.bold("You: "), (answer) => {
5344
5554
  rl.close();
5345
5555
  resolve(answer);
5346
5556
  });
@@ -5383,6 +5593,7 @@ function createProgram(env) {
5383
5593
  });
5384
5594
  registerCompleteCommand(program, env);
5385
5595
  registerAgentCommand(program, env);
5596
+ registerModelsCommand(program, env);
5386
5597
  return program;
5387
5598
  }
5388
5599
  async function runCLI(overrides = {}) {