Skip to content

Commit c132dba

Browse files
authored
docs(examples): Add mistral example (#1214)
Signed-off-by: Ettore Di Giacinto <[email protected]>
1 parent b839eb8 commit c132dba

File tree

5 files changed

+65
-0
lines changed

5 files changed

+65
-0
lines changed

examples/configurations/README.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
## Advanced configuration
2+
3+
This section contains examples on how to install models manually with config files.
4+
5+
### Prerequisites
6+
7+
First clone LocalAI:
8+
9+
```bash
10+
git clone https://github.com/go-skynet/LocalAI
11+
12+
cd LocalAI
13+
```
14+
15+
Setup the model you prefer from the examples below and then start LocalAI:
16+
17+
```bash
18+
docker compose up -d --pull always
19+
```
20+
21+
If LocalAI is already started, you can restart it with
22+
23+
```bash
24+
docker compose restart
25+
```
26+
27+
See also the getting started: https://localai.io/basics/getting_started/
28+
29+
### Mistral
30+
31+
To setup mistral copy the files inside `mistral` in the `models` folder:
32+
33+
```bash
34+
cp -r examples/configurations/mistral/* models/
35+
```
36+
37+
Now download the model:
38+
39+
```bash
40+
wget https://huggingface.co/TheBloke/Mistral-7B-OpenOrca-GGUF/resolve/main/mistral-7b-openorca.Q6_K.gguf -O models/mistral-7b-openorca.Q6_K.gguf
41+
```
42+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{{.Input}}
2+
<|im_start|>assistant
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<|im_start|>{{if eq .RoleName "assistant"}}assistant{{else if eq .RoleName "system"}}system{{else if eq .RoleName "user"}}user{{end}}
2+
{{if .Content}}{{.Content}}{{end}}
3+
<|im_end|>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{.Input}}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: mistral
2+
mmap: true
3+
parameters:
4+
model: mistral-7b-openorca.Q6_K.gguf
5+
temperature: 0.2
6+
top_k: 40
7+
top_p: 0.95
8+
template:
9+
chat_message: chatml
10+
chat: chatml-block
11+
completion: completion
12+
context_size: 4096
13+
f16: true
14+
stopwords:
15+
- <|im_end|>
16+
threads: 4

0 commit comments

Comments
 (0)