ollama/ollama-js
Ollama JavaScript library
What it solves
It provides a dedicated JavaScript library that simplifies the process of integrating JavaScript applications with Ollama, removing the need to manually construct raw HTTP requests to the Ollama REST API.
How it works
The library acts as a wrapper around the Ollama REST API, offering a set of asynchronous functions to interact with local or cloud-hosted models. It supports both Node.js and browser environments (via a specific browser module) and allows for custom client configurations, including custom hosts and headers.
Who it’s for
Developers building JavaScript or TypeScript applications who want to incorporate LLM capabilities—such as chatting, text generation, and embeddings—using Ollama.
Highlights
- Flexible Deployment: Supports local Ollama instances, Ollama's cloud models, and direct Cloud API access.
- Streaming Support: Enables real-time response streaming using
AsyncGenerator. - Comprehensive Model Management: Includes methods to pull, push, create, copy, and delete models.
- Advanced Capabilities: Supports multimodal inputs (images), tool calling, and specialized "System One" structured evaluation (choice, score, and boolean).
- Utility Tools: Built-in functions for web search, web fetching, and generating embeddings.
Related
- Project
- Project
- Project
- Project