Files
ai-kit/package.json
T
CatoandClaude Opus 5 d37b905eb7 feat(chain): two more Groq links, because the meter is per model (#58)
#57 established that Groq rations requests and TPM PER MODEL. This is the
consequence: a second, third and fourth id at the same vendor are real
fallbacks, not the illusory same-pool step-down the header warns about.

The same key already reaches two more general-purpose chat models. Probed live
2026-09-13 with a real tool call, using the prompt the loop actually sends —
protocol each answered on, and the window each reported back within the same
minute:

  openai/gpt-oss-120b   native   7,551 / 8,000 tokens this minute
  openai/gpt-oss-20b    native
  qwen/qwen3.8-27b      text     7,360 / 8,000
  qwen/qwen3.6-27b      text     7,362 / 8,000

Three distinct counters inside one minute on one key. That is the argument.

THE QWEN PAIR ANSWER ON TEXT ONLY

No native `tool_calls` — exactly the case a native-only client loses in silence,
and exactly why complete() parses both protocols. Both returned correct
arguments and both carry 131k context, so they sit after the native pair for
parse reliability, not for capability.

They sit BEFORE OpenRouter on purpose. OpenRouter's unpaid tier is 50 REQUESTS a
day for the whole account, so every Groq pool worth draining should be drained
before one of those 50 is spent.

dailyTokens IS NOT RAISED

Four links buy four minute windows and four request counters. They do not buy
one extra daily token, because TPD is org-wide. Multiplying the figure by the
model count would be the exact failure the field's contract warns about —
fair-share rationing capacity that does not exist, with the wall arriving later
in the day and harder to diagnose.

Measured, not assumed: what motivated this was a real outage. One app spent an
afternoon returning 503s to its operator with two Groq links configured, both
request-limited, while two more usable models sat behind the same key.

261 tests pass, verify green.


Claude-Session: https://claude.ai/code/session_01Nm2REqtdsVsvjukBU2maCz

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-13 09:05:58 -07:00

112 lines
2.7 KiB
JSON

{
"name": "@bitbaum/ai-kit",
"version": "1.7.0",
"license": "MIT",
"author": "Mao Nakamoto",
"homepage": "https://github.com/bitbaum/ai-kit#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/bitbaum/ai-kit.git"
},
"bugs": {
"url": "https://github.com/bitbaum/ai-kit/issues"
},
"keywords": [
"ai",
"llm",
"form-fill",
"fallback",
"failover",
"health-check",
"free-tier",
"rate-limit",
"quota",
"fair-share",
"groq",
"openrouter"
],
"type": "module",
"sideEffects": false,
"packageManager": "pnpm@11.25.0",
"engines": {
"node": ">=20"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"files": [
"dist",
"dist-cjs",
"src"
],
"exports": {
".": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
},
"./forms": {
"types": "./dist/forms.d.ts",
"default": "./dist/forms.js"
},
"./react": {
"types": "./dist/react.d.ts",
"default": "./dist/react.js"
},
"./server": {
"types": "./dist/server.d.ts",
"default": "./dist/server.js"
},
"./registry": {
"types": "./dist/registry.d.ts",
"require": "./dist-cjs/registry.js",
"default": "./dist/registry.js"
},
"./web": {
"types": "./dist/web/index.d.ts",
"default": "./dist/web/index.js"
},
"./capability": {
"types": "./dist/capability/index.d.ts",
"default": "./dist/capability/index.js"
},
"./grounding": {
"types": "./dist/grounding/index.d.ts",
"require": "./dist-cjs/grounding/index.js",
"default": "./dist/grounding/index.js"
}
},
"scripts": {
"build": "tsc -p tsconfig.json && tsc -p tsconfig.cjs.json && node -e \"require('fs').writeFileSync('dist-cjs/package.json', JSON.stringify({type:'commonjs'})+'\\n')\"",
"lint": "eslint .",
"typecheck": "tsc -p tsconfig.json --noEmit",
"test": "node --test test/*.test.js",
"check:catalog": "pnpm run build && node scripts/check-catalog.mjs",
"smoke": "pnpm run build && node scripts/smoke.mjs",
"verify": "pnpm run format:check && pnpm run lint && pnpm run typecheck && pnpm run build && pnpm test",
"prepare": "pnpm run build",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"devDependencies": {
"@eslint/js": "^10.0.1",
"@types/node": "^26.5.0",
"eslint": "^10.10.0",
"globals": "^17.12.0",
"prettier": "3.9.6",
"typescript": "^6.0.3",
"typescript-eslint": "^8.70.0"
},
"dependencies": {
"ai-forms": "^0.1.2"
},
"peerDependencies": {
"react": ">=18"
},
"peerDependenciesMeta": {
"react": {
"optional": true
}
}
}