This guide addresses common issues you might encounter when setting up and using the Local AI Coding Agent.
Problem: Error installing dependencies.
Solutions:
- Update pip:
pip install --upgrade pip - Install build tools:
sudo apt install build-essential(Ubuntu) orxcode-select --install(macOS) - Try installing problematic packages individually with verbose output:
pip install <package> -v
Problem: CUDA-related errors or GPU not being detected.
Solutions:
- Verify CUDA installation:
nvcc --version - Check GPU is recognized:
nvidia-smi - Ensure CUDA version matches PyTorch requirements
- Install the correct PyTorch version for your CUDA: PyTorch Installation Guide
- Try forcing CPU mode:
export CUDA_VISIBLE_DEVICES=""
Problem: Cannot download models from Hugging Face.
Solutions:
- Check internet connection
- Verify you have enough disk space
- Try with a VPN if regional restrictions apply
- Download manually from Hugging Face and place in the appropriate directory
Problem: System runs out of memory when loading models.
Solutions:
- Use a smaller model variant
- Enable memory-efficient loading:
--low-cpu-mem-usage - For GPU: try using
--device-map autoto spread across multiple GPUs - Increase swap space on your system
- Use quantized models (4-bit or 8-bit) to reduce memory usage
Problem: Code generation is very slow.
Solutions:
- Use a GPU if available
- Reduce the context length in configuration
- Try a smaller model
- Use quantization for faster inference
- Optimize batch size for your hardware
Problem: Generated code is low quality or contains errors.
Solutions:
- Try a different model
- Adjust temperature and top_p parameters
- Provide more detailed prompts
- Use the refactoring feature to improve initial output
Problem: ModuleNotFoundError or similar import errors.
Solutions:
- Ensure package is installed in the current environment
- Check for path issues:
import sys; print(sys.path) - Verify you're using the correct Python interpreter:
which python - Try reinstalling the package with
-eflag
Problem: C++ validation or compilation fails.
Solutions:
- Ensure g++ is installed:
g++ --version - Install missing development libraries
- Check for C++ standard compatibility issues
- Manually compile with verbose output:
g++ -v file.cpp
If you encounter issues not covered here:
-
Enable debug logging:
import logging logging.basicConfig(level=logging.DEBUG)
-
Check log files in the project directory
-
Run with traceback for more details:
python -m trace --trace main.py
If you continue to experience issues:
- Check existing GitHub issues
- Provide detailed information when reporting new issues:
- System specifications
- Error messages and stack traces
- Steps to reproduce
- Log outputs