Skip to content

Releases

v0.4.4

Choose a tag to compare

@jjmachan jjmachan released this 14 Nov 03:06
8c63f10

This release restores a working install, fixes a published security vulnerability, and makes Ragas work again with current OpenAI and Anthropic models.

pip install -U ragas

Highlights

  • import ragas works again. A fresh install pulled in langchain-community 0.4, which removed the VertexAI modules Ragas imported at start-up, so the import failed with ModuleNotFoundError. Those imports are now optional. (#2956)
  • Security fix for multimodal metrics (CVE-2026-6587). See the security section below. (#3105)
  • Anthropic works on current Claude models. Ragas no longer sends the sampling defaults that current models reject, and it no longer forces a tool call that the newest models refuse. (#3106, #3108)
  • OpenAI models with dotted versions work. gpt-5.2 and similar are now recognised, so max_tokens is sent as max_completion_tokens. (#2700)
  • OpenAI models on Amazon Bedrock work. Bedrock model IDs such as us.openai.gpt-6-sol are now recognised as reasoning models, so they no longer fail with a 400. (#3049)
  • Synchronous clients work in async metrics. agenerate() with a sync client runs in a thread instead of raising TypeError. (#2657)
  • Deprecation warnings point to imports that exist. 22 of the warnings in ragas.metrics suggested a ragas.metrics.collections import that raised ImportError. (#2974)

Security

MultiModalFaithfulness and MultiModalRelevance load images named in retrieved_contexts. A context string could make the machine running the evaluation fetch an internal URL (for example a cloud metadata endpoint) or read a local image file, and send the result to the LLM provider. This is CVE-2026-6587 / GHSA-95ww-475f-pr4f.

Both the collections API and the legacy API are fixed:

  • Image URLs are fetched only from public internet addresses. The check runs on the address actually connected to, on every redirect, so redirects and DNS rebinding do not get around it.
  • Local image paths are not read unless you enable local file access and name the one directory images may be loaded from.

If you use these metrics with untrusted datasets, upgrade.

Thanks to @GeoffreyManda, whose fix and tests in #3089 this builds on, and to the reporters in #2754.

Changes you may notice

Multimodal metrics

  • Local image paths in retrieved_contexts are no longer loaded by default in the collections API. An image that is not loaded is passed to the model as text and a warning is logged, so check your logs if scores change.

  • Image URLs on localhost or private addresses are refused in both APIs.

  • To opt back in, set these before running the metric:

    import ragas.prompt.multi_modal_prompt as image_policy
    
    # Read local images, but only from inside this directory
    image_policy.ALLOW_LOCAL_FILE_ACCESS = True
    image_policy.ALLOWED_IMAGE_BASE_DIR = "/data/eval_images"
    
    # Allow image URLs on internal or private addresses
    image_policy.ALLOW_INTERNAL_TARGETS = True
  • The metric pages document the rules and settings in full: MultiModalFaithfulness and MultiModalRelevance.

Anthropic (llm_factory(..., provider="anthropic"))

  • temperature and top_p are no longer sent unless you set them. Older Claude models that accepted Ragas' defaults (temperature=0.01, top_p=0.1) now run at the API's default temperature, so scores can vary more between runs.
  • The default structured-output mode is now JSON mode instead of a forced tool call. Pass mode=instructor.Mode.TOOLS to keep the old behaviour on models that accept it.
  • An explicit mode= now reaches Anthropic, Google and Perplexity. It was silently ignored before.

Dependencies

  • requests and tenacity are now declared as core dependencies. Ragas already imported both.

Known issues

  • Version 2.x of the anthropic package no longer accepts temperature or top_p. Setting either on an Anthropic model raises an error from the SDK.
  • Claude models reached through LiteLLM still receive Ragas' default sampling parameters.
  • Behind an HTTP proxy, the image URL check cannot see the final address for hostnames that only the proxy can resolve.

What's Changed

New Contributors

Full Changelog: v0.4.3...v0.4.4

v0.4.4rc1

v0.4.4rc1 Pre-release
Pre-release

Choose a tag to compare

@jjmachan jjmachan released this 13 Nov 21:20
7388e44

This is a release candidate for 0.4.4. It restores a working install, fixes a published security vulnerability, and makes Ragas work again with current OpenAI and Anthropic models. Please try it and report anything that breaks before the final release.

pip install --pre ragas==0.4.4rc1

Highlights

  • import ragas works again. A fresh install pulled in langchain-community 0.4, which removed the VertexAI modules Ragas imported at start-up, so the import failed with ModuleNotFoundError. Those imports are now optional. (#2956)
  • Security fix for multimodal metrics (CVE-2026-6587). See the security section below. (#3105)
  • Anthropic works on current Claude models. Ragas no longer sends the sampling defaults that current models reject, and it no longer forces a tool call that the newest models refuse. (#3106, #3108)
  • OpenAI models with dotted versions work. gpt-5.2 and similar are now recognised, so max_tokens is sent as max_completion_tokens. (#2700)
  • Synchronous clients work in async metrics. agenerate() with a sync client runs in a thread instead of raising TypeError. (#2657)

Security

MultiModalFaithfulness and MultiModalRelevance load images named in retrieved_contexts. A context string could make the machine running the evaluation fetch an internal URL (for example a cloud metadata endpoint) or read a local image file, and send the result to the LLM provider. This is CVE-2026-6587 / GHSA-95ww-475f-pr4f.

Both the collections API and the legacy API are fixed:

  • Image URLs are fetched only from public internet addresses. The check runs on the address actually connected to, on every redirect, so redirects and DNS rebinding do not get around it.
  • Local image paths are not read unless you enable local file access and name the one directory images may be loaded from.

If you use these metrics with untrusted datasets, upgrade.

Thanks to @GeoffreyManda, whose fix and tests in #3089 this builds on, and to the reporters in #2754.

Changes you may notice

Multimodal metrics

  • Local image paths in retrieved_contexts are no longer loaded by default in the collections API. An image that is not loaded is passed to the model as text and a warning is logged, so check your logs if scores change.

  • Image URLs on localhost or private addresses are refused in both APIs.

  • To opt back in, set these before running the metric:

    import ragas.prompt.multi_modal_prompt as image_policy
    
    # Read local images, but only from inside this directory
    image_policy.ALLOW_LOCAL_FILE_ACCESS = True
    image_policy.ALLOWED_IMAGE_BASE_DIR = "/data/eval_images"
    
    # Allow image URLs on internal or private addresses
    image_policy.ALLOW_INTERNAL_TARGETS = True
  • The metric pages document the rules and settings in full: MultiModalFaithfulness and MultiModalRelevance.

Anthropic (llm_factory(..., provider="anthropic"))

  • temperature and top_p are no longer sent unless you set them. Older Claude models that accepted Ragas' defaults (temperature=0.01, top_p=0.1) now run at the API's default temperature, so scores can vary more between runs.
  • The default structured-output mode is now JSON mode instead of a forced tool call. Pass mode=instructor.Mode.TOOLS to keep the old behaviour on models that accept it.
  • An explicit mode= now reaches Anthropic, Google and Perplexity. It was silently ignored before.

Dependencies

  • requests and tenacity are now declared as core dependencies. Ragas already imported both.

Known issues

  • Version 2.x of the anthropic package no longer accepts temperature or top_p. Setting either on an Anthropic model raises an error from the SDK.
  • Claude models reached through LiteLLM still receive Ragas' default sampling parameters.
  • Behind an HTTP proxy, the image URL check cannot see the final address for hostnames that only the proxy can resolve.

What's Changed

New Contributors

Full Changelog: v0.4.3...v0.4.4rc1

v0.4.3

Choose a tag to compare

@anistark anistark released this 13 Jan 17:47
4ecab38

What's Changed

  • feat: add DSPyOptimizer with MIPROv2 for advanced prompt optimization by @anistark in #2537
  • feat(docs): add llms.txt generation for LLM-friendly documentation by @sanjeed5 in #2539
  • feat: dspy caching by @anistark in #2542
  • feat: add system prompt support for InstructorLLM and LiteLLMStructuredLLM by @anistark in #2543
  • feat(docs): add copy-to-llm button for easy AI tool integration by @sanjeed5 in #2541
  • fix: use PAT token for docs-check CI as docs-apply CI by @anistark in #2546
  • feat: add remaining quickstart templates by @anistark in #2547
  • fix: enable FactualCorrectness language adaptation by @anistark in #2555
  • fix: resolve DiskCacheBackend pickling issue with InstructorLLM by @anistark in #2556
  • fix: lazy init DEFAULT_TOKENIZER to avoid network calls at import time. by @cgaswin in #2545
  • fix: comment on failed task by @anistark in #2557
  • docs: fix DiscreteMetric llm examples to match API by @cgaswin in #2558
  • fix: add repository parameter to checkout action for fork PR support by @anistark in #2559

Full Changelog: v0.4.2...v0.4.3

v0.4.2

Choose a tag to compare

@anistark anistark released this 23 Dec 17:13
bf61178

What's Changed

  • feat: migrate SQLSemanticEquivalence to collections API by @anistark in #2496
  • feat: migrate DataCompyScore to collections API by @anistark in #2499
  • fix: migrate CHRF Score to new metrics collections by @anistark in #2500
  • Feat/improve rag quickstart by @anistark in #2501
  • fix: handle classification array length mismatch in TopicAdherence metric by @anistark in #2503
  • feat: migrate quoted spans metric to collections api by @anistark in #2504
  • fix: handle instructor modes for json and tools by @anistark in #2505
  • docs: remove obsolete 'write your own metric' guides by @sanjeed5 in #2488
  • fix: BasePrompt.adapt() structured output + language adaptation guide by @sanjeed5 in #2487
  • Add AG-UI Protocol Integration for Agent Evaluation by @contextablemark in #2395
  • docs: fix modifying-prompts-metrics guide with correct API by @sanjeed5 in #2486
  • fix: handle nested dicts/lists in ToolCallF1 args to prevent unhashable type error by @anistark in #2507
  • feat: add Claude docs auto-update workflow by @sanjeed5 in #2508
  • fix: allow unannotated parameters to accept any type by @dhyaneesh in #2513
  • feat: migrate MultiModalFaithfulness to collections API by @anistark in #2515
  • feat: migrate MultiModalRelevance to collections API by @anistark in #2518
  • feat: add support for new google-genai SDK with backwards compatibility for deprecated google-generativeai by @anistark in #2517
  • fix: use instructor Mode.JSON for litellm and generic providers to fix Dict type validation errors by @anistark in #2514
  • [AG-UI] Replacing "OpenAI" with "AsyncOpenAI". by @contextablemark in #2520
  • Feat: document PDF export workflow by @cgaswin in #2522
  • refactor: deprecate legacy metrics by @anistark in #2519
  • fix: claude workflows to use github token by @anistark in #2527
  • feat: add HuggingFace tokenizer support in knowledge graph operations by @anistark in #2524
  • feat: add generate_with_chunks for pre-chunked documents by @MinseongS in #2526
  • feat(docs): add offline mermaid support to PDF export by @cgaswin in #2530
  • fix: claude workflows to use pat token instead of github token to support forked PRs by @anistark in #2531
  • docs: change query execution to use asyncio.run by @yangzq50 in #2532
  • fix: increase max-turns and update prompt by @anistark in #2534
  • chore: remove survey link by @anistark in #2535
  • feat: add caching support for metrics collections by @anistark in #2533
  • feat: add caching support for embeddings by @anistark in #2536

New Contributors

Full Changelog: v0.4.1...v0.4.2

v0.4.1

Choose a tag to compare

@anistark anistark released this 10 Dec 16:28
4308b24

What's Changed

  • feat: add save/load methods to BasePrompt by @anistark in #2465
  • docs: update run_config guide to use collections API by @sanjeed5 in #2468
  • fix: add anthropic and gemini clients for custom clients by @anistark in #2472
  • feat: migrate ToolCallAccuracy to collections API by @anistark in #2476
  • chore: add survey link to readme and docs banner by @anistark in #2478
  • Fix: apply_transforms(kg, transforms, run_config=run_config or RunCon… by @narabi in #2480
  • feat: migrate ToolCallF1 to collections API with set-based F1 scoring by @anistark in #2483
  • New input parameter for the TestsetGenerator Class : LLM_CONTEXT by @narabi in #2474
  • feat: migrate TopicAdherence and AgentGoalAccuracy to collections API by @anistark in #2485
  • docs: organize integrations nav into collapsible groups by @sanjeed5 in #2492
  • aembed_text() replace embed_text() in AnswerRelevancy by @anexplore in #2495
  • docs: remove broken reference to train_your_own_metric.md by @sanjeed5 in #2489
  • feat: migrate Rubrics Metrics to collections API by @anistark in #2494

New Contributors

Full Changelog: v0.4.0...v0.4.1

v0.4.0

Choose a tag to compare

@anistark anistark released this 03 Dec 16:22
877ed6c

What's Changed

  • docs: complete collections API documentation for remaining metrics by @sanjeed5 in #2420
  • feat: support GPT-5 and o-series models with automatic temperature and top_p constraint handling by @anistark in #2418
  • update: add llm options as tabs to quickstart by @anistark in #2421
  • feat: migrate to instructor.from_provider for universal provider support by @anistark in #2424
  • docs: fix typos in some files by @Edge-Seven in #2429
  • feat: implement prompt class for context precision by @anistark in #2433
  • fix: docs for quickstart by @anistark in #2434
  • Fix 2432: Update import statements for langchain modules by @rvernica in #2436
  • Fix 2440 Adjust LLM parameters in evals.py by @rvernica in #2441
  • feat: migrate context recall, answer relevancy, and context entity recall metrics to modular BasePrompt architecture by @anistark in #2435
  • feat: migrate 6 metrics (ContextRelevance, Response Groundedness, AnswerAccuracy, Faithfulness, AnswerCorrectness, SummaryScore) to BasePrompt by @anistark in #2443
  • feat: migrate final metrics (FactualCorrectness, NoiseSensitivity) to modular BasePrompt architecture and update docs by @anistark in #2444
  • chore: add COC by @anistark in #2437
  • docs: clarify MLflow is required, not optional in RAG evaluation guide by @anistark in #2447
  • chore: cleanup old patterns and update links by @anistark in #2449
  • chore: rebranding efforts by @jjmachan in #2445
  • feat: dual adapter support (Instructor + LiteLLM) by @anistark in #2446
  • fix: resolve InstructorLLM detection bug and add EvaluationDataset backend support for experiments by @anistark in #2451
  • fix: retrieved_contexts string filtering in LangChain integration by @dhyaneesh in #2452
  • fix: correct MultiTurnSample user_input validation logic by @harshil-sanghvi in #2426
  • fix: automatic embedding provider matching for LLMs by @anistark in #2454
  • fix: make GitPython an optional dependency by @anistark in #2453
  • docs: Update customizations how-to guides to use collections API and LLM factory by @sanjeed5 in #2425
  • fix: detect async clients in closures for instructor-wrapped litellm routers by @anistark in #2458
  • fix: quickstart by @anistark in #2463
  • chore: update calendar email by @anistark in #2462
  • fix: make GoogleEmbeddings handle GenerativeModel clients by auto-extracting genai module by @anistark in #2466
  • docs: add migration guide for v0.4 by @anistark in #2461

New Contributors

Full Changelog: v0.3.9...v0.4.0

v0.3.9

Choose a tag to compare

@anistark anistark released this 11 Nov 17:24
8b4653c

What's Changed

New Contributors

Full Changelog: v0.3.8...v0.3.9

v0.3.8

Choose a tag to compare

@anistark anistark released this 28 Oct 19:09
58f20a6

What's Changed

  • feat: semantic similarity migrated to collections by @anistark in #2361
  • feat: Add reusable testing infrastructure for metrics migration by @jjmachan in #2370
  • add: console scripts for ragas_examples by @anistark in #2367
  • feat: add quickstart cmd with templates to run by @anistark in #2374
  • fix: detect uvloop and skip nest_asyncio to prevent patching errors by @anistark in #2369
  • Remove import not used by @ChenyangLi4288 in #2364
  • Migrate answer_correctness by @rhlbhatnagar in #2365
  • Migrate context_entity_recall by @rhlbhatnagar in #2366
  • feat: aspect critic metric for coherence, harmfulness, maliciousness, correctness by @anistark in #2375
  • Fixed: NameError during evalutation of llamaindex query engine by @Prigoistic in #2331
  • Remove error suppressor in async_utils.py and engine.py by @ChenyangLi4288 in #2362
  • docs: clarify Context Relevance implementation differs from paper design by @anistark in #2378
  • fix: add missing metrics (ToolCallF1, ChrfScore) to sidebar and document deprecated ContextUtilization by @anistark in #2381
  • refactor: instructor_llm_factory merge with llm_factory by @anistark in #2382
  • fix: handle tuple-formatted entities in SingleHopSpecificQuerySynthesizer by @anistark in #2377
  • feat: simple criteria migrated to collections by @anistark in #2386
  • chore: remove deprecation warnings for LangchainLLMWrapper, LlamaIndexLLMWrapper, and embedding wrappers by @anistark in #2387

New Contributors

Full Changelog: v0.3.7...v0.3.8

v0.3.7

Choose a tag to compare

@jjmachan jjmachan released this 14 Oct 16:21
f31c365

What's Changed

  • refactor: improve metrics code quality by @anistark in #2337
  • chore: remove old analtyics by @jjmachan in #2338
  • Fix/query distribution robustness by @yatoyun in #2340
  • Simplify earlier how to guides in docs by @sanjeed5 in #2319
  • docs: reorganize prompt evaluation guides in navigation by @sanjeed5 in #2346
  • Metrics migration, migrate rouge + answer relevance by @rhlbhatnagar in #2335
  • fix: streamline theme extraction from overlaps in MultiHopSpecificQue… by @kenzoyan in #2347
  • Test/metric new compare by @anistark in #2349
  • feat: bleu score migrated to collections by @anistark in #2352
  • fix: Add List[List[str]] formats for overlapped items in theme extration (Continuation in #2347) by @kenzoyan in #2355
  • feat: string metrics migrated to collections by @anistark in #2356
  • feat: answer similarity migrated to collections by @anistark in #2358
  • fix: add missing props token_usage_parser for test generation methods #2359 by @bhkj9999 in #2360
  • feat: add bypass_n option to LangchainLLMWrapper for n-completion control by @SimFG in #2354
  • docs: Add how-to guide for aligning LLM-as-Judge by @sanjeed5 in #2348

New Contributors

Full Changelog: v0.3.6...v0.3.7

v0.3.6

Choose a tag to compare

@jjmachan jjmachan released this 03 Oct 03:56
49f47f1

What's Changed

New Contributors

Full Changelog: v0.3.5...v0.3.6

⌂ 换网址