Skip to content

Commit

Permalink
feat: kobold service, better doctor
Browse files Browse the repository at this point in the history
  • Loading branch information
av committed Jan 11, 2025
1 parent baa01e0 commit 0c6282a
Show file tree
Hide file tree
Showing 13 changed files with 374 additions and 193 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ Harbor is a containerized LLM toolkit that allows you to run LLMs and additional
[AirLLM](https://github.com/av/harbor/wiki/2.2.11-Backend:-AirLLM) ⦁︎
[SGLang](https://github.com/av/harbor/wiki/2.2.12-Backend:-SGLang) ⦁︎
[KTransformers](https://github.com/av/harbor/wiki/2.2.13-Backend:-KTransformers) ⦁︎
[Nexa SDK](https://github.com/av/harbor/wiki/2.2.15-Backend:-Nexa-SDK)
[Nexa SDK](https://github.com/av/harbor/wiki/2.2.15-Backend:-Nexa-SDK) ⦁︎
[KoboldCpp](https://github.com/av/harbor/wiki/2.2.16-Backend:-KoboldCpp)

##### Satellites
[Harbor Bench](https://github.com/av/harbor/wiki/5.1.-Harbor-Bench) ⦁︎
Expand Down
4 changes: 4 additions & 0 deletions app/src/serviceMetadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,8 @@ export const serviceMetadata: Record<string, Partial<HarborService>> = {
tags: [HST.satellite, HST.api],
wikiUrl: 'https://github.com/av/harbor/wiki/2.3.33-Satellite:-OptiLLM',
},
kobold: {
tags: [HST.satellite, HST.frontend, HST.backend],
wikiUrl: 'https://github.com/av/harbor/wiki/2.2.16-Backend:-KoboldCpp',
}
};
20 changes: 20 additions & 0 deletions compose.kobold.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
services:
kobold:
container_name: ${HARBOR_CONTAINER_PREFIX}.kobold
image: ${HARBOR_KOBOLD_IMAGE}:${HARBOR_KOBOLD_VERSION}
env_file:
- ./.env
- kobold/override.env
volumes:
- ${HARBOR_KOBOLD_WORKSPACE}:/workspace/:rw
- ${HARBOR_OLLAMA_CACHE}:/ollama
- ${HARBOR_HF_CACHE}:/hf
- ${HARBOR_LLAMACPP_CACHE}:/llamacpp
- ${HARBOR_VLLM_CACHE}:/vllm
ports:
- ${HARBOR_KOBOLD_HOST_PORT}:5001
environment:
- KCPP_MODEL=${HARBOR_KOBOLD_MODEL}
- KCPP_ARGS=${HARBOR_KOBOLD_ARGS}
networks:
- harbor-network
66 changes: 0 additions & 66 deletions compose.perplexideez.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,69 +69,3 @@ services:
condition: service_healthy
networks:
- harbor-network

configs:
perplexideez_proxy_config:
content: |
server {
listen 80;
gzip_static off;
server_name perplexideez.com;
location / {
proxy_pass http://perplexideez-service:3000;
proxy_set_header Host perplexideez.com;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
# Disable CSRF protection in Nginx
proxy_set_header X-Forwarded-Host $$host;
proxy_set_header Origin https://perplexideez.com;
proxy_set_header Referer https://perplexideez.com;
# Rewrite Location header to use localhost
proxy_redirect https://perplexideez.com/ http://localhost:34261/;
proxy_redirect http://perplexideez.com/ http://localhost:34261/;
# Cookie rewriting
proxy_cookie_domain perplexideez.com localhost;
proxy_cookie_path / /;
proxy_cookie_flags ~ -secure;
# Force uncompressed response to allow substitutions
proxy_set_header Accept-Encoding "";
# Rewrite Secure-prefixed cookies
proxy_hide_header set-cookie;
proxy_set_header Accept-Encoding "";
sub_filter_types *;
sub_filter_once off;
sub_filter '__Secure-' '';
sub_filter '; Secure' '';
sub_filter 'perplexideez.com' 'localhost:34261';
sub_filter "https://localhost:34261" "http://localhost:34261";
sub_filter "https%3A%2F%2Flocalhost%3A34261" "http%3A%2F%2Flocalhost%3A34261";
sub_filter 'href="https://localhost:34261' 'href="http://localhost:34261';
sub_filter 'content="https://localhost:34261' 'content="http://localhost:34261';
# CORS headers
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
# Handle OPTIONS method
if ($$request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
# Force processing of response
proxy_force_ranges on;
}
}
9 changes: 9 additions & 0 deletions compose.x.kobold.nvidia.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
services:
kobold:
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
65 changes: 65 additions & 0 deletions compose.x.perplexideez.mdc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
configs:
perplexideez_proxy_config:
content: |
server {
listen 80;
gzip_static off;
server_name perplexideez.com;
location / {
proxy_pass http://perplexideez-service:3000;
proxy_set_header Host perplexideez.com;
proxy_set_header X-Real-IP $$remote_addr;
proxy_set_header X-Forwarded-For $$proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
# Disable CSRF protection in Nginx
proxy_set_header X-Forwarded-Host $$host;
proxy_set_header Origin https://perplexideez.com;
proxy_set_header Referer https://perplexideez.com;
# Rewrite Location header to use localhost
proxy_redirect https://perplexideez.com/ http://localhost:34261/;
proxy_redirect http://perplexideez.com/ http://localhost:34261/;
# Cookie rewriting
proxy_cookie_domain perplexideez.com localhost;
proxy_cookie_path / /;
proxy_cookie_flags ~ -secure;
# Force uncompressed response to allow substitutions
proxy_set_header Accept-Encoding "";
# Rewrite Secure-prefixed cookies
proxy_hide_header set-cookie;
proxy_set_header Accept-Encoding "";
sub_filter_types *;
sub_filter_once off;
sub_filter '__Secure-' '';
sub_filter '; Secure' '';
sub_filter 'perplexideez.com' 'localhost:34261';
sub_filter "https://localhost:34261" "http://localhost:34261";
sub_filter "https%3A%2F%2Flocalhost%3A34261" "http%3A%2F%2Flocalhost%3A34261";
sub_filter 'href="https://localhost:34261' 'href="http://localhost:34261';
sub_filter 'content="https://localhost:34261' 'content="http://localhost:34261';
# CORS headers
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
# Handle OPTIONS method
if ($$request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization';
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
# Force processing of response
proxy_force_ranges on;
}
}
4 changes: 4 additions & 0 deletions compose.x.webui.kobold.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
services:
webui:
volumes:
- ./open-webui/configs/config.kobold.json:/app/configs/config.kobold.json
Loading

0 comments on commit 0c6282a

Please sign in to comment.