@rely-ai/caliber 1.5.6 → 1.6.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.
Files changed (2) hide show
  1. package/dist/bin.js +23 -5
  2. package/package.json +1 -1
package/dist/bin.js CHANGED
@@ -520,6 +520,11 @@ var DEFAULT_MODELS = {
520
520
  cursor: "default",
521
521
  "claude-cli": "default"
522
522
  };
523
+ var DEFAULT_FAST_MODELS = {
524
+ anthropic: "claude-haiku-4-5-20251001",
525
+ vertex: "claude-haiku-4-5-20251001",
526
+ openai: "gpt-4.1-mini"
527
+ };
523
528
  function loadConfig() {
524
529
  const envConfig = resolveFromEnv();
525
530
  if (envConfig) return envConfig;
@@ -591,7 +596,12 @@ function getConfigFilePath() {
591
596
  return CONFIG_FILE;
592
597
  }
593
598
  function getFastModel() {
594
- return process.env.CALIBER_FAST_MODEL || process.env.ANTHROPIC_SMALL_FAST_MODEL || void 0;
599
+ if (process.env.CALIBER_FAST_MODEL) return process.env.CALIBER_FAST_MODEL;
600
+ if (process.env.ANTHROPIC_SMALL_FAST_MODEL) return process.env.ANTHROPIC_SMALL_FAST_MODEL;
601
+ const config = loadConfig();
602
+ if (config?.fastModel) return config.fastModel;
603
+ if (config?.provider) return DEFAULT_FAST_MODELS[config.provider];
604
+ return void 0;
595
605
  }
596
606
 
597
607
  // src/llm/anthropic.ts
@@ -4361,6 +4371,7 @@ async function scoreWithLLM(candidates, toolDeps) {
4361
4371
  const vendorTag = c.vendor ? " [VENDOR/OFFICIAL]" : "";
4362
4372
  return `${i}. "${c.name}"${vendorTag} (${c.stars} stars) \u2014 ${c.description.slice(0, 100)}`;
4363
4373
  }).join("\n");
4374
+ const fastModel = getFastModel();
4364
4375
  const scored = await llmJsonCall({
4365
4376
  system: SCORE_MCP_PROMPT,
4366
4377
  prompt: `TOOL DEPENDENCIES IN PROJECT:
@@ -4368,7 +4379,8 @@ ${toolDeps.join(", ")}
4368
4379
 
4369
4380
  MCP SERVER CANDIDATES:
4370
4381
  ${candidateList}`,
4371
- maxTokens: 4e3
4382
+ maxTokens: 4e3,
4383
+ ...fastModel ? { model: fastModel } : {}
4372
4384
  });
4373
4385
  if (!Array.isArray(scored)) return [];
4374
4386
  return scored.filter((s) => s.score >= 60 && s.index >= 0 && s.index < candidates.length).sort((a, b) => b.score - a.score).slice(0, 5).map((s) => ({
@@ -4401,13 +4413,15 @@ async function fetchReadme(repoFullName) {
4401
4413
  async function extractMcpConfig(readme, serverName) {
4402
4414
  try {
4403
4415
  const truncated = readme.length > 15e3 ? readme.slice(0, 15e3) : readme;
4416
+ const fastModel = getFastModel();
4404
4417
  const result = await llmJsonCall({
4405
4418
  system: EXTRACT_CONFIG_PROMPT,
4406
4419
  prompt: `MCP Server: ${serverName}
4407
4420
 
4408
4421
  README:
4409
4422
  ${truncated}`,
4410
- maxTokens: 2e3
4423
+ maxTokens: 2e3,
4424
+ ...fastModel ? { model: fastModel } : {}
4411
4425
  });
4412
4426
  if (!result || !result.command) return null;
4413
4427
  return {
@@ -4943,6 +4957,7 @@ async function searchAllProviders(technologies, platform) {
4943
4957
  }
4944
4958
  async function scoreWithLLM2(candidates, projectContext, technologies) {
4945
4959
  const candidateList = candidates.map((c, i) => `${i}. "${c.name}" \u2014 ${c.reason || "no description"}`).join("\n");
4960
+ const fastModel = getFastModel();
4946
4961
  const scored = await llmJsonCall({
4947
4962
  system: `You evaluate whether AI agent skills and tools are relevant to a specific software project.
4948
4963
  Given a project context and a list of candidates, score each one's relevance from 0-100 and provide a brief reason (max 80 chars).
@@ -4970,7 +4985,8 @@ ${technologies.join(", ")}
4970
4985
 
4971
4986
  CANDIDATES:
4972
4987
  ${candidateList}`,
4973
- maxTokens: 8e3
4988
+ maxTokens: 8e3,
4989
+ ...fastModel ? { model: fastModel } : {}
4974
4990
  });
4975
4991
  if (!Array.isArray(scored)) return [];
4976
4992
  return scored.filter((s) => s.score >= 60 && s.index >= 0 && s.index < candidates.length).sort((a, b) => b.score - a.score).slice(0, 20).map((s) => ({
@@ -6945,10 +6961,12 @@ ${skillsSummary}`);
6945
6961
  const prompt = `${contextParts.length ? contextParts.join("\n\n---\n\n") + "\n\n---\n\n" : ""}## Tool Events from Session (${fittedEvents.length} events)
6946
6962
 
6947
6963
  ${eventsText}`;
6964
+ const fastModel = getFastModel();
6948
6965
  const raw = await llmCall({
6949
6966
  system: LEARN_SYSTEM_PROMPT,
6950
6967
  prompt,
6951
- maxTokens: 4096
6968
+ maxTokens: 4096,
6969
+ ...fastModel ? { model: fastModel } : {}
6952
6970
  });
6953
6971
  return parseAnalysisResponse(raw);
6954
6972
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rely-ai/caliber",
3
- "version": "1.5.6",
3
+ "version": "1.6.0",
4
4
  "description": "Analyze your codebase and generate optimized AI agent configs (CLAUDE.md, .cursorrules, skills) — no API key needed",
5
5
  "type": "module",
6
6
  "bin": {