npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ollama-create

v0.0.3

Published

NodeJS script to add models to ollama without duplication.

Downloads

72

Readme

Ollama Create NodeJS

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

Introduction

NodeJS CLI script which 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-create

Usage

Usage: ollama-create [OPTIONS] [MODEL...]

Create a new Ollama model based on a base model from the Ollama registry.
MODEL can be a local GGUF file or the name of a model in the Ollama registry.

All specified files will be symlinked to Ollama to avoid duplication.
If a file is supplied which doesn't exist, it will be created from the base model in the specified location.
To remove a setting from the base model, use --no-<option>.

OPTIONS:
  -f, --from <from>           Defines the base model from the Ollama registry to use.
                              Defaults to the model architecture from the GGUF metadata.
  -n, --name <name>           Set the name for the new model.
                              Defaults to <name>-<size>-<finetune>-<version> from the GGUF metadata
                              or the base model name if no model file is specified.
  -d, --dir <dir>             Download all base model files to the specified directory and create symlinks for Ollama.

  -p, --params <json file>    Specify a JSON file containing parameters for Ollama.
  -m, --messages <json file>  Provide a JSON file containing the message history.
  -t, --template <txt file>   Define a file containing the full prompt template.
  -s, --system <txt file>     Specify a file containing the system message.
  -a, --adapter <gguf file>   Apply (Q)LoRA adapters to the model.
  -j, --projector <gguf file> Define multimodal projectors.
  -l, --license <txt file>    Specify a file containing the legal license.

  -g, --show                  Print the GGUF metadata of the model.
  -h, --help                  Display this help and exit.

Example

Download a model from the Ollama Registry

ollama-create gemma2

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

Use existing GGUF model file

ollama-create --from llama3.1 my-model.gguf

This will use the local my-model.gguf file and configure it in Ollama by creating a symlink. The Ollama metadata (template, params etc.) is taken from the Llama 3.1 model.

If my-model.gguf doesn't exist, the llama3.1 model will be downloaded and saved as my-model.gguf.

Use custom template

ollama-create --template my-template.txt gemma2

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

If my-template.txt doesn't exist, the template from the Gemma 2 model will be downloaded and saved as my-template.txt.

Remove parameters

ollama-create --no-params gemma2

This will download the Gemma 2 model but removes all parameter instructions.

Save all model files in custom location

ollama-create --dir ./models/gemma gemma2

This will download the Gemma 2 model and save all Ollama artifacts to the ./models/gemma/ directory. Symlinks in the Ollama blob store are created for all files.

Print GGUF metadata

ollama-create --metadata my-model.gguf

Prints the GGUF metadata of the model file as JSON.