Skip to content

Fix issue #2044: Improve output parsing and timeout for local LLMs #2046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jjmachan
Copy link
Member

This PR addresses the issues reported in #2044 where local LLMs like Ollama with qwen2.5:14b were encountering RagasOutputParserException and TimeoutError during evaluation.

Changes

  1. Increased default timeout in RunConfig from 180 to 300 seconds to accommodate slower local LLMs
  2. Enhanced extract_json function to better handle various LLM output formats:
    • Added support for markdown code blocks
    • Added handling for single quotes in JSON
    • Added handling for trailing commas in JSON
    • Improved JSON extraction from text with surrounding content
  3. Improved RagasOutputParser with:
    • More robust error handling
    • Increased default retries from 1 to 3
    • Better error messages with details about the failure
    • Added suggestions for working with local LLMs in error messages

Added tests

  • Tests for extract_json with various input formats
  • Tests for RagasOutputParser fallback mechanism
  • Tests for timeout configuration

Fixes #2044

@jjmachan can click here to continue refining the PR

This commit addresses the issues reported in #2044 where local LLMs like Ollama with qwen2.5:14b
were encountering RagasOutputParserException and TimeoutError during evaluation.

Changes:
1. Increased default timeout in RunConfig from 180 to 300 seconds to accommodate slower local LLMs
2. Enhanced extract_json function to better handle various LLM output formats:
   - Added support for markdown code blocks
   - Added handling for single quotes in JSON
   - Added handling for trailing commas in JSON
   - Improved JSON extraction from text with surrounding content
3. Improved RagasOutputParser with:
   - More robust error handling
   - Increased default retries from 1 to 3
   - Better error messages with details about the failure
   - Added suggestions for working with local LLMs in error messages

Added tests:
- Tests for extract_json with various input formats
- Tests for RagasOutputParser fallback mechanism
- Tests for timeout configuration
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label May 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Evaluation Errors: Output Parsing and Timeout Issues for Context/Faithfulness Metrics
2 participants