Spaces:
Paused
Paused
Download entrypoint.sh from onlyrickroll/chat4: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/onlyrickroll/chat4/resolve/main/entrypoint.sh
- Command line
-
hf download hf://spaces/onlyrickroll/chat4/entrypoint.sh
-
curl -L -o entrypoint.sh https://huggingface.co/spaces/onlyrickroll/chat4/resolve/main/entrypoint.sh
1.03 kB
| # 创建配置目录 | |
| mkdir -p ~/.nanobot | |
| # 直接写入配置(对接你本地的 PowerServe 或 Ollama API) | |
| cat <<EOF > ~/.nanobot/config.json | |
| { | |
| "llamacpp": { | |
| "apiKey": "local-no-key", | |
| "apiBase": "http://localhost:8080/v1", | |
| "extraHeaders": null | |
| }, | |
| "model": "llamacpp/qwen3:4b", | |
| "server": { | |
| "port": 8888, | |
| "host": "127.0.0.1" | |
| } | |
| "historySize": 10, | |
| "systemPrompt": "You are a helpful local AI assistant ." | |
| } | |
| EOF | |
| # 1. 启动 C++ 服务 (llama-server) | |
| # 将端口改为 8080,并放到后台 | |
| echo "Starting llama-server on port 8080..." | |
| ./llama-server \ | |
| -m "/app/Qwen3VL-4B-Instruct-Q4_K_M.gguf" \ | |
| --host "127.0.0.1" \ | |
| --port "8080" \ | |
| -t "2" \ | |
| -c "512" \ | |
| --flash-attn "on" \ | |
| --no-mmap \ | |
| --mlock & | |
| echo "Starting Python bot on port 8888..." | |
| PORT=8888 nanobot gateway & | |
| # | |
| sleep 5 | |
| # 4. 启动 Nginx 作为主进程 (监听 7860) | |
| # daemon off 确保容器不会立即退出 | |
| echo "Starting Nginx reverse proxy on port 7860..." | |
| nginx -g "daemon off;" |