Favicon of Ollama JavaScript

Ollama JavaScript

JavaScript client for Ollama in Node.js and browsers. Connect to local models or Ollama's cloud with an open-source, MIT-licensed library.

Ollama JavaScript connects Node.js and browser applications to models running through Ollama. It's for developers building chat interfaces, AI agents or other apps that need a local LLM backend. The library is open source under the MIT license, with TypeScript types and an API that follows Ollama's REST interface.

Chat and text generation support streamed responses, so apps can display answers as they arrive. Developers can include images in prompts, request JSON output and use model tool calls. Thinking controls depend on the chosen model. The library also generates embeddings for search and retrieval features, and can cancel active response streams.

Model management is included: apps can download, inspect, copy and delete models, or create derivatives with custom prompts and LoRA adapters. A configurable server address lets the same client connect to Ollama on the user's machine or another server.

Local requests go to the chosen Ollama server. Cloud models, such as gpt-oss:120b, run on Ollama's infrastructure, either through a local Ollama connection or directly through its hosted API. Cloud access requires sign-in or an API key. The client also provides web search, which requires an Ollama account, and web page fetching.

For classification and scoring, System One works with compatible local models such as nimble. It returns structured answers for choice, probability and score questions in a single JSON response; it doesn't support cloud models or streaming.

Similar to Ollama JavaScript