API Reference
vue-llm
Composables
| Export | Description |
|---|---|
useChat(options) | Streaming multi-turn chat |
useCompletion(options) | Streaming single-turn completion |
useObject(options) | Streaming structured JSON output |
usePrompt(template, variables) | Reactive prompt rendering |
Chat UI (headless)
| Export | Description |
|---|---|
usePromptInput(chat, options?) | Enter to send, IME-safe, auto-growing textarea, attachments from picker, paste and drop |
useAutoScroll(options?) | Stick to the bottom while streaming, unpin when the user scrolls up |
Middleware
| Export | Description |
|---|---|
wrapProvider(provider, middlewares) | Apply middleware to a provider |
loggingMiddleware(label?) | Console logging |
headerMiddleware(headers) | Extra HTTP headers |
retryMiddleware(options?) | Retries with exponential backoff |
rateLimitMiddleware(options) | Client-side request queue |
isRetryableError(error) | Default retry policy |
Utilities
| Export | Description |
|---|---|
createPrompt(template, options?) | Typed prompt template |
createChatPrompt(messages, options?) | Multi-message template |
renderTemplate(template, variables) | Untyped one-off rendering |
createWebStorage(options?) | localStorage/sessionStorage adapter |
createMemoryStorage() | In-memory adapter |
fileToDataURL(blob) | Read a Blob as a data URL |
convertFilesToParts(files) | Files → FilePart[] |
LLMAPIError | HTTP error class |
defineTool(tool) | Typed tool with optional execute |
parsePartialJSON(text) | Parse incomplete JSON while it streams |
Types
UIMessage, UIMessagePart, TextPart, ReasoningPart, ToolCallPart, FilePart, SourcePart, ToolDefinition, ChatTool, ToolCallState, ToolExecutionContext, ToolComponentProps, DeepPartial, ChatStatus, FinishReason, Usage, LLMProvider, ChatRequest, ChatMessage, ContentPart, ChatStreamResult, ChatStreamChunk, ChatResponse, Middleware, ChatHandler, RetryOptions, RateLimitOptions, ChatStorage, WebStorageOptions, FileInput, SendMessageInput, PromptTemplate, ChatPromptTemplate, ChatPromptMessage, PromptOptions, PromptInput, PromptValue, PromptVariables, PromptVariableNames, plus each composable's Use*Options / Use*Return.
vue-llm/providers
createOpenAI, createAnthropic, createGoogle, createOllama, createSSEProvider, createWebLLM, isWebGPUSupported.
vue-llm/server
createLLMHandler (with server tools), createProxyProvider, streamToSSE.
vue-llm/devtools
LLMDevtools: Vue DevTools plugin (requires @vue/devtools-api).
vue-llm/style.css
Styles for the components.
vue-llm/nuxt
vue-llm/components
MessageParts, StreamMarkdown, renderMarkdown, renderInline, escapeHTML.