mirror of
https://github.com/furyhawk/home_stack.git
synced 2026-07-21 18:26:54 +00:00
- Created README.md for Ollama Docker setup with instructions for running and using models. - Added docker-compose.yml for Ollama service configuration. - Introduced scripts for model setup, including pulling models from Hugging Face and loading them into Ollama. - Implemented AI launcher script to choose between Ollama and LlamaCPP backends. - Added GPU support scripts for LlamaCPP with detailed logging and error handling. - Included simple model pull script for easier model management. - Established a structured approach for model management and integration with Ollama API.
3.4 KiB
3.4 KiB
Model Setup Scripts
This directory contains scripts to download and set up AI models for the Ollama service.
Available Scripts
1. pull-deepseek-model.sh
Main script that downloads the DeepSeek-R1-0528-Qwen3-8B model in GGUF format from Hugging Face and loads it into Ollama.
Features:
- Downloads the Q4_K_XL quantized version (optimal balance of quality and size)
- Creates a proper Modelfile with appropriate templates and parameters
- Loads the model into Ollama with the name
deepseek-r1-qwen3-8b - Includes verification and testing steps
Requirements:
huggingface-hubPython package (will be installed automatically if missing)- Ollama container running
- Internet connection
Usage:
# Using Makefile (recommended)
make setup-ollama # Start Ollama and pull model automatically
make pull-deepseek-model # Pull model only (requires Ollama to be running)
# Or run directly
./scripts/pull-deepseek-model.sh
2. pull-model-simple.sh
Alternative script that attempts to pull models using ollama pull command.
Usage:
./scripts/pull-model-simple.sh
Makefile Targets
The main Makefile includes these Ollama-related targets:
make ollama-up- Start only the Ollama containermake ollama-down- Stop only the Ollama containermake ollama-logs- View Ollama container logsmake pull-deepseek-model- Download and load DeepSeek modelmake setup-ollama- Complete setup (start Ollama + pull model)
Model Information
DeepSeek-R1-0528-Qwen3-8B-GGUF
- Source: unsloth/DeepSeek-R1-0528-Qwen3-8B-GGUF
- Quantization: Q4_K_XL (4-bit quantization, extra large)
- Size: ~5.5GB
- Context Length: 32,768 tokens
- Use Case: General conversation, reasoning, coding assistance
Quick Start
-
Start the entire stack:
make up -
Or start just Ollama and set up the model:
make setup-ollama -
Use the model:
# Via Docker docker exec ollama-server ollama run deepseek-r1-qwen3-8b "Hello, how are you?" # Via API curl http://localhost:11434/api/generate -d '{ "model": "deepseek-r1-qwen3-8b", "prompt": "Hello, how are you?", "stream": false }'
Troubleshooting
-
Script fails with "Ollama not running":
- Make sure Ollama container is started:
make ollama-up - Wait a few seconds for the service to be ready
- Make sure Ollama container is started:
-
Download fails:
- Check internet connection
- Verify Hugging Face Hub access
- Try installing huggingface-hub manually:
pip install huggingface-hub
-
Model loading fails:
- Check if the GGUF file was downloaded completely
- Verify the Modelfile syntax
- Check Ollama container logs:
make ollama-logs
-
Out of disk space:
- The model file is ~5.5GB, ensure sufficient free space
- Consider using a smaller quantization (modify the script)
Customization
You can modify the scripts to download different models or quantizations:
- Change model variant: Edit
MODEL_FILEinpull-deepseek-model.sh - Adjust parameters: Modify the Modelfile template in the script
- Use different model: Change
MODEL_REPOto any GGUF model on Hugging Face
File Locations
- Models:
./ai_stack/ollama/models/ - Modelfiles:
./ai_stack/ollama/models/Modelfile.* - Ollama data: Docker volume
ollama_data