Files
crewAI/tests/test_llm.py
Devin AI 6c81e45ffd Fix issue #3609: Add URL validation for Ollama connections
- Add _validate_base_url method to LLM class to validate Ollama URLs
- Integrate URL validation into _validate_call_params for Ollama models
- Validate IP address format and reject invalid IPs like 192.168.0.300
- Provide clear, helpful error messages for invalid URLs
- Add comprehensive tests covering invalid IPs, malformed URLs, and valid URLs
- Only validate URLs for Ollama models to avoid breaking other providers
- Fixes litellm.APIConnectionError with unclear 'No route to host' messages

Co-Authored-By: João <joao@crewai.com>
2025-09-27 15:28:09 +00:00

26 KiB