ollama/docs/development.md

49 lines
687 B
Markdown
Raw Normal View History

2023-06-27 13:46:46 -04:00
# Development
2023-06-28 11:16:57 -04:00
ollama is built and run using [Poetry](https://python-poetry.org/).
2023-06-27 13:46:46 -04:00
## Running
2023-06-27 14:06:49 -04:00
**Start backend service:**
2023-06-27 14:06:59 -04:00
2023-06-27 13:46:46 -04:00
Install dependencies:
```
2023-06-28 11:16:57 -04:00
poetry install --extras server
2023-06-27 13:46:46 -04:00
```
2023-06-27 14:50:23 -04:00
Run a server:
2023-06-27 13:46:46 -04:00
```
2023-06-28 11:16:57 -04:00
poetry run ollama serve
2023-06-27 13:46:46 -04:00
```
## Building
If using Apple silicon, you need a Python version that supports arm64:
```bash
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh
```
Get the dependencies:
```bash
2023-06-28 11:16:57 -04:00
poetry install --extras server
2023-06-27 13:46:46 -04:00
```
Then build a binary for your current platform:
```bash
2023-06-28 11:16:57 -04:00
poetry build
2023-06-27 13:46:46 -04:00
```
2023-06-27 14:50:23 -04:00
## Update requirements.txt
In the root directory, run:
```
pipreqs . --force
```