#!/bin/bash set -e echo "Starting Ollama service..." ollama serve & # Wait for Ollama to be ready echo "Waiting for Ollama to start..." for i in {1..30}; do if curl -s http://localhost:11434/api/tags > /dev/null 2>&1; then echo "Ollama is ready!" break fi echo "Waiting for Ollama... ($i/30)" sleep 2 done # Check if models exist, if not, show warning echo "Checking for models..." ollama list if ! ollama list | grep -q "qwen3:14b"; then echo "WARNING: qwen3:14b model not found!" echo "The application requires qwen3:14b to function properly." fi if ! ollama list | grep -q "qwen3-embedding"; then echo "WARNING: qwen3-embedding model not found!" echo "The application requires qwen3-embedding:4b for embeddings." fi echo "Starting FastAPI application..." exec uvicorn _qwen_xinference_demo.api:app --host 0.0.0.0 --port 8010