ollama/README.md

109 lines
1.9 KiB
Markdown
Raw Normal View History

2023-07-05 19:37:33 +00:00
![ollama](https://github.com/jmorganca/ollama/assets/251292/961f99bb-251a-4eec-897d-1ba99997ad0f)
2023-06-27 16:08:52 +00:00
# Ollama
2023-06-22 16:45:31 +00:00
2023-07-05 19:37:33 +00:00
Run large language models with `llama.cpp`.
2023-07-08 03:54:50 +00:00
> Note: certain models that can be run with Ollama are intended for research and/or non-commercial use only.
2023-07-05 19:37:33 +00:00
### Features
2023-06-27 21:13:07 +00:00
2023-07-05 19:37:33 +00:00
- Download and run popular large language models
- Switch between multiple models on the fly
- Hardware acceleration where available (Metal, CUDA)
2023-07-05 20:32:49 +00:00
- Fast inference server written in Go, powered by [llama.cpp](https://github.com/ggerganov/llama.cpp)
2023-07-05 19:37:33 +00:00
- REST API to use with your application (python, typescript SDKs coming soon)
2023-06-28 13:57:36 +00:00
## Install
2023-06-22 16:45:31 +00:00
2023-07-07 20:07:10 +00:00
- [Download](https://ollama.ai/download) for macOS
2023-07-05 19:37:33 +00:00
- Download for Windows (coming soon)
You can also build the [binary from source](#building).
## Quickstart
2023-07-07 19:33:50 +00:00
Run a fast and simple model.
2023-06-22 16:45:31 +00:00
```
2023-07-07 19:33:50 +00:00
ollama run orca
2023-06-22 16:45:31 +00:00
```
2023-07-05 19:37:33 +00:00
## Example models
### 💬 Chat
Have a conversation.
2023-06-30 16:31:00 +00:00
```
2023-07-05 19:37:33 +00:00
ollama run vicuna "Why is the sky blue?"
2023-06-30 16:31:00 +00:00
```
2023-07-05 19:37:33 +00:00
### 🗺️ Instructions
2023-06-25 17:08:03 +00:00
Get a helping hand.
2023-06-29 22:25:02 +00:00
```
2023-07-05 19:37:33 +00:00
ollama run orca "Write an email to my boss."
2023-06-25 17:08:03 +00:00
```
### 🔎 Ask questions about documents
Send the contents of a document and ask questions about it.
```
ollama run nous-hermes "$(cat input.txt)", please summarize this story
```
2023-07-05 19:37:33 +00:00
### 📖 Storytelling
Venture into the unknown.
2023-06-29 22:25:02 +00:00
```
2023-07-06 20:21:01 +00:00
ollama run nous-hermes "Once upon a time"
```
## Advanced usage
### Run a local model
```
ollama run ~/Downloads/vicuna-7b-v1.3.ggmlv3.q4_1.bin
2023-06-28 13:57:36 +00:00
```
2023-07-03 20:32:48 +00:00
## Building
```
2023-07-11 16:50:02 +00:00
go build .
2023-07-03 20:32:48 +00:00
```
2023-07-05 19:37:33 +00:00
To run it start the server:
2023-06-27 17:46:46 +00:00
2023-07-05 19:37:33 +00:00
```
./ollama server &
```
Finally, run a model!
```
./ollama run ~/Downloads/vicuna-7b-v1.3.ggmlv3.q4_1.bin
```
## API Reference
2023-07-06 20:46:05 +00:00
### `POST /api/pull`
Download a model
```
curl -X POST http://localhost:11343/api/pull -d '{"model": "orca"}'
```
### `POST /api/generate`
2023-07-05 19:37:33 +00:00
Complete a prompt
```
2023-07-06 20:46:05 +00:00
curl -X POST http://localhost:11434/api/generate -d '{"model": "orca", "prompt": "hello!", "stream": true}'
2023-07-05 19:37:33 +00:00
```