New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ollama-model-generator

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ollama-model-generator

NodeJS script to add models to ollama without duplication.

  • 0.0.2
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Ollama Model Generator

GitHub License GitHub Last Commit NPM Package Version NPM Package Size NodeJS Version

Introduction

This NodeJS CLI script simplifies adding GGUF models to Ollama by creating symlinks and downloading necessary metadata from the Ollama Registry.

Benefits:

  • Avoids model duplication within Ollama.
  • Easy integration of GGUF models.
  • No dependencies besides NodeJS.

Installation

Requires NodeJS version 18.11.0 or higher. Install it globally using npm:

npm install -g ollama-model-generator

Usage

ollama-model-generator [options]

  Options:
    --model <path>            Path to the GGUF model file. This will be symlinked to Ollama blob storage.
                              If the file doesn't exist, it will be downloaded from the Ollama Registry based on --from.
                              Optional. If not provided, the model will be downloaded to the Ollama blob storage.
  
    --from, -f <name>         Model name in the Ollama Registry to download as a base.
                              Default: architecture of the GGUF model.
                              
    --name, -n <name>         Name of the new model in Ollama.
                              Default: basename-size-finetune-version of the GGUF model.
                              If --model is not provided, it defaults to the name from --from.
                              
    --show, -s                Prints model metadata from the GGUF file header as JSON (requires --model).
    
    --registry, -r <registry> The Ollama Registry URL.
                              Default: registry.ollama.ai
    
    --dir, -d <path>          Directory for storing Ollama model data.
                              Default: $OLLAMA_MODELS or ~/.ollama/models

Additional files can be symlinked in the same way as --model ( see Ollama Model File):

--adapter, --embed, --license, --messages, --params, --projector, --prompt, --system, --template

Example

Download a model from the Ollama Registry

ollama-model-generator --from gemma2

This will download the Gemma 2 model from the Ollama Registry and configure it in Ollama (same as ollama pull gemma2).

Use a local GGUF model

ollama-model-generator --from llama3.1 --model my-model.gguf --name LLama3.1-MyModel

This will use the local my-model.gguf file and configure it in Ollama with the name LLama3.1-MyModel. The Ollama metadata (template, params etc.) is taken from the Llama 3.1 model.

Use custom template

ollama-model-generator --from gemma2 --template my-template.txt

This will download the Gemma 2 model but use the local my-template.txt file as prompt template.

Print GGUF metadata

ollama-model-generator --show --model my-model.gguf

Prints the GGUF metadata of the model file as JSON.

FAQs

Package last updated on 04 Sep 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc