{"_id":"@djosh34/lmstudio-ai-sdk-provider","_rev":"3-ac6693374250a1e7d5cc161a49d75830","name":"@djosh34/lmstudio-ai-sdk-provider","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.1":{"name":"@djosh34/lmstudio-ai-sdk-provider","version":"0.0.1","keywords":["ai","lmstudio","vercel","ai-sdk","provider","typescript"],"author":{"name":"Joshua Azimullah"},"license":"Apache-2.0","_id":"@djosh34/lmstudio-ai-sdk-provider@0.0.1","maintainers":[{"name":"djosh34","email":"public.djosh34.email@djkaasstengel.nl"}],"homepage":"https://github.com/djosh34/lmstudio-ai-sdk-provider#readme","bugs":{"url":"https://github.com/djosh34/lmstudio-ai-sdk-provider/issues"},"dist":{"shasum":"3a01da41e4830cb7da6df60585a5066e90f66d07","tarball":"https://registry.npmjs.org/@djosh34/lmstudio-ai-sdk-provider/-/lmstudio-ai-sdk-provider-0.0.1.tgz","fileCount":9,"integrity":"sha512-B7SMtu9SKGEksCew4wcWNisl6hp9pXHLf5jIZt4T6cLlaoaLBA925LkIHTz08DaffVz7ItMicWysbrLKkmZwDQ==","signatures":[{"sig":"MEUCIQCelK3ZlDiyanxJ3LdxOVOvl04DLsDpbelQsk8FxQC/9AIgK6B8vruSpxSu0NpfGZA4wHF6isTqjfvUt4FypAmq9V0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":164334},"main":"./dist/index.cjs","type":"module","_from":"file:djosh34-lmstudio-ai-sdk-provider-0.0.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"scripts":{"lint":"biome lint --write ./src","test":"vitest","build":"tsup","start":"pnpm run build:run && node --enable-source-maps dist/index.js","format":"biome format --write ./src","build:run":"pnpm run type-check && rsbuild build","type-check":"tsc --noEmit"},"_npmUser":{"name":"djosh34","actor":{"name":"djosh34","type":"user","email":"public.djosh34.email@djkaasstengel.nl"},"email":"public.djosh34.email@djkaasstengel.nl"},"_resolved":"/private/var/folders/qz/yhfx5rcd09zbwh0x9g16w1600000gn/T/9499148503094a2ab8fcaecf2e407345/djosh34-lmstudio-ai-sdk-provider-0.0.1.tgz","_integrity":"sha512-B7SMtu9SKGEksCew4wcWNisl6hp9pXHLf5jIZt4T6cLlaoaLBA925LkIHTz08DaffVz7ItMicWysbrLKkmZwDQ==","repository":{"url":"git+https://github.com/djosh34/lmstudio-ai-sdk-provider.git","type":"git"},"_npmVersion":"10.9.2","description":"LM Studio provider for Vercel AI SDK using LMStudio Typescript SDK","directories":{},"_nodeVersion":"22.15.0","dependencies":{"zod":"^3.25.67","neverthrow":"^8.2.0","@lmstudio/sdk":"^1.2.2","@ai-sdk/provider":"^1.1.3","@ai-sdk/provider-utils":"^2.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^4.3.16","tsup":"^8.5.0","vitest":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.0.3"},"peerDependencies":{"ai":"^4.3.16"},"optionalDependencies":{"bufferutil":"^4.0.9"},"_npmOperationalInternal":{"tmp":"tmp/lmstudio-ai-sdk-provider_0.0.1_1750796909440_0.5909187777823433","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@djosh34/lmstudio-ai-sdk-provider","version":"0.0.2","keywords":["ai","lmstudio","vercel","ai-sdk","provider","typescript"],"author":{"name":"Joshua Azimullah"},"license":"Apache-2.0","_id":"@djosh34/lmstudio-ai-sdk-provider@0.0.2","maintainers":[{"name":"djosh34","email":"public.djosh34.email@djkaasstengel.nl"}],"homepage":"https://github.com/djosh34/lmstudio-ai-sdk-provider#readme","bugs":{"url":"https://github.com/djosh34/lmstudio-ai-sdk-provider/issues"},"dist":{"shasum":"640a2680a3e48e6ecf64091ed76116c8051bc39c","tarball":"https://registry.npmjs.org/@djosh34/lmstudio-ai-sdk-provider/-/lmstudio-ai-sdk-provider-0.0.2.tgz","fileCount":9,"integrity":"sha512-0M2Og3cBvBLS4k8HHvcI8spG/OaKkwvRNXt86rCsBHnrACCS6sjXhwgUbiGkvjp79Ke8vpK1diOar/CRC2bKZQ==","signatures":[{"sig":"MEUCIQDEx5kIk+ptHz4eojz/IsK5wfd3hrD+FkzFDKJ1qhRBNQIgYfKBwIiQqjdWgB4DuJy6yCHaiDfXgdaqBPwiDFdeu/U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":164403},"main":"./dist/index.cjs","type":"module","_from":"file:djosh34-lmstudio-ai-sdk-provider-0.0.2.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"},"./package.json":"./package.json"},"scripts":{"lint":"biome lint --write ./src","test":"vitest","build":"tsup","start":"pnpm run build:run && node --enable-source-maps dist/index.js","format":"biome format --write ./src","build:run":"pnpm run type-check && rsbuild build","type-check":"tsc --noEmit"},"_npmUser":{"name":"djosh34","actor":{"name":"djosh34","type":"user","email":"public.djosh34.email@djkaasstengel.nl"},"email":"public.djosh34.email@djkaasstengel.nl"},"_resolved":"/private/var/folders/qz/yhfx5rcd09zbwh0x9g16w1600000gn/T/70af828d819c58e9ea3b90c37e3c461a/djosh34-lmstudio-ai-sdk-provider-0.0.2.tgz","_integrity":"sha512-0M2Og3cBvBLS4k8HHvcI8spG/OaKkwvRNXt86rCsBHnrACCS6sjXhwgUbiGkvjp79Ke8vpK1diOar/CRC2bKZQ==","repository":{"url":"git+https://github.com/djosh34/lmstudio-ai-sdk-provider.git","type":"git"},"_npmVersion":"10.9.2","description":"LM Studio provider for Vercel AI SDK using LMStudio Typescript SDK","directories":{},"_nodeVersion":"22.15.0","dependencies":{"zod":"^3.25.67","neverthrow":"^8.2.0","@lmstudio/sdk":"^1.2.2","@ai-sdk/provider":"^1.1.3","@ai-sdk/provider-utils":"^2.2.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"ai":"^4.3.16","tsup":"^8.5.0","vitest":"^3.2.4","typescript":"^5.8.3","@types/node":"^24.0.3"},"peerDependencies":{"ai":"^4.3.16"},"optionalDependencies":{"bufferutil":"^4.0.9"},"_npmOperationalInternal":{"tmp":"tmp/lmstudio-ai-sdk-provider_0.0.2_1750801267893_0.2646042018877717","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@djosh34/lmstudio-ai-sdk-provider","version":"0.0.3","description":"LM Studio provider for Vercel AI SDK using LMStudio Typescript SDK","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"keywords":["ai","lmstudio","vercel","ai-sdk","provider","typescript"],"author":{"name":"Joshua Azimullah"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/djosh34/lmstudio-ai-sdk-provider.git"},"engines":{"node":">=18"},"publishConfig":{"access":"public"},"peerDependencies":{"ai":"^4.3.16"},"dependencies":{"@ai-sdk/provider":"^2.0.0","@ai-sdk/provider-utils":"^2.2.8","@lmstudio/sdk":"^1.5.0","neverthrow":"^8.2.0","zod":"^3.25.76"},"devDependencies":{"@types/node":"^24.3.1","ai":"^5.0.33","tsup":"^8.5.0","typescript":"^5.9.2","vitest":"^3.2.4"},"optionalDependencies":{"bufferutil":"^4.0.9"},"scripts":{"start":"pnpm run build && node --enable-source-maps dist/exampleUsage.js","build":"tsup","format":"biome format --write ./src","lint":"biome lint --write ./src","type-check":"tsc --noEmit","test":"vitest"},"_id":"@djosh34/lmstudio-ai-sdk-provider@0.0.3","bugs":{"url":"https://github.com/djosh34/lmstudio-ai-sdk-provider/issues"},"homepage":"https://github.com/djosh34/lmstudio-ai-sdk-provider#readme","_integrity":"sha512-4wru3I4UnP4XOHSY/Khpx43tEz70jcGSAwZfz5mP1cPgutKPbSRrVq7SFI4gHNXuv50aWpnMDYo2GPtmeRuPOA==","_resolved":"/private/var/folders/qz/yhfx5rcd09zbwh0x9g16w1600000gn/T/f51ea91ab5e63a6421cb026c493056cb/djosh34-lmstudio-ai-sdk-provider-0.0.3.tgz","_from":"file:djosh34-lmstudio-ai-sdk-provider-0.0.3.tgz","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-4wru3I4UnP4XOHSY/Khpx43tEz70jcGSAwZfz5mP1cPgutKPbSRrVq7SFI4gHNXuv50aWpnMDYo2GPtmeRuPOA==","shasum":"70629d50dd32ac491b7173c4355a8bbd4a7a212d","tarball":"https://registry.npmjs.org/@djosh34/lmstudio-ai-sdk-provider/-/lmstudio-ai-sdk-provider-0.0.3.tgz","fileCount":15,"unpackedSize":346277,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIDBRe5bEHP88OslqSTmTyObpho5vJTdVAJ0ha7kEC9EwAiEAyNuyJDpK+xr9muwRZfgN+64BTAsGOevRIiq+UEhGYXU="}]},"_npmUser":{"name":"djosh34","email":"public.djosh34.email@djkaasstengel.nl"},"directories":{},"maintainers":[{"name":"djosh34","email":"public.djosh34.email@djkaasstengel.nl"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/lmstudio-ai-sdk-provider_0.0.3_1757092077865_0.8483839999738305"},"_hasShrinkwrap":false}},"time":{"created":"2025-06-24T20:28:29.356Z","modified":"2025-09-05T17:07:58.258Z","0.0.1":"2025-06-24T20:28:29.608Z","0.0.2":"2025-06-24T21:41:08.066Z","0.0.3":"2025-09-05T17:07:58.067Z"},"bugs":{"url":"https://github.com/djosh34/lmstudio-ai-sdk-provider/issues"},"author":{"name":"Joshua Azimullah"},"license":"Apache-2.0","homepage":"https://github.com/djosh34/lmstudio-ai-sdk-provider#readme","keywords":["ai","lmstudio","vercel","ai-sdk","provider","typescript"],"repository":{"type":"git","url":"git+https://github.com/djosh34/lmstudio-ai-sdk-provider.git"},"description":"LM Studio provider for Vercel AI SDK using LMStudio Typescript SDK","maintainers":[{"name":"djosh34","email":"public.djosh34.email@djkaasstengel.nl"}],"readme":"# LM Studio AI SDK Provider\n\nLM Studio provider for the [Vercel AI SDK](https://ai-sdk.dev/docs/introduction) with proper token usage tracking.\n\n## Why This Provider?\n\nThe OpenAI-compatible client doesn't track token usage during streaming. This provider uses the [LM Studio TypeScript SDK](https://lmstudio.ai/docs/typescript) which has better support and proper token tracking.\n\n## Requirements\n\n- Node.js 18+\n- [LM Studio](https://lmstudio.ai/) running locally or remotely\n\n## Installation\n\n```bash\nnpm install @djosh34/lmstudio-ai-sdk-provider\n```\n\n## Usage\n\n```typescript\nimport { createLMStudio } from '@djosh34/lmstudio-ai-sdk-provider';\nimport { generateText, streamText } from 'ai';\n\n// Create provider (uses localhost:1234 by default)\nconst lmstudio = createLMStudio();\n\n// Generate text\nconst { text } = await generateText({\n  model: lmstudio('your-model-name'),\n  prompt: 'Hello, world!',\n});\n\n// Stream text\nconst { textStream } = await streamText({\n  model: lmstudio('your-model-name'),\n  prompt: 'Tell me a story',\n});\n\nfor await (const delta of textStream) {\n  process.stdout.write(delta);\n}\n```\n\n## Tool Calling Example\n\n```typescript\nimport { createLMStudio } from '@djosh34/lmstudio-ai-sdk-provider';\nimport { generateText, tool } from 'ai';\nimport { z } from 'zod';\n\nconst lmstudio = createLMStudio();\n\nconst { text } = await generateText({\n  model: lmstudio('your-model-name'),\n  prompt: 'Calculate 15 + 27',\n  tools: {\n    calculator: tool({\n      description: 'A calculator tool',\n      parameters: z.object({\n        a: z.number(),\n        b: z.number(),\n      }),\n      execute: async ({ a, b }) => a + b,\n    }),\n  },\n});\n```\n\n## Configuration\n\n```typescript\nimport { createLMStudio } from '@djosh34/lmstudio-ai-sdk-provider';\n\n// Custom LM Studio server\nconst lmstudio = createLMStudio({\n  // LM Studio connection settings go here\n  // See LM Studio TypeScript SDK docs for options\n});\n\n// Provider-specific options\nconst { text } = await generateText({\n  model: lmstudio('your-model-name'),\n  prompt: 'Hello!',\n  providerOptions: {\n    lmstudio: {\n      contextOverflowPolicy: 'stopAtLimit',\n      // Other LM Studio specific options\n    }\n  }\n});\n```\n\n## What Works\n\n- Text generation\n- Text streaming\n- Tool calling\n- Token usage tracking\n- Reasoning parsing (for supported models)\n- All LM Studio-specific features\n\n## What Doesn't Work\n\n- Image generation (LM Studio limitation)\n- Embeddings (use dedicated embedding models)\n\n## API Reference\n\n### `createLMStudio(settings?)`\n\nCreates an LM Studio provider instance.\n\n- `settings`: Optional LM Studio connection and model settings\n\n### Provider Methods\n\n- `lmstudio(modelId, settings?)` - Create a chat model\n- `lmstudio.chat(modelId, settings?)` - Alias for the above\n- `lmstudio.languageModel(modelId, settings?)` - Alias for the above\n\n## License\n\nApache-2.0","readmeFilename":"README.md"}