Back to stack index

Language

JavaScript

Baseline for web clients and Node services.

Short answer

JavaScript is the language of the web browser and, through Node.js, of many servers. Every AI chat interface runs JavaScript in the browser, and some major open-source AI projects are written mainly in plain JavaScript rather than TypeScript, including LibreChat, AnythingLLM and the Ghost publishing platform. The language is defined by the ECMAScript standard; its 17th edition, ECMAScript 2026, was approved by Ecma International on June 30, 2026. JavaScript has no license fee and runs in any browser, Node.js, Bun or Deno. For AI work it covers streaming model replies to the screen, calling model APIs from servers, building desktop apps with Electron, and even running small models in the browser with WebGPU through libraries such as Transformers.js and WebLLM. Most new projects choose TypeScript, which compiles to JavaScript, but plain JavaScript codebases remain common and easy to contribute to.

Current standard
ECMAScript 2026, approved June 30, 2026
Ecma International
Directory projects in JS
LibreChat, AnythingLLM, Ghost
Project repositories
Browser AI
Transformers.js, WebLLM on WebGPU
Project docs
Server runtimes
Node.js, Bun, Deno
Runtime docs

Updated October 21, 2026How we evaluate tools

Official site

Directory projects (3)

  • LibreChat

    Multi-model chat UI with plugins, agents, and self-hosted deployment.

  • AnythingLLM

    Document chat and workspaces with optional vector DB and multi-user mode.

  • Ghost

    Ghost manages structured site content with APIs and themes you can version in Git.

JavaScript in open-source AI tools: LibreChat, AnythingLLM and the web layer of AI in 2026

JavaScript's place in AI

Every web-based AI product runs JavaScript in the browser: the text box, the streaming reply, the file upload, the voice button. On the server, Node.js made JavaScript a common choice for API servers, and many AI app back ends do little more than accept a request, call a model API, store the conversation and stream the reply back, work that suits JavaScript's event-driven design.

Since about 2020 most new large JavaScript projects have adopted TypeScript. But several of the most popular self-hosted AI apps began in plain JavaScript and stayed there, adding TypeScript gradually or not at all.

Which directory projects use it

ProjectWhat it isStack
LibreChatSelf-hosted multi-provider chat with agentsNode.js and Express API, React client, MongoDB, Meilisearch
AnythingLLMDocument chat and agents, desktop and serverNode.js server, React front end built with Vite, Electron desktop app
GhostPublishing and newsletter platformNode.js server, admin apps, MySQL

LibreChat is the clearest example. It supports OpenAI, Anthropic, Google, Bedrock, Azure and any OpenAI-compatible endpoint, has agents, MCP support, code execution and file search, and is one of the most starred self-hosted chat apps, all on a JavaScript server. AnythingLLM ships the same JavaScript code as a Docker server and an Electron desktop app, which is why it installs on Windows, macOS and Linux with one download.

Ghost is not an AI tool, but it is in our directory because many AI-focused publishers and newsletter writers run it, and it supports integrations that bring AI writing and translation tools into the editor.

ECMAScript 2026

JavaScript is standardized as ECMAScript by Ecma International's TC39 committee, which publishes a new edition each June. ECMAScript 2026, the 17th edition of ECMA-262, was approved on June 30, 2026. Features reach the standard after browsers and runtimes have shipped them, so by the time an edition is approved its contents are usually available already. Additions finalized for the 2026 edition include Error.isError for reliable error checks across frames and workers, Math.sumPrecise for accurate floating-point sums, and built-in base64 and hex conversion for Uint8Array, which is handy when moving audio or image data to and from model APIs.

Streaming replies in JavaScript

The defining interaction of a chat app is text appearing word by word. Model APIs send replies as server-sent events, and JavaScript handles them natively: the server reads the provider's stream and forwards chunks to the browser over its own SSE or WebSocket connection, and the browser appends each chunk to the message. The fetch API with ReadableStream makes this a few lines of code in modern browsers and in Node.js. The official OpenAI and Anthropic JavaScript SDKs return async iterators, so a for await loop over the stream is all a server needs.

Running models in the browser

Two libraries make in-browser AI practical:

LibraryMaintainerWhat it runs
Transformers.jsHugging FaceEmbeddings, classification, speech recognition, translation, small language models via ONNX Runtime
WebLLMMLC AILanguage models compiled for WebGPU, with an OpenAI-style API

Both use WebGPU, the browser's modern GPU interface, which is available in Chrome and Edge and has shipped in Safari. A web app can embed documents, transcribe speech or answer simple questions entirely on the user's device. The trade-offs are download size, since the model must be fetched on first use and then cached, and capability, since models small enough for a browser trail hosted models by a wide margin. Typical uses are private search over notes, offline transcription, and fallback answers when the network is unavailable.

Desktop apps with Electron

Electron packages a JavaScript web app with Chromium and Node.js into a desktop app. AnythingLLM and Cherry Studio use it to offer native installers on every platform, with access to local files and local model servers such as Ollama. The cost is size, often 150 MB or more per install, and memory use. Tauri, which uses the system's web view and a Rust back end, is a lighter alternative some projects have moved to.

Browser extensions

Many AI tools reach users as browser extensions written in JavaScript: sidebars that summarize the current page, writing helpers inside text fields, and agents that click through websites. Chrome's built-in AI APIs, which run Google's Gemini Nano model on the device for summarization, translation and writing help, add on-device features to extensions and web pages without a server.

What it means for self-hosting

  • Node.js version. JavaScript servers require a supported Node.js release. LibreChat and AnythingLLM document the version they test on; Docker images bundle it.
  • Databases. LibreChat needs MongoDB, which its Docker Compose file includes. AnythingLLM uses SQLite by default and can switch to Postgres. Ghost uses MySQL in production.
  • Memory. A Node.js chat server uses a few hundred megabytes at idle and more under load. Document processing in AnythingLLM can spike memory with large PDFs.
  • Updates. Pull new images, read the changelog for database migrations, back up the database first.

Contributing to JavaScript projects

Plain JavaScript codebases are approachable: no build-time type errors to fight, and changes can be tested by restarting the server. That cuts both ways, since bugs that a type checker would catch reach runtime. Projects such as LibreChat add JSDoc comments and gradual TypeScript to get some safety without a full rewrite. Read the contributing guide, run the linter and tests, and match the existing style.

JavaScript, TypeScript or Python

SituationSensible choice
Small AI app, solo developer, fast iterationJavaScript or TypeScript
Large team product with many contributorsTypeScript
Heavy retrieval, evaluation or fine-tuningPython service alongside a JS or TS front end
On-device AI in a web pageJavaScript with Transformers.js or WebLLM

Server runtimes: Node.js, Bun and Deno

Most JavaScript AI servers run on Node.js, the oldest and most compatible runtime. Bun, a faster runtime with a built-in package manager, test runner and bundler, has gained users among AI app developers for its quick installs and startup; Anthropic acquired Bun in December 2025 and uses it to ship Claude Code. Deno, from Node's original author, runs TypeScript directly, uses a permission system that blocks file and network access unless granted, and powers Deno Deploy. LibreChat, AnythingLLM and Ghost all target Node.js, so use Node.js for self-hosting unless a project documents another runtime.

Calling model APIs from JavaScript

The official OpenAI, Anthropic and Google SDKs all have JavaScript packages that work in Node.js, Bun and Deno. For apps that switch between providers, the Vercel AI SDK and LangChain.js offer one interface across dozens of models, with helpers for tool calls, structured output validated by Zod schemas, and streaming to React components. Self-hosted gateways such as LiteLLM expose an OpenAI-compatible endpoint, so a JavaScript app can use the OpenAI SDK and point it at the gateway to reach any model.

Security notes

JavaScript apps depend on large numbers of npm packages, and npm has seen repeated malicious package campaigns, including worm-style attacks in 2025 that stole tokens and republished infected versions of popular packages. Self-hosters are mostly protected by using official images, but anyone building from source should use lock files, avoid running install scripts from unknown packages, and watch advisories. Browser-side code should never contain model API keys; keep them on the server.

Related: TypeScript stack, Node.js stack, React stack, Electron stack, LibreChat, Stack index.

Frequently asked questions

Is JavaScript used for AI?

Yes, mostly for the product layer: chat interfaces, servers that call model APIs, browser extensions and desktop apps. Libraries such as Transformers.js and WebLLM also run small models directly in the browser. Training and research use Python.

What is the difference between JavaScript and TypeScript?

TypeScript is JavaScript plus a type system that is checked at build time and then removed. Every JavaScript program is valid TypeScript. Large projects use TypeScript to catch errors earlier; smaller or older projects often stay in JavaScript for simplicity.

Can AI models run in the browser?

Small ones can. With WebGPU, available in Chrome, Edge and Safari, libraries such as WebLLM run language models of a few billion parameters on the user's GPU, and Transformers.js runs embeddings, speech recognition and classification models. Nothing is sent to a server, but the first load downloads the model, often hundreds of megabytes or more.

What stack does LibreChat use?

LibreChat uses MongoDB, Express, React and Node.js, often called the MERN stack, mostly in JavaScript with growing TypeScript use. It also uses Meilisearch for searching conversations and supports Redis for scaling.

Is ECMAScript 2026 supported in Node.js?

Most features are supported in current Node.js releases as V8 implements them, usually before the standard is formally approved. Check the Node.js release notes or a compatibility table for a specific feature.

Sources

  1. ECMA-262 specification
  2. LibreChat on GitHub
  3. AnythingLLM on GitHub
  4. Transformers.js