Added
- Ollama API Key Authentication: Support for authenticated Ollama instances
- Added optional
OLLAMA_API_KEYenvironment variable - Ollama provider now supports Bearer token authentication via
Authorizationheader - Works seamlessly with both authenticated and non-authenticated Ollama instances
- Empty or whitespace-only API keys are treated as no authentication (backward compatible)
- Comprehensive test suite with 15 tests covering all API key scenarios
- See PR #6 for details
- Added optional
Changed
- Ollama Client Initialization: Enhanced to conditionally set Authorization header
- Only sets
Authorization: Bearer {api_key}header when valid API key is provided - Maintains full backward compatibility with existing local Ollama setups
- Only sets
Testing
- New Test Suite:
tests/integration/test_ollama_api_key.py- 8 unit tests for API key initialization and header setting
- 2 tests for PaperlessAITitles API key passing
- 5 integration tests for real API calls with/without API key
- All tests pass with proper mocking and real Ollama integration
Acknowledgments
- Special Thanks: A huge thank you to @kkettinger (Kevin Kettinger) for contributing the Ollama API key authentication feature! This enhancement enables ngx-renamer to work with authenticated Ollama instances and cloud-hosted Ollama services. Your contribution is greatly appreciated! 🙏