llm-connect weekly downloads statistics
Connect a web app to any LLM provider through the AI SDK: provider registry, model creation, connection test, a settings store and speech-to-text (provider models, or NVIDIA Parakeet, Canary and Whisper in the page), with a React adapter
llm-connect has 1,237 recorded weekly downloads on npm, ranking #1524 of 2,667 tracked listings.
About llm-connect
llm-connect
Let the users of a web app bring their own LLM: pick a provider and a model from a catalog, paste a key (or point at Ollama / LM Studio), test the connection, save, then call the model through the AI SDK straight from the browser.
- Framework-free core: provider registry,
createModel/loadModel,testConnection, and a settings store you can drive from any UI.llm-connect/reactbinds it to React; Svelte reads it as a store. - Five providers built in: OpenAI, Anthropic (and Anthropic-compatible APIs), Google, Mistral,
and every provider of the generic
@ai-sdk/openai-compatibleSDK (DeepSeek, Z.ai, Groq…). Each SDK loads only when used. - The catalog comes from llm-models, built live in the browser
(
liveCatalog) with a staticmodels.jsonas fallback, and a recommended model per provider. - The key never sits in clear text:
secureStorageencrypts it with AES-GCM under a non-extractable key,createKeyVaultkeeps the keys of several providers behind a passphrase, and a custom endpoint must be https (plain http only on this machine). - Each provider's request rules: reasoning effort per provider and model, what each model accepts (sampling, prefill, tools, web search), Claude's adaptive thinking, stateless OpenAI Responses calls, headers that pass a browser's CORS preflight, and errors classified without the key.
- Speech to text:
transcribewith the provider's own transcription model (OpenAI, Gemini, Mistral, Groq), or on the device with NVIDIA Parakeet or Canary (llm-connect/nemo) or Whisper (llm-connect/whisper), all in one shape and timed to the word.
Install
npm install llm-connect llm-models ai @ai-sdk/openai @ai-sdk/anthropic @ai-sdk/google @ai-sdk/mistral @ai-sdk/openai-compatible
ai (v7), the @ai-sdk/* packages (v4) and @ai-sdk/openai-compatible (v3) are optional peers:
install the ones your users can pick.
react (18+) is only needed for llm-connect/react.
The store builds the catalog in the browser when settings open (see The catalog). Write the fallback at build time:
npx llm-models catalog --npm callable --require openai,anthropic,google,mistral --out public/models.json
Call a model
import { generateText } from "ai";
import { loadModel } from "llm-connect";
const model = await loadModel(settings); // imports @ai-sdk/anthropic on first use
const { text } = await generateText({ model, prompt: "Hello" });
settings is what the store saves (LlmSettings):
| Field | |
|---|---|
apiKey, model | The key and the catalog model id |
providerId, providerName, providerNpm, providerApi | The catalog provider: its SDK package and base URL |
customEndpoint, customModel | An OpenAI-compatible server (Ollama, LM Studio, vLLM…); wins over the provider |
headers | Extra request headers |
language | Code of the language answers are written in ("fr") |
Both take options as a second argument:
| Option | Default | |
|---|---|---|
fetch | globalThis.fetch | The fetch every request of the model goes through: route them through your own wrapper (logging, a proxy, a network policy) |
strictHeaders | false | Send only the headers the provider's API defines (plus content-type and accept); the settings' headers are dropped |
createModel(settings) does the same synchronously, for providers you registered yourself:
import { createModel, registerProvider, fromSDK } from "llm-connect";
import { register as registerAnthropic } from "llm-connect/providers/anthropic";
import { createOpenAI } from "@ai-sdk/openai";
registerAnthropic(); // or "llm-connect/providers/all" for the five
registerProvider("openai", fromSDK(createOpenAI));
registerProvider("my-llm", (config) => myLanguageModel(config.apiKey, config.model));
The registry is shared by every copy of llm-connect loaded in the page, so a library and the app that resolve different installs still see the same providers.
What the built-in providers take care of:
- A custom endpoint goes through the OpenAI SDK with Chat Completions; the official OpenAI URL keeps the Responses API.
- Every request goes through
guardedFetch, which removes theuser-agentheader the AI SDK adds (no provider's CORS preflight allows it, and Firefox sends it). - Anthropic's own API gets the
anthropic-dangerous-direct-browser-accessheader. An Anthropic-compatible provider (MiniMax…) gets its own base URL, so its key never goes to Anthropic, and not that header, which its preflight does not allow. Its base URL works with or without the trailing/v1(anthropicBaseUrl): gateways document it without, for Anthropic's own clients, as Z.ai does withhttps://api.z.ai/api/anthropic. - A gateway that answers an error with HTTP 200 and a JSON body (Z.ai:
{"code":500,"msg":"404 NOT_FOUND","success":false}) gets the status the body stands for (maskedErrorStatus), so the call fails with the provider's message instead of a parse error or a stream that ends without a finish. - The generic SDK refuses a provider without URL, asks for the usage chunk at the end of a stream
(
stream_options.include_usage), and turns structured output (json_schema) intojson_objectplus the schema in a system message, for APIs such as GLM.
guardedFetch(kind, { fetch, strictHeaders }) is exported for providers you register yourself:
pass it as their fetch.
Call options
What a call may carry depends on the provider and the model. callOptions builds the provider
options for the model the settings point to, to spread into streamText or generateText:
import { streamText } from "ai";
import { callOptions, callProblem, loadModel, resolveCapabilities, providerKindOf } from "llm-connect";…
Description from the npm listing.
- llm
- ai
- ai-sdk
- byok
- openai
- anthropic
- ollama
- lm-studio
- react
- svelte
- browser
- transcription
- speech-to-text
- whisper
- parakeet
- canary
- nvidia
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (1)Similar npm AI SDKs plugins
All 20 llm-connect alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/llm-connect. First seen Oct 29, 2026; last successful collection Oct 29, 2026. See the methodology.