# ollama/ollama-js

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/ollama-ollama-js).**

4,277 stars · 448 forks · TypeScript · MIT

## Links

- GitHub: https://github.com/ollama/ollama-js
- Homepage: https://ollama.com
- awesome-repositories: https://awesome-repositories.com/repository/ollama-ollama-js.md

## Topics

`javascript` `js` `ollama`

## Description

ollama-js is a JavaScript client library and API wrapper that provides a programmatic interface for interacting with and managing large language models. It enables the execution of models in both local and cloud-based environments, facilitating the generation of conversational text and the management of model lifecycles.

The project distinguishes itself by offering specialized tools for model administration, including the ability to download, create, and remove models, as well as the capacity to define custom model blueprints and prompt templates. It also provides a vector embedding client for generating numerical text representations to support semantic search and retrieval pipelines.

The library covers a broad range of capabilities including multimodal analysis for processing images, the capture of internal reasoning traces, and the enforcement of structured JSON schemas for data extraction. It further supports advanced model interaction through tool invocation and the streaming of responses via asynchronous generators.

The library is written in TypeScript.

## Tags

### Artificial Intelligence & ML

- [Large Language Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-model-integrations.md) — Provides a programmatic interface for the integration and configuration of large language models. ([source](https://docs.ollama.com/quickstart))
- [Local Model Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/local-model-integrations.md) — Connects JavaScript applications to private, locally-hosted Ollama language model services.
- [Model Lifecycle Managers](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-application-frameworks/local-on-device-ai/ollama-engine-integrations/model-lifecycle-managers.md) — Programmatically handles the downloading, updating, and execution of local LLM and embedding models.
- [LLM Tooling Integrations](https://awesome-repositories.com/f/artificial-intelligence-ml/artificial-intelligence-tooling/language-model-integrations/llm-tooling-integrations.md) — Provides connectors and interfaces that allow language models to access external data and execute software tools.
- [External LLM API Wrappers](https://awesome-repositories.com/f/artificial-intelligence-ml/external-llm-api-wrappers.md) — Provides a software layer that simplifies sending prompts and receiving streaming responses from LLMs.
- [GPU-Accelerated Inference](https://awesome-repositories.com/f/artificial-intelligence-ml/gpu-accelerated-inference.md) — Utilizes compatible graphics hardware to accelerate the execution speed of large language models. ([source](https://docs.ollama.com/gpu))
- [Conversational Response Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/language-model-response-generators/response-generation-configurations/conversational-response-generation.md) — Generates AI-driven responses for interactive dialogue, supporting streaming, tool calling, and visual inputs. ([source](https://docs.ollama.com/llms.txt))
- [Model Execution Controls](https://awesome-repositories.com/f/artificial-intelligence-ml/model-execution-controls.md) — Provides programmatic control to start, stop, and list currently running model instances. ([source](https://docs.ollama.com/cli))
- [Model Lifecycle Managers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-lifecycle-managers.md) — Provides tools for programmatically downloading, listing, and removing local machine learning models.
- [Model Response Streaming](https://awesome-repositories.com/f/artificial-intelligence-ml/model-response-parsers/model-response-aggregation/model-response-streaming.md) — Delivers language model outputs incrementally via async generators to improve interface responsiveness. ([source](https://cdn.jsdelivr.net/gh/ollama/ollama-js@main/README.md))
- [Text Response Streaming](https://awesome-repositories.com/f/artificial-intelligence-ml/multimodal-translation-models/streaming-translation-pipelines/text-response-streaming.md) — Provides incremental delivery of generated text and reasoning traces to the user interface in real time. ([source](https://docs.ollama.com/capabilities/streaming))
- [Text Generation](https://awesome-repositories.com/f/artificial-intelligence-ml/on-device-models/on-device-speech-to-text-sdks/text-generation.md) — Executes language models locally to produce conversational text based on message history. ([source](https://cdn.jsdelivr.net/gh/ollama/ollama-js@main/README.md))
- [Programmatic Model Invocation](https://awesome-repositories.com/f/artificial-intelligence-ml/programmatic-model-invocation.md) — Provides a programmatic API for calling models directly from code to receive text or embeddings. ([source](https://docs.ollama.com/))
- [Structured Data Extraction](https://awesome-repositories.com/f/artificial-intelligence-ml/structured-data-extraction.md) — Enforces and extracts structured JSON formats from model outputs for downstream data processing.
- [Vector Embeddings](https://awesome-repositories.com/f/artificial-intelligence-ml/vector-embeddings.md) — Provides a client for generating numerical text representations to power semantic search and retrieval pipelines. ([source](https://cdn.jsdelivr.net/gh/ollama/ollama-js@main/README.md))
- [Model Containerization](https://awesome-repositories.com/f/artificial-intelligence-ml/agent-deployment/containerized-deployments/model-containerization.md) — Enables running models inside containers with support for CPU and GPU acceleration. ([source](https://docs.ollama.com/docker))
- [AI Agent Development](https://awesome-repositories.com/f/artificial-intelligence-ml/ai-agent-development.md) — Provides a foundation for building autonomous coding agents and personal assistants that interact with tools.
- [Custom Model Definitions](https://awesome-repositories.com/f/artificial-intelligence-ml/custom-model-definitions.md) — Enables the definition of model blueprints using configuration files to specify base models and operational parameters. ([source](https://docs.ollama.com/modelfile))
- [Raw Text Completions](https://awesome-repositories.com/f/artificial-intelligence-ml/generative-ai-resources/generative-ai/raw-text-completions.md) — Offers interfaces for generating raw model completions without chat-specific formatting or system prompts. ([source](https://cdn.jsdelivr.net/gh/ollama/ollama-js@main/README.md))
- [Remote Model Connectivity](https://awesome-repositories.com/f/artificial-intelligence-ml/large-language-models/large-language-model-integration/remote-model-connectivity.md) — Implements the network layer for connecting to remote large language models via API keys. ([source](https://docs.ollama.com/cloud))
- [Multimodal AI Applications](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/multimodal-processing-tools/multimodal-ai-applications.md) — Integrates vision-capable models to analyze images and describe visual content within applications.
- [Model Adapters](https://awesome-repositories.com/f/artificial-intelligence-ml/model-adapters.md) — Integrates LoRA adapters into base models to specialize performance for specific domains. ([source](https://docs.ollama.com/modelfile))
- [Parallel Function Calling](https://awesome-repositories.com/f/artificial-intelligence-ml/model-execution-interfaces/function-calling-interfaces/parallel-function-calling.md) — Enables models to trigger multiple independent external tool invocations within a single response. ([source](https://docs.ollama.com/capabilities/tool-calling))
- [Model Parameter Configurations](https://awesome-repositories.com/f/artificial-intelligence-ml/model-parameter-configurations.md) — Sets execution variables such as temperature and stop sequences to control the behavior of generated text. ([source](https://docs.ollama.com/modelfile))
- [Schema Enforcement Layers](https://awesome-repositories.com/f/artificial-intelligence-ml/model-response-parsers/schema-enforcement-layers.md) — Implements mechanisms to force model outputs to adhere to specific JSON schemas for consistent data extraction. ([source](https://docs.ollama.com/capabilities/structured-outputs))
- [Model Weight Management](https://awesome-repositories.com/f/artificial-intelligence-ml/model-weight-management.md) — Integrates external model weights in GGUF or Safetensors formats and fine-tuned adapters for local execution. ([source](https://docs.ollama.com/import))
- [Prompt Templates](https://awesome-repositories.com/f/artificial-intelligence-ml/prompt-templates.md) — Allows the definition of reusable prompt structures, including the placement of system messages and user inputs. ([source](https://docs.ollama.com/modelfile))
- [Weight Quantization](https://awesome-repositories.com/f/artificial-intelligence-ml/quantized-inference-runtimes/weight-quantization.md) — Supports reducing the precision of model weights to lower memory usage and increase inference speed. ([source](https://docs.ollama.com/import))
- [Reasoning Capture Utilities](https://awesome-repositories.com/f/artificial-intelligence-ml/reasoning-models/reasoning-capture-utilities.md) — Extracts and visualizes intermediate thought processes and reasoning steps from reasoning-capable models. ([source](https://docs.ollama.com/capabilities/thinking))
- [Reasoning Trace Streaming](https://awesome-repositories.com/f/artificial-intelligence-ml/reasoning-workflows/reasoning-trace-streaming.md) — Streams reasoning tokens incrementally before the final response to show task progress in real time. ([source](https://docs.ollama.com/capabilities/thinking))
- [Remote Model Execution](https://awesome-repositories.com/f/artificial-intelligence-ml/remote-model-execution.md) — Allows model execution to be offloaded to remote services for models exceeding local hardware capacity. ([source](https://docs.ollama.com/cloud))
- [Text Embedding Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/text-embedding-generators.md) — Provides utilities for transforming text into vector representations for use in semantic search and memory systems. ([source](https://docs.ollama.com/capabilities/embeddings))
- [Tokenizer Context Configurations](https://awesome-repositories.com/f/artificial-intelligence-ml/tokenizer-context-configurations.md) — Provides settings for managing the maximum sequence length and token limits to optimize hardware resources. ([source](https://docs.ollama.com/context-length))
- [Token Stream Generators](https://awesome-repositories.com/f/artificial-intelligence-ml/video-generation/streaming-generation/token-stream-generators.md) — Uses generator interfaces to output each token immediately for real-time incremental display of text and reasoning.

### Data & Databases

- [Schema-Adherent Generation](https://awesome-repositories.com/f/data-databases/json-schema-modeling/schema-adherent-generation.md) — Ensures generated model outputs strictly follow a specific JSON schema for consistent data extraction.
- [Semantic Search](https://awesome-repositories.com/f/data-databases/semantic-search.md) — Generates text embeddings to enable vector similarity search and retrieval pipelines.

### Development Tools & Productivity

- [Ollama API Clients](https://awesome-repositories.com/f/development-tools-productivity/rest-apis/rest-api-clients/ollama-api-clients.md) — A JavaScript client implementation for communicating with local Ollama instances via their REST API.

### Part of an Awesome List

- [Visual Question Answering Libraries](https://awesome-repositories.com/f/awesome-lists/ai/image-captioning/visual-question-answering-libraries.md) — Integrates multimodal models to generate natural-language descriptions and answer specific questions about image content. ([source](https://docs.ollama.com/capabilities/vision))

### Operating Systems & Systems Programming

- [Native Windows Execution](https://awesome-repositories.com/f/operating-systems-systems-programming/native-windows-execution.md) — Executes models as native processes on Windows with hardware acceleration for NVIDIA and AMD GPUs. ([source](https://docs.ollama.com/windows))
