1
This commit is contained in:
63
agent58k/setup.sh
Normal file
63
agent58k/setup.sh
Normal file
@@ -0,0 +1,63 @@
|
||||
#!/bin/bash
|
||||
# Setup script for Qwen Agent MCP Server
|
||||
|
||||
set -e
|
||||
|
||||
echo "🚀 Setting up Qwen Agent MCP Server..."
|
||||
|
||||
# Create directory if it doesn't exist
|
||||
mkdir -p ~/agent58k
|
||||
cd ~/agent58k
|
||||
|
||||
# Check Python version
|
||||
if ! command -v python3 &> /dev/null; then
|
||||
echo "❌ Python 3 is required but not installed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PYTHON_VERSION=$(python3 --version | cut -d' ' -f2 | cut -d'.' -f1,2)
|
||||
echo "✅ Found Python $PYTHON_VERSION"
|
||||
|
||||
# Create virtual environment
|
||||
if [ ! -d "venv" ]; then
|
||||
echo "📦 Creating virtual environment..."
|
||||
python3 -m venv venv
|
||||
fi
|
||||
|
||||
# Activate virtual environment
|
||||
source venv/bin/activate
|
||||
|
||||
# Upgrade pip
|
||||
echo "⬆️ Upgrading pip..."
|
||||
pip install --upgrade pip
|
||||
|
||||
# Install requirements
|
||||
echo "📥 Installing dependencies..."
|
||||
pip install -r requirements.txt
|
||||
|
||||
# Check if Ollama is running
|
||||
echo "🔍 Checking Ollama..."
|
||||
if ! curl -s http://localhost:11434/api/tags > /dev/null 2>&1; then
|
||||
echo "⚠️ Warning: Ollama doesn't seem to be running on localhost:11434"
|
||||
echo " Start it with: ollama serve"
|
||||
else
|
||||
echo "✅ Ollama is running"
|
||||
|
||||
# Check if model is available
|
||||
if ! curl -s http://localhost:11434/api/tags | grep -q "zdolny/qwen3-coder58k-tools"; then
|
||||
echo "📥 Pulling Qwen model (this may take a while)..."
|
||||
ollama pull zdolny/qwen3-coder58k-tools:latest
|
||||
else
|
||||
echo "✅ Qwen model is available"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "✨ Setup complete!"
|
||||
echo ""
|
||||
echo "To start the server:"
|
||||
echo " cd ~/agent58k"
|
||||
echo " source venv/bin/activate"
|
||||
echo " python server.py"
|
||||
echo ""
|
||||
echo "Then configure your IDE to use: http://localhost:8000/v1/chat/completions"
|
||||
Reference in New Issue
Block a user