simonw / simonw/llm

Add an ollama plugin

Open
#183 1 comment 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
12.5k
Forks
991
Avg merge
3d 13h
Merged PRs (30d)
10

Description

Ollama makes it easy to run models such as llama2 locally on macOS easily:

https://ollama.ai/

The user runs a server on localhost, so the architecture of the plugin could likely follow the existing replicate plugin.

from the ollama docs:

 curl -X POST http://localhost:11434/api/generate -d '{
    "model": "llama2",
    "prompt":"Why is the sky blue?"
   }'

the output is quite straightforward and amenable to streaming:

{"model":"llama2","created_at":"2023-08-24T20:24:05.78795Z","response":" The","done":false}
{"model":"llama2","created_at":"2023-08-24T20:24:05.805889Z","response":" sky","done":false}
{"model":"llama2","created_at":"2023-08-24T20:24:05.824734Z","response":" appears","done":false}
{"model":"llama2","created_at":"2023-08-24T20:24:05.842502Z","response":" blue","done":false}
{"model":"llama2","created_at":"2023-08-24T20:24:05.860295Z","response":" because","done":false}
...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing replicate plugin and the Ollama API example in the issue. Implement an Ollama plugin that connects to the localhost server, sends prompts to the generate endpoint, and handles its streaming response format; done means local Ollama generation works through the project’s plugin interface.

Written by the indexing model from the issue text.

Assessment

Tech stack
ollama, python
Domain
ai, cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.