From 55898a33821fc1652041021393ac81bd42aba0c8 Mon Sep 17 00:00:00 2001 From: Jeffrey Morgan Date: Sat, 1 Jul 2023 17:54:29 -0400 Subject: [PATCH] Move python docs to separate file --- README.md | 60 ++-------------------------------------------- docs/python.md | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 58 deletions(-) create mode 100644 docs/python.md diff --git a/README.md b/README.md index c84f2433..d456aaef 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Ollama -Ollama is a tool for running any large language model on any machine. It's designed to be easy to use and fast, supporting the largest number of models possible by using the fastest loader available for your platform and model. +Ollama is a tool for running large language models. It's designed to be easy to use and fast. > _Note: this project is a work in progress. Certain models that can be run with `ollama` are intended for research and/or non-commercial use only._ @@ -38,63 +38,7 @@ Or directly via downloaded model files: ollama run ~/Downloads/orca-mini-13b.ggmlv3.q4_0.bin ``` -## Python SDK - -### Example - -```python -import ollama -ollama.generate("orca-mini-3b", "hi") -``` - -### `ollama.generate(model, message)` - -Generate a completion - -```python -ollama.generate("./llama-7b-ggml.bin", "hi") -``` - -### `ollama.models()` - -List available local models - -```python -models = ollama.models() -``` - -### `ollama.load(model)` - -Manually a model for generation - -```python -ollama.load("model") -``` - -### `ollama.unload(model)` - -Unload a model - -```python -ollama.unload("model") -``` - -### `ollama.pull(model)` - -Download a model - -```python -ollama.pull("huggingface.co/thebloke/llama-7b-ggml") -``` - -### `ollama.search(query)` - -Search for compatible models that Ollama can run - -```python -ollama.search("llama-7b") -``` - ## Documentation - [Development](docs/development.md) +- [Python SDK](docs/python.md) diff --git a/docs/python.md b/docs/python.md new file mode 100644 index 00000000..04732ccf --- /dev/null +++ b/docs/python.md @@ -0,0 +1,64 @@ +# Python SDK + +## Install + +``` +pip install ollama +``` + +## Example + +```python +import ollama +ollama.generate("orca-mini-3b", "hi") +``` + +## Reference + +### `ollama.generate(model, message)` + +Generate a completion + +```python +ollama.generate("./llama-7b-ggml.bin", "hi") +``` + +### `ollama.models()` + +List available local models + +```python +models = ollama.models() +``` + +### `ollama.load(model)` + +Manually a model for generation + +```python +ollama.load("model") +``` + +### `ollama.unload(model)` + +Unload a model + +```python +ollama.unload("model") +``` + +### `ollama.pull(model)` + +Download a model + +```python +ollama.pull("huggingface.co/thebloke/llama-7b-ggml") +``` + +### `ollama.search(query)` + +Search for compatible models that Ollama can run + +```python +ollama.search("llama-7b") +```