{"_id":"@anton-sifta/llms","name":"@anton-sifta/llms","dist-tags":{"latest":"0.0.42"},"versions":{"0.0.42":{"name":"@anton-sifta/llms","version":"0.0.42","description":"Config-driven SDK for selecting LLM providers and models — @anton-sifta/alice hand (SIFTA fork of cline)","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/antonpictures/ANTON-SIFTA.git","directory":"Vendor/alice-cli/sdk/packages/llms"},"main":"./dist/index.js","module":"./dist/index.js","engines":{"node":">=22"},"type":"module","types":"./dist/index.d.ts","exports":{".":{"browser":"./dist/index.browser.js","react-server":"./dist/index.browser.js","import":"./dist/index.js","types":"./dist/index.d.ts"},"./browser":{"import":"./dist/index.browser.js","types":"./dist/index.browser.d.ts"}},"scripts":{"build":"bun run bun.mts && bun tsc -p tsconfig.build.json","typecheck":"bun tsc -p tsconfig.dev.json --noEmit","test":"vitest run","test:live":"vitest run src/tests/provider-live*.test.ts","test:vcr":"vitest run src/tests/provider-vcr.test.ts","test:watch":"vitest","generate:models":"bun run scripts/generate-models.ts"},"peerDependenciesMeta":{"@aws-sdk/client-bedrock-runtime":{"optional":true}},"dependencies":{"@ai-sdk/amazon-bedrock":"^4.0.89","@ai-sdk/anthropic":"^3.0.68","@ai-sdk/google":"^3.0.60","@ai-sdk/google-vertex":"^4.0.100","@ai-sdk/mistral":"^3.0.28","@ai-sdk/openai":"^3.0.52","@ai-sdk/openai-compatible":"^2.0.38","@ai-sdk/provider":"^3.0.8","@aws-sdk/credential-providers":"^3.922.0","@anton-sifta/shared":"workspace:*","@jerome-benoit/sap-ai-provider":"4.6.9","@langfuse/otel":"^4.0.0","@opentelemetry/api":"^1.9.0","@opentelemetry/sdk-trace-node":"^2.6.1","@streamparser/json":"^0.0.21","ai":"^6.0.144","ai-sdk-provider-claude-code":"^3.4.3","ai-sdk-provider-codex-cli":"^1.1.0","ai-sdk-provider-opencode-sdk":"^3.0.1","dify-ai-provider":"^1.1.0","nanoid":"^5.1.7","zod":"^4.3.6"},"peerDependencies":{"@aws-sdk/client-bedrock-runtime":"^3.0.0"},"gitHead":"9f42aea85de581ac3a8053726d532f5d5a5463b3","_id":"@anton-sifta/llms@0.0.42","bugs":{"url":"https://github.com/antonpictures/ANTON-SIFTA/issues"},"homepage":"https://github.com/antonpictures/ANTON-SIFTA#readme","_nodeVersion":"25.4.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-6XyeV/ScjOuw5jBQr1O0dJcRMLQhPsk2od5RmUKV8D2KWFVSmRmUs4zdLYKftgw1VpkXPcf19v4fqpIauH3MHw==","shasum":"d50cba8418d23a00b79553b51a851f39855d9e38","tarball":"https://registry.npmjs.org/@anton-sifta/llms/-/llms-0.0.42.tgz","fileCount":105,"unpackedSize":1836567,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIG1sK1/YOFqdydB+rYg9k8rlfJF7nYaj/tk4X3rvF3VfAiAB1DqVxfYef/J6CXia5T6qvmZos1XArNWpt7UaruWNDw=="}]},"_npmUser":{"name":"ioangeorgeanton","email":"antonpictures@me.com"},"directories":{},"maintainers":[{"name":"ioangeorgeanton","email":"antonpictures@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/llms_0.0.42_1780075209803_0.3812739867626649"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-29T17:20:09.641Z","0.0.42":"2026-05-29T17:20:10.000Z","modified":"2026-05-29T17:20:10.232Z"},"maintainers":[{"name":"ioangeorgeanton","email":"antonpictures@me.com"}],"description":"Config-driven SDK for selecting LLM providers and models — @anton-sifta/alice hand (SIFTA fork of cline)","homepage":"https://github.com/antonpictures/ANTON-SIFTA#readme","repository":{"type":"git","url":"git+https://github.com/antonpictures/ANTON-SIFTA.git","directory":"Vendor/alice-cli/sdk/packages/llms"},"bugs":{"url":"https://github.com/antonpictures/ANTON-SIFTA/issues"},"readme":"# [experimental] @cline/llms\n\n`@cline/llms` is the model and provider layer for the Cline SDK. It gives\nyou typed provider settings, model catalogs, shared gateway contracts, and\nAI SDK-backed handler creation for supported LLM backends.\n\n## What You Get\n\n- `@cline/llms/runtime` for declarative config and runtime registry creation\n- `@cline/llms/providers` for handler creation and provider settings/types\n- `@cline/llms/models` for model catalogs and query helpers\n- `@cline/llms` root exports for the gateway registry and shared llm contracts\n\n## Installation\n\n```bash\nnpm install @cline/llms zod\n```\n\n## Quick Start\n\n```ts\nimport { createHandler } from \"@cline/llms\";\n\nconst handler = createHandler({\n\tproviderId: \"anthropic\",\n\tapiKey: process.env.ANTHROPIC_API_KEY ?? \"\",\n\tmodelId: \"claude-sonnet-4-6\",\n});\n\nfor await (const chunk of handler.createMessage(\"You are a concise assistant.\", [\n\t{ role: \"user\", content: [{ type: \"text\", text: \"Say hello.\" }] },\n])) {\n\tconsole.log(chunk);\n}\n```\n\n## Main APIs\n\n### Runtime\n\nUse `createLlmsRuntime(...)` when you want a small registry around:\n\n- configured providers and their default models\n- builtin provider discovery via `getBuiltInProviders()`\n- custom provider registration via `registerBuiltinProvider(...)`\n- handler creation for builtin or custom providers\n\nPreferred import:\n\n```ts\nimport { createLlmsRuntime, defineLlmsConfig } from \"@cline/llms/runtime\";\n```\n\n### Providers\n\nUse `@cline/llms/providers` for:\n\n- `createHandler(...)` and `createHandlerAsync(...)`\n- `ProviderSettings` and `ProviderSettingsSchema`\n- `ProviderConfig`\n- `Message` and `ApiStreamChunk`\n\nBuilt-in providers are routed through the internal gateway registry and backed by\nAI SDK provider implementations. Shared gateway contracts are exported from both\n`@cline/llms` and `@cline/shared`.\n\n### Models\n\nUse `@cline/llms/models` when you need generated provider/model metadata for\nselection UIs, defaults, or validation.\n\nFor generated catalog field semantics and token-limit behavior, see\n[`src/catalog/README.md`](./src/catalog/README.md).\n\n## Entry Points\n\n- `@cline/llms`: runtime-focused convenience entrypoint\n- `@cline/llms/node`: explicit Node/runtime entrypoint\n- `@cline/llms/browser`: browser-safe bundle\n- `@cline/llms/runtime`: focused runtime entrypoint\n- `@cline/llms/models`: model catalog/query entrypoint\n- `@cline/llms/providers`: provider handler/settings entrypoint\n\n## Related Packages\n\n- `@cline/agents`: agent loop and tool execution\n- `@cline/core`: stateful runtime assembly and provider settings storage\n\n## More Examples\n\n- Workspace overview: [README.md](https://github.com/cline/cline/blob/main/README.md)\n- API and architecture references: [DOC.md](https://github.com/cline/cline/blob/main/DOC.md), [ARCHITECTURE.md](https://github.com/cline/cline/blob/main/ARCHITECTURE.md)\n\n## Live Provider Smoke Test\n\nUse this for API-key-backed provider validation against real endpoints.\n\n1. Ensure provider keys are present in your environment (`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `CLINE_API_KEY`, etc.).\n2. Use the sample config at `packages/llms/src/tests/live-providers.example.json` as the providers list.\n3. Run:\n\n```bash\nLLMS_LIVE_TESTS=1 \\\nLLMS_LIVE_PROVIDERS_PATH=/absolute/path/to/packages/llms/src/tests/live-providers.example.json \\\nbun -F @cline/llms run test:live\n```\n\nReasoning-focused live run (same command, different flags):\n\n```bash\nLLMS_LIVE_REASONING_TESTS=1 \\\nLLMS_LIVE_REASONING_PROVIDERS_PATH=/absolute/path/to/packages/llms/src/tests/live-providers.reasoning.example.json \\\nbun -F @cline/llms run test:live\n```\n\nTool-use-focused live run (same command, different flags):\n\n```bash\nLLMS_LIVE_TOOL_TESTS=1 \\\nLLMS_LIVE_TOOL_PROVIDERS_PATH=/absolute/path/to/packages/llms/src/tests/live-providers.tools.example.json \\\nbun -F @cline/llms run test:live\n```\n\nOptional:\n\n- `LLMS_LIVE_PROVIDER_TIMEOUT_MS=120000` to increase per-provider timeout.\n- `LLMS_LIVE_PROVIDER_RETRIES=2` to retry transient upstream/provider failures per provider (total attempts = retries + 1).\n- `LLMS_LIVE_PROVIDER_CONCURRENCY=3` to run multiple provider entries in parallel. Defaults to `3`; lower it if you need stricter provider rate-limit behavior.\n- Point `LLMS_LIVE_PROVIDERS_PATH` to a custom file if you want a narrower provider set.\n- Point `LLMS_LIVE_REASONING_PROVIDERS_PATH` to a custom file for reasoning-enabled suites.\n- Point `LLMS_LIVE_TOOL_PROVIDERS_PATH` to a custom file for tool-use suites.\n- Use `apiKeyEnv`, `baseUrlEnv`, and `headersEnv` in a provider entry when a live config needs secrets without writing them to JSON.\n- When recording provider cassettes for committed replay tests, set `CLINE_VCR=record` and `CLINE_VCR_INCLUDE_REQUEST_BODY=1` so playback also verifies the sanitized request body contract.\n\nOpenAI Codex subscription live runs use the saved OAuth credentials from `~/.cline/data/settings/providers.json` after `cline auth --provider openai-codex`. Point the plain or reasoning suite at `packages/llms/src/tests/live-providers.openai-codex.example.json` or `packages/llms/src/tests/live-providers.openai-codex.reasoning.example.json`.\n\nPer-provider live assertions are configured in the JSON via `expectations`:\n\n- `requireUsage`: fail if no `usage` chunk is emitted (defaults to `true`; set to `false` to opt out).\n- `requireCacheReadTokens`: fail unless `cacheReadTokens > 0` (auto-runs at least 2 attempts with a long cache probe prompt if no prompt override is provided).\n- `minCacheReadTokens`: stricter cache floor check.\n- `requireReasoningChunk`: fail unless at least one reasoning chunk is emitted.\n- `requireNoReasoningChunk`: fail if any reasoning chunk is emitted.\n- `minInputTokens` / `minOutputTokens`: enforce lower bounds.\n- `requireToolCall`: fail unless at least one `tool_calls` chunk is emitted.\n\nIn reasoning suites, set `requireReasoningSignal: true` to require either a reasoning chunk or `thoughtsTokenCount > 0` (provider-dependent; can be flaky on some endpoints).\nTo check that disabling reasoning actually suppresses reasoning output across models, use `packages/llms/src/tests/live-providers.reasoning-disabled.example.json`; it covers direct and routed provider paths across `cline`, `openai`, `openrouter`, `anthropic`, `gemini`, `vercel-ai-gateway`, `zai`, and `deepseek` where model support exists, with `reasoning.enabled: false` and `requireNoReasoningChunk: true`.\n\nCommon live failure classes:\n\n- `Overloaded`: provider/model capacity issue or transient upstream saturation.\n- `Insufficient Balance`: the provider account needs funds.\n- `Model Not Exist`: the model id is not available for that provider/account.\n- assertion failures such as `expected no reasoning chunks`: likely real SDK/provider-option behavior regressions.\n\n### Adding A Model To Live Tests\n\nAdd a new entry under the `providers` object in either config file:\n\n- Cache/smoke suite: `packages/llms/src/tests/live-providers.example.json`\n- Reasoning suite: `packages/llms/src/tests/live-providers.reasoning.example.json`\n- Reasoning-disabled suite (asserts no reasoning chunks when reasoning is off): `packages/llms/src/tests/live-providers.reasoning-disabled.example.json`\n- Tool-use suite: `packages/llms/src/tests/live-providers.tools.example.json`\n\nMinimal smoke/cache entry:\n\n```json\n\"my-openai-model\": {\n  \"settings\": {\n    \"provider\": \"openai\",\n    \"model\": \"gpt-5.4\"\n  },\n  \"expectations\": {\n    \"requireUsage\": true\n  }\n}\n```\n\nCache-asserted entry (auto-enforces multi-run cache probe):\n\n```json\n\"my-cache-model\": {\n  \"settings\": {\n    \"provider\": \"openai\",\n    \"model\": \"gpt-5.4\"\n  },\n  \"expectations\": {\n    \"requireUsage\": true,\n    \"requireCacheReadTokens\": true\n  }\n}\n```\n\nReasoning entry:\n\n```json\n\"my-reasoning-model\": {\n  \"settings\": {\n    \"provider\": \"anthropic\",\n    \"model\": \"claude-sonnet-4-6\",\n    \"reasoning\": {\n      \"effort\": \"high\"\n    }\n  },\n  \"expectations\": {\n    \"requireUsage\": true,\n    \"requireReasoningChunk\": true\n  }\n}\n```\n\nTool-use entry:\n\n```json\n\"my-tools-model\": {\n  \"settings\": {\n    \"provider\": \"openai\",\n    \"model\": \"gpt-5.4\"\n  },\n  \"expectations\": {\n    \"requireUsage\": true,\n    \"requireToolCall\": true\n  }\n}\n```\n","readmeFilename":"README.md","_rev":"1-8d60336c2159f087a7987506f86f16ff"}