Use this file to discover Exa products, pricing, evaluations, comparisons, use cases, agent interfaces, and technical documentation before exploring further.
JavaScript LLM libraries send prompts to large language models and return their text, tool calls, and structured output to an application. A provider SDK calls one company's model API, while a toolkit wraps several providers behind one interface. These libraries connect the chat assistants, AI agents, and summarization features in web apps to the models behind them.
Popularity
Anthropic has the most monthly downloads in this comparison, at 261.6M.
async function chatNode(state: AgentState, config: RunnableConfig) {
const model = makeChatOpenAI(config, {
model: REASONING_MODEL,
useResponsesApi: true,
reasoning: { effort: "low", summary: "auto" },
// Token-level streaming of the OpenAI Responses API is buggy in // @langchain/openai@1.4.4: the reasoning-summary delta (index = // summary_index = 0) and the answer output_text delta (index = // content_index = 0) are pushed to the SAME content-block index, so the // streaming reducer collapses them into a single `type: "reasoning"` // block whose `text` field silently swallows the answer. @ag-ui/langgraph // then reads `content[0].type === "reasoning"` for every chunk and routes // the whole turn (answer included) to REASONING_MESSAGE_* events — no // assistant TEXT_MESSAGE ever renders, so the D6 reasoning-display probe // reds with `text-unstable`. The NON-streaming Responses converter // (`convertResponsesMessageToAIMessage`) processes final output *items* // (not indexed deltas) and correctly yields TWO separate blocks — a // `reasoning` block and a `text` block. Disabling token streaming forces // that correct path; the bridge then emits both a reasoning message and // the assistant answer, matching langgraph-python's rendering. disableStreaming: true,
});
const response = await model.invoke(
[new SystemMessage({ content: SYSTEM_PROMPT }), ...state.messages],
config,
);
return { messages: response };
}
Transformers.js
Runs pretrained Hugging Face models in the browser without a server.
Downloads / mo
19.1M
Stars
16.4K
Last release
4.3.2
License
Apache-2.0
Strengths
Mirrors the Python API.The same pretrained models run through an API close to the Python transformers library.
async function generate(messages) {
// Retrieve the text-generation pipeline. const [tokenizer, model] = await TextGenerationPipeline.getInstance();
const inputs = tokenizer.apply_chat_template(messages, {
add_generation_prompt: true,
return_dict: true,
});
let startTime;
let numTokens = 0;
let tps;
const token_callback_function = () => {
startTime ??= performance.now();
if (numTokens++ > 0) {
tps = (numTokens / (performance.now() - startTime)) * 1000;
}
};
const callback_function = (output) => {
self.postMessage({
status: "update",
output,
tps,
numTokens,
});
};
const streamer = new TextStreamer(tokenizer, {
skip_prompt: true,
skip_special_tokens: true,
callback_function,
token_callback_function,
});
// Tell the main thread we are starting self.postMessage({ status: "start" });
const { past_key_values, sequences } = await model.generate({
...inputs,
past_key_values: past_key_values_cache,
// Sampling do_sample: false,
max_new_tokens: 1024,
streamer,
stopping_criteria,
return_dict_in_generate: true,
});
past_key_values_cache = past_key_values;
const decoded = tokenizer.batch_decode(sequences, {
skip_special_tokens: true,
});
// Send the output back to the main thread self.postMessage({
status: "complete",
output: decoded,
});
}
FAQ
AI SDK is a provider-agnostic TypeScript toolkit for AI applications and agents in Next.js, React, Svelte, Vue, Angular, and Node.js. Its generateText and streamText functions generate or stream text from a supported model.
Anthropic is the official TypeScript library for the Claude API in server-side JavaScript and TypeScript. Its toolRunner invokes runnable tool helpers that the application registers.
Converse sends messages to an Amazon Bedrock model through one interface that works with every model that supports messages. @aws-sdk/client-bedrock-runtime calls it from Node.js, browsers, and React Native.
OpenAI parses a model response into data shaped by a supplied schema. Refusals and incomplete responses still need handling in application code.
AI SDK generates and streams text from many providers through one TypeScript interface. @langchain/openai connects OpenAI chat models to LangChain.js.
Transformers.js runs pretrained Hugging Face models directly in the browser without a server. Its API mirrors the Python transformers library.
For coding agents
Found your LLM library? Help your agent use it.
Connect Exa so your coding agent can find the library’s documentation, check its API, and look up implementations while you build.