build: prune unused langchain packages, bound the langchain family - #1073
Merged
Conversation
Remove langchain-community and langchain-deepseek (zero imports; DeepSeek and xAI go through esperanto's OpenAI-compatible path, which uses langchain-openai). Declare langchain-core and langchain-text-splitters explicitly (directly imported, previously only transitive — the text-splitters import actually broke once langchain-community left the tree). Add upper bounds to the whole langchain/langgraph family and document why the provider packages must stay: esperanto's to_langchain() imports them dynamically and only declares them as optional extras.
Contributor
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
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
Audit of the eight
langchain-*provider packages inpyproject.toml. The suspicion was that most are unused because AI calls go through esperanto — the audit shows the opposite for six of them: esperanto'sto_langchain()imports the provider packages dynamically at runtime and declares them only as optional extras, so this app must pin them directly. Two packages, however, have zero importers anywhere and are removed.Audit table
to_langchain()langchain-openai<2langchain-anthropic<2langchain-ollama<2langchain-google-genai<5langchain-groq<2langchain-mistralai<2langchain-deepseekChatOpenAIlangchain-communityA comment block in
pyproject.tomlnow records this, so the next dependency audit doesn't re-litigate it.Transitive findings
uv tree --invertconfirms every provider package is required only byopen-notebookitself (langchain-openaiwas also pulled bylangchain-deepseek, itself removed). None of esperanto / podcast-creator / surreal-commands / ai-prompter / content-core require any of them.langchain-text-splitters(open_notebook/utils/chunking.py) — previously satisfied only vialangchain-community → langchain-classic; removing community actually broke the import until it was declared. This was a latent bug.langchain-core(imported in 10+ files) — previously satisfied vialangchain/langgraph.langchain-community,langchain-deepseek,langchain-classic,dataclasses-json,greenlet,sqlalchemy,marshmallow,typing-inspect, pluslangchain-text-splittersre-added as a direct dep.Upper bounds added (langchain/langgraph family only)
langchain <2,langchain-core <2,langchain-text-splitters <2,langgraph <2,langgraph-checkpoint-sqlite <4, and<2on the five 1.x provider packages /<5onlangchain-google-genai(4.x). No other dependencies touched.Verification
uv lock+uv syncclean (lockfile committed with the pyproject change)uv run pytest tests/— 403 passedruff check .— all checks passeduv run python -c "import commands; import api.main"OK (this is what caught thelangchain_text_splittersgap)