Merge branch 'nrvo-ollama-amd'

This commit is contained in:
Nicolas Meienberger 2024-05-11 11:33:01 +02:00
commit db408d0b74
4 changed files with 134 additions and 0 deletions

18
apps/ollama-amd/config.json Executable file
View File

@ -0,0 +1,18 @@
{
"$schema": "../schema.json",
"name": "Ollama - AMD",
"available": true,
"exposable": true,
"port": 11434,
"id": "ollama-amd",
"tipi_version": 1,
"version": "0.1.33",
"categories": ["ai"],
"description": "Get up and running with Llama 3, Mistral, Gemma, and other large language models.",
"short_desc": "LLMs inference server with OpenAI compatible API",
"author": "ollama",
"source": "https://github.com/ollama/ollama",
"website": "https://ollama.com",
"form_fields": [],
"supported_architectures": ["arm64", "amd64"]
}

View File

@ -0,0 +1,44 @@
version: '3.7'
services:
ollama-amd:
image: ollama/ollama:0.1.33-rocm
restart: unless-stopped
container_name: ollama-amd
environment:
- PORT=11434
ports:
- '${APP_PORT}:11434'
networks:
- tipi_main_network
volumes:
- ${APP_DATA_DIR}/data/.ollama:/root/.ollama
devices:
# Attach GPU
- /dev/kfd
- /dev/dri
labels:
# Main
traefik.enable: true
traefik.http.middlewares.ollama-amd-web-redirect.redirectscheme.scheme: https
traefik.http.services.ollama-amd.loadbalancer.server.port: 11434
# Web
traefik.http.routers.ollama-amd-insecure.rule: Host(`${APP_DOMAIN}`)
traefik.http.routers.ollama-amd-insecure.entrypoints: web
traefik.http.routers.ollama-amd-insecure.service: ollama-amd
traefik.http.routers.ollama-amd-insecure.middlewares: ollama-amd-web-redirect
# Websecure
traefik.http.routers.ollama-amd.rule: Host(`${APP_DOMAIN}`)
traefik.http.routers.ollama-amd.entrypoints: websecure
traefik.http.routers.ollama-amd.service: ollama-amd
traefik.http.routers.ollama-amd.tls.certresolver: myresolver
# Local domain
traefik.http.routers.ollama-amd-local-insecure.rule: Host(`ollama-amd.${LOCAL_DOMAIN}`)
traefik.http.routers.ollama-amd-local-insecure.entrypoints: web
traefik.http.routers.ollama-amd-local-insecure.service: ollama-amd
traefik.http.routers.ollama-amd-local-insecure.middlewares: ollama-amd-web-redirect
# Local domain secure
traefik.http.routers.ollama-amd-local.rule: Host(`ollama-amd.${LOCAL_DOMAIN}`)
traefik.http.routers.ollama-amd-local.entrypoints: websecure
traefik.http.routers.ollama-amd-local.service: ollama-amd
traefik.http.routers.ollama-amd-local.tls: true

View File

@ -0,0 +1,72 @@
## Usage
⚠️ This app runs on port **11434**. Take this into account when configuring tools connecting to the app.
### Use with a frontend
- [LobeChat](https://github.com/lobehub/lobe-chat)
- [LibreChat](https://github.com/danny-avila/LibreChat)
- [OpenWebUI](https://github.com/open-webui/open-webui)
- [And more ...](https://github.com/ollama/ollama)
---
### Try the REST API
Ollama has a REST API for running and managing models.
**Generate a response**
```sh
curl http://localhost:11434/api/generate -d '{
"model": "llama3",
"prompt":"Why is the sky blue?"
}'
```
**Chat with a model**
```sh
curl http://localhost:11434/api/chat -d '{
"model": "llama3",
"messages": [
{ "role": "user", "content": "why is the sky blue?" }
]
}'
```
---
## Compatible GPUs
Ollama supports the following AMD GPUs:
| Family | Cards and accelerators |
| -------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| AMD Radeon RX | `7900 XTX` `7900 XT` `7900 GRE` `7800 XT` `7700 XT` `7600 XT` `7600` `6950 XT` `6900 XTX` `6900XT` `6800 XT` `6800` `Vega 64` `Vega 56` |
| AMD Radeon PRO | `W7900` `W7800` `W7700` `W7600` `W7500` `W6900X` `W6800X Duo` `W6800X` `W6800` `V620` `V420` `V340` `V320` `Vega II Duo` `Vega II` `VII` `SSG` |
| AMD Instinct | `MI300X` `MI300A` `MI300` `MI250X` `MI250` `MI210` `MI200` `MI100` `MI60` `MI50` |
---
## Model library
Ollama supports a list of models available on [ollama.com/library](https://ollama.com/library 'ollama model library')
Here are some example models that can be downloaded:
| Model | Parameters | Size | Download |
| ------------------ | ---------- | ----- | ------------------------------ |
| Llama 3 | 8B | 4.7GB | `ollama run llama3` |
| Llama 3 | 70B | 40GB | `ollama run llama3:70b` |
| Phi-3 | 3,8B | 2.3GB | `ollama run phi3` |
| Mistral | 7B | 4.1GB | `ollama run mistral` |
| Neural Chat | 7B | 4.1GB | `ollama run neural-chat` |
| Starling | 7B | 4.1GB | `ollama run starling-lm` |
| Code Llama | 7B | 3.8GB | `ollama run codellama` |
| Llama 2 Uncensored | 7B | 3.8GB | `ollama run llama2-uncensored` |
| LLaVA | 7B | 4.5GB | `ollama run llava` |
| Gemma | 2B | 1.4GB | `ollama run gemma:2b` |
| Gemma | 7B | 4.8GB | `ollama run gemma:7b` |
| Solar | 10.7B | 6.1GB | `ollama run solar` |
> Note: You should have at least 8 GB of RAM available to run the 7B models, 16 GB to run the 13B models, and 32 GB to run the 33B models.

BIN
apps/ollama-amd/metadata/logo.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB