Package Exports
- @cianfrani/lmstudio
- @cianfrani/lmstudio/dist/index.js
- @cianfrani/lmstudio/dist/index.mjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@cianfrani/lmstudio) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@cianfrani/lm-studio
LM Studio provider for the AI SDK.
Installation
npm install @cianfrani/lmstudioUsage
Chat API
import { lmstudio } from '@cianfrani/lmstudio';
import { generateText } from 'ai';
const { text } = await generateText({
model: lmstudio('qwen2.5-7b-instruct'),
prompt: 'Hello, how are you?',
});Responses API (Beta)
The responses API provides access to reasoning traces and structured outputs from models that support reasoning.
Installation
npm install @cianfrani/lmstudio@responsesUsage
import { lmstudio } from '@cianfrani/lmstudio';
import { generateText } from 'ai';
const { text } = await generateText({
model: lmstudio('gpt-oss', { api: 'responses', reasoningEffort: 'medium' }),
prompt: 'Solve this complex problem...',
});API
createLMStudio(options?)
Creates an LM Studio provider instance.
Options
baseURL?: string- Base URL for LM Studio API. Defaults tohttp://localhost:1234/v1.apiKey?: string- API key for authentication. LM Studio typically doesn't require this.headers?: Record<string, string>- Custom headers to include in requests.fetch?: FetchFunction- Custom fetch function.api?: 'chat' | 'responses'- API to use. Defaults to'chat'. (Responses API requires beta version)reasoningEffort?: 'low' | 'medium' | 'high'- Reasoning effort for responses API.
lmstudio
Default LM Studio provider instance.
lmstudio(modelId, settings?)
Creates a chat model instance.
lmstudio.textEmbeddingModel(modelId, settings?)
Creates an embedding model instance.
Model IDs
Chat Models
qwen2.5-7b-instructgpt-oss- Any other model ID supported by LM Studio
Embedding Models
text-embedding-nomic-embed-text-v1.5all-MiniLM-L6-v2- Any other embedding model supported by LM Studio
License
MIT