Giter VIP home page Giter VIP logo

node-red-contrib-ollama's Introduction

Logo

node-red-contrib-ollama

Add AI functionality to your flows! This module includes a set of nodes that enable easy communication with Ollama, enriching your projects with intelligent solutions.

A Node-RED module that wraps the ollama.js library, offering its functionalities as configurable nodes for easy integration into flows.

Requirements

To use it, you need to have Node-RED installed on your system. For more information on how to install Node-RED, refer to the official Node-RED documentation.

Also you need to install the Ollama on the same system. For more information on how to install Ollama, refer to the official Ollama site.

Installation

To install the module, you can use the Node-RED editor or the Node-RED command-line tool.

Node-RED Editor

  1. Open the Node-RED editor.
  2. Click on the menu button in the top-right corner.
  3. Select "Manage palette".
  4. Go to the "Install" tab.
  5. Search for "node-red-contrib-ollama".
  6. Click on the "Install" button.

Node-RED Command-Line Tool

  1. Open a terminal.
  2. Run the following command:
npm install node-red-contrib-ollama

After installing the module, you need to restart Node-RED to apply the changes.

Usage

The module provides a set of nodes that can be used to interact with the ollama.js library. The nodes are:

  • Chat: Generate the next message in a chat with a provided model.
  • Copy: Copy a model. Creates a model with another name from an existing model.
  • Create: Create a model from a Modelfile.
  • Delete: Delete a model and its data.
  • Embeddings: Generate embeddings from a model.
  • Generate: Generate a response for a given prompt with a provided model.
  • List: List models that are available locally.
  • Pull: Download a model from the ollama library.
  • Push: Upload a model to a model library. Requires registering for ollama.ai and adding a public key first.
  • Show: Show information about a model including details, modelfile, template, parameters, license, and system prompt.

Each node has its own set of configuration options that can be used to customize its behavior. For more information on how to use each node, refer to the help text provided in the Node-RED editor.

License

This project is licensed under the MIT License - see the LICENSE file for details.

node-red-contrib-ollama's People

Contributors

jakubburkiewicz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

rottenjonny88

node-red-contrib-ollama's Issues

Feature request

Hi @jakubburkiewicz great work on this implementation for Ollama in NR!

However, i run Ollama on another device than my NR. Is it possible to add a config to use an external Ollama instance?

Thanks in advance!

XMLHttpRequest

Hi,

Great idea for a module thxs

I am getting a [error] [ollama-chat:Chat] ReferenceError: XMLHttpRequest is not defined error when trying to invoke a chat

Environment - In a docker instance

28 May 04:35:11 - [info] Node-RED version: v3.1.9
28 May 04:35:11 - [info] Node.js  version: v16.20.2
28 May 04:35:11 - [info] Linux 5.15.49-linuxkit-pr arm64 LE
28 May 04:35:11 - [info] Loading palette nodes
28 May 04:35:11 - [info] Settings file  : /data/settings.js
28 May 04:35:11 - [info] Context store  : 'default' [module=memory]
28 May 04:35:11 - [info] User directory : /data
28 May 04:35:11 - [warn] Projects disabled : editorTheme.projects.enabled=false
28 May 04:35:11 - [info] Flows file     : /data/flows.json
28 May 04:35:11 - [warn] 

A trivial chat invocation

msg.payload = {
    "host": "host.docker.internal:11434",
    "model": "llama3",
    "messages": [
            {
                "role": "user",
                "content": "What is your real name?"
            }
    ],
    "format" : "",
    "stream" : false,
    "keep_alive" : 10000,
    "options" : ""
}

Thxs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.