FanFu is a bidirectional converter between GGUF (llama.cpp/Ollama) and HuggingFace safetensors formats, with comprehensive weight verification.
# Run all tests
python -m pytest tests/ -v
# Run quick tests
python test_quick.py
# Run package tests
python test_package.py
# Run conversion verification only
python -m pytest tests/test_conversion_verification.py -v
# Run core tests only
python -m pytest tests/test_core.py -v# Build package
python -m build
# Upload to PyPI (Linux/macOS)
bash upload_pypi.sh
# Upload to PyPI (Windows)
upload_pypi.bat# Generate all diagrams
python diagrams/generate_diagrams.pyfanfu/gguf_to_hf.py- Main GGUF to HuggingFace converterfanfu/hf_to_gguf.py- HuggingFace to GGUF converterfanfu/compare.py- Weight comparison utilitiesfanfu/cli.py- Command-line interfacefanfu/api.py- Python API
- All tests must pass before any commit
- Weight conversion must achieve 100% match rate
- Tolerance for floating point comparison: 1e-3
- Support quantization types: F32, F16, BF16, Q4_0, Q4_K, Q5_K, Q6_K, Q8_0
- Follow PEP 8
- Use type hints
- Docstrings for all public functions
- Keep functions focused and testable