From ccc0ed17b9255de3dffbf66e6e90995f111c4129 Mon Sep 17 00:00:00 2001 From: Tod Hansmann Date: Fri, 27 Oct 2023 11:25:38 -0600 Subject: [PATCH] feat: add ollama (LLM, like ChatGPT) --- ollama/README.md | 22 ++++++++++++++++++++++ ollama/install.ps1 | 6 ++++++ ollama/install.sh | 22 ++++++++++++++++++++++ ollama/releases.js | 22 ++++++++++++++++++++++ 4 files changed, 72 insertions(+) create mode 100644 ollama/README.md create mode 100644 ollama/install.ps1 create mode 100644 ollama/install.sh create mode 100644 ollama/releases.js diff --git a/ollama/README.md b/ollama/README.md new file mode 100644 index 0000000..5185507 --- /dev/null +++ b/ollama/README.md @@ -0,0 +1,22 @@ +--- +title: ollama +homepage: https://github.com/jmorganca/ollama +tagline: | + ollama is a golang LLM server built for ease of use. +--- + +To update or switch versions, run `webi ollama@stable` (or `@v0.1.5`, etc). + +## Cheat Sheet + +> `ollama` is an LLM serving platform written in golang. It makes LLMs built on +> Llama standards easy to run with an API. + +To get started quickly with the open source LLM Mistral-7b as an example is two +commands. + +`ollama serve` + +Then in a separate terminal: + +`ollama run mistral` diff --git a/ollama/install.ps1 b/ollama/install.ps1 new file mode 100644 index 0000000..69d7f25 --- /dev/null +++ b/ollama/install.ps1 @@ -0,0 +1,6 @@ +#!/usr/bin/env pwsh + +Write-Host "Error: ollama doesn't have Windows support yet:" +Write-Host "See https://github.com/jmorganca/ollama/issues/403" +exit 1 + diff --git a/ollama/install.sh b/ollama/install.sh new file mode 100644 index 0000000..402822e --- /dev/null +++ b/ollama/install.sh @@ -0,0 +1,22 @@ +#!/bin/sh +set -e +set -u + +__init_ollama() { + + ############## + # Install ollama # + ############## + + WEBI_SINGLE=true + + pkg_get_current_version() { + # 'ollama --version' has output in this format: + # ollama version 0.1.3 + # This trims it down to just the version number: + # 0.1.3 + ollama --version 2> /dev/null | head -n 1 | sed 's:^ollama version ::' + } +} + +__init_ollama diff --git a/ollama/releases.js b/ollama/releases.js new file mode 100644 index 0000000..019b9ed --- /dev/null +++ b/ollama/releases.js @@ -0,0 +1,22 @@ +'use strict'; + +var github = require('../_common/github.js'); +var owner = 'jmorganca'; +var repo = 'ollama'; + +module.exports = function (request) { + return github(request, owner, repo).then(function (all) { + all.releases.forEach(function (rel) { + rel.version = String(rel.version).replace(/^v/, ''); + }); + return all; + }); +}; + +if (module === require.main) { + module.exports(require('@root/request')).then(function (all) { + all = require('../_webi/normalize.js')(all); + console.info(JSON.stringify(all)); + //console.info(JSON.stringify(all, null, 2)); + }); +}