Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore/ui-demo: Sets up Open WebUI #12

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ run-example-docker: example-models
-it \
nekko-api

run-demo: example-models
docker compose -f docker/web/docker-compose.yml up

example-models: models/SmolLM2-135M-Instruct-Q6_K.gguf models/Llama-3.2-1B-Instruct-Q5_K_S.gguf models/OLMo-7B-Instruct-hf-0724-Q4_K.gguf

models/SmolLM2-135M-Instruct-Q6_K.gguf:
Expand Down
29 changes: 29 additions & 0 deletions docker/web/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,30 @@ services:
start_interval: 5s
retries: 5

ui:
image: ghcr.io/open-webui/open-webui:0.4.8
volumes:
- ui:/app/backend/data
environment:
- WEBUI_AUTH=false
- WEBUI_NAME=NekkoAPI UI
- ENABLE_OLLAMA_API=false
- OPENAI_API_BASE_URL=http://nekko_api:8000/v1
networks:
- nekko_api-network
expose:
- 8080
healthcheck:
test: ["CMD", "curl", "-f", "http://0.0.0.0:8080/health"]
interval: 30s
timeout: 5s
start_period: 2m
start_interval: 5s
retries: 5
depends_on:
nekko_api:
condition: service_healthy

nginx:
platform: linux/amd64
image: nginx:alpine
Expand All @@ -37,7 +61,12 @@ services:
depends_on:
nekko_api:
condition: service_healthy
ui:
condition: service_healthy

networks:
nekko_api-network:
driver: bridge

volumes:
ui:
15 changes: 15 additions & 0 deletions docker/web/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,25 @@ http {
client_max_body_size 2M;

location / {
proxy_pass http://ui:8080;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

location /v1 {
proxy_pass http://nekko_api:8000;

proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_read_timeout 20m;
}
}
}
Loading