fix: pin langchain-community<0.4 to restore ragas judge import#47
Merged
Conversation
ragas 0.4.3 hard-imports langchain_community.chat_models.vertexai and langchain_community.llms.VertexAI at module load time (ragas/llms/base.py), even though LocalRAG's eval runner only uses the openai-compatible client against local Ollama and never touches LangChain directly. That vertexai submodule was dropped in langchain-community's 0.4 provider-split, so any resolution picking langchain-community>=0.4 (transitively pulled in by ragas, which has no upper bound) breaks import at `from ragas.llms import llm_factory` with ModuleNotFoundError. Pinning langchain-community<0.4 resolves to 0.3.31, which still ships the vertexai submodule ragas needs. Reproduced and verified fixed locally: `uv run python -c "import ragas"` now succeeds. Claude-Session: https://claude.ai/code/session_01NFJtv7kyDmx4W8u76WW9EC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ragas0.4.3 hard-importslangchain_community.chat_models.vertexai/.llms.VertexAIat module load time, even though LocalRAG's eval runner (evals/run_evals.py) only uses the OpenAI-compatible client against local Ollama and never touches LangChainlangchain-community's 0.4 provider-split;ragas>=0.4.3has no upper bound onlangchain-community, so recent lockfile resolution picked 0.4.2 and broke the import (ModuleNotFoundError: No module named 'langchain_community.chat_models.vertexai')langchain-community<0.4inpyproject.toml, which resolves to 0.3.31 — still ships the vertexai submodule ragas needsTest plan
ModuleNotFoundErrorlocally before the fixuv lockresolves cleanly with the new constraint (langchain-community 0.4.2 -> 0.3.31)uv run python -c "import ragas"succeeds afteruv syncevals/run_evals.py --offlinerun against local Ollama judge (gemma3:4b) is slow on CPU-only inference on this machine (GPU passthrough not yet configured — separate follow-up) — import-level fix verified, full eval run not completed end-to-end locally. CI's "offline" RAGAS job should be the first full confirmation.https://claude.ai/code/session_01NFJtv7kyDmx4W8u76WW9EC