#!/bin/bash set -e echo "=== Downloading model ===" MODEL_PATH=$(python3 -c " from huggingface_hub import hf_hub_download path = hf_hub_download( repo_id='Jackrong/Qwen3.5-9B-Claude-4.6-Opus-Reasoning-Distilled-v2-GGUF', filename='Qwen3.5-9B.Q4_K_M.gguf', ) print(path) ") echo "Model path: $MODEL_PATH" echo "=== Starting llama-server ===" llama-server \ --model "$MODEL_PATH" \ --host 127.0.0.1 \ --port 8080 \ --ctx-size 2048 \ --threads 2 \ --batch-size 256 \ --log-disable & # Wait for server to be ready echo "Waiting for llama-server to start..." for i in $(seq 1 30); do if curl -s http://127.0.0.1:8080/health > /dev/null 2>&1; then echo "llama-server is ready!" break fi echo " attempt $i/30..." sleep 2 done echo "=== Starting Gradio app ===" exec python3 app.py