Skip to content

Commit

Permalink
Update readme and add a restart
Browse files Browse the repository at this point in the history
  • Loading branch information
CoMfUcIoS committed Sep 25, 2023
1 parent c6cfd31 commit 97cbd26
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
LOCALAI=http://localhost:8085

install:
pip3 install openai
mkdir -p models

start:
mkdir -p models
docker compose up

pull:
docker compose pull

restart:
rm -rf models/*.tmpl
docker compose restart

test:
curl $(LOCALAI)/v1/chat/completions -H "Content-Type: application/json" -d '{"model": "gpt4all-j", "messages": [{"role": "user", "content": "How are you?"}],"temperature": 0.1 }'

.SILENT:
get_models:
curl $(LOCALAI)/models/apply -H "Content-Type: application/json" -d '{"url": "github:go-skynet/model-gallery/gpt4all-j.yaml","name": "gpt4all-j"}'
rm -rf models/*.tmpl

.SILENT: install start restart pull test get_models
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- [Reload zsh](#reload-zsh)
- [Run local api in docker](#run-local-api-in-docker)
- [Fetch the models](#fetch-the-models)
- [Restart the api](#restart-the-api)
- [Make your first request](#make-your-first-request)
- [Usage](#usage)
- [License](#license)
Expand Down Expand Up @@ -70,12 +71,20 @@ make start

#### Fetch the models

This will take a while to download the models for the first time
This will take a while to download the models for the first time. Wait until this is done before making a request.

```bash
make get_models
```

### Restart the api

Give it a few seconds to stop the container and start it again.

```bash
make restart
```

### Make your first request

That will take a while to load the model for the first time
Expand Down

0 comments on commit 97cbd26

Please sign in to comment.