Added Divers

This commit is contained in:
2025-04-24 16:30:26 +02:00
parent b867b58f01
commit 469a3c6006
4 changed files with 288 additions and 0 deletions

43
Divers/Local AI.md Normal file
View File

@@ -0,0 +1,43 @@
# LocalAI
```
sudo mkdir -p /mnt/data/localai
```
```bash
cd /mnt/data
git clone https://github.com/go-skynet/LocalAI
cd LocalAI
# (optional) Checkout a specific LocalAI tag
# git checkout -b build <TAG>
# copy your models to models/
wget https://gpt4all.io/models/ggml-gpt4all-j.bin -O models/ggml-gpt4all-j
# cp your-model.bin models/
# Use a template from the examples
cp -rf prompt-templates/ggml-gpt4all-j.tmpl models/
# (optional) Edit the .env file to set things like context size and threads
# vim .env
docker-compose up -d --build
# Now API is accessible at localhost:8080
curl http://localhost:8080/v1/models
# {"object":"list","data":[{"id":"ggml-gpt4all-j","object":"model"}]}
curl http://localhost:8080/v1/chat/completions -H "Content-Type: application/json" -d '{
"model": "ggml-gpt4all-j",
"messages": [{"role": "user", "content": "How are you?"}],
"temperature": 0.9
}'
# {"model":"ggml-gpt4all-j","choices":[{"message":{"role":"assistant","content":"I'm doing well, thanks. How about you?"}}]}
```
[https://localai.io](https://localai.io "https://localai.io")