llm-exe
A TypeScript and JavaScript library of small, composable building blocks for LLM-powered functions, including prompt templates, output parsers, conversation state and provider-agnostic calls across OpenAI, Anthropic, xAI, Google, AWS Bedrock, Ollama and DeepSeek.
llm-exe provides simplified base components for building and maintaining LLM-powered applications in JavaScript or TypeScript. It lets a developer write a function powered by an LLM using small, composable building blocks rather than a heavier framework, with full type inference in TypeScript and plain JavaScript support through CommonJS or ESM.
It includes prompt helpers with Handlebars-style templating for both text and chat-based prompts, built-in and custom output parsers to validate and structure a model's response, a state object for managing conversation history and structured data across calls, and hooks such as onSuccess and onError for observing execution. Providers can be swapped without changing calling code, across OpenAI, Anthropic, xAI, Google, AWS Bedrock, Ollama and DeepSeek, and executors can call other LLM executors as functions.
It installs from npm and is not tied to any particular usage pattern, leaving control over prompts, parsing and execution to the developer.