The LangChain vs LlamaIndex comparison on OctoCounts shows side-by-side source line counts for langchain-ai/langchain and run-llama/llama_index, counted under the rules and on the dates stated below: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.
This page compares the source lines of code (SLOC) of langchain-ai/langchain and run-llama/llama_index using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.
As of 2026-11-15, langchain-ai/langchain contains 273,100 total lines (208,965 code) across 1,980 files, while run-llama/llama_index contains 402,567 total lines (307,351 code) across 4,419 files as of 2026-11-14. run-llama/llama_index has about 1.5x the counted code lines of langchain-ai/langchain under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.
| Metric | langchain-ai/langchain | run-llama/llama_index |
|---|---|---|
| Files | 1,980 | 4,419 |
| Total lines | 273,100 | 402,567 |
| Code lines | 208,965 | 307,351 |
| Comment lines | 27,650 | 34,174 |
| Blank lines | 36,485 | 61,042 |
| Languages counted | 9 | 13 |
Top languages in langchain-ai/langchain: Python (97.7% of code), TOML (1.5% of code), Makefile (0.6% of code). Top languages in run-llama/llama_index: Python (84.2% of code), TOML (11.7% of code), Makefile (2.3% of code). Python, TOML, Makefile appear in both top language lists; Shell, XSL appear only in langchain-ai/langchain's top languages; Jupyter Notebooks, JavaScript appear only in run-llama/llama_index's top languages.
Methodology: both counts come from cached OctoCounts reports generated with tokei. langchain-ai/langchain was counted at ref master (commit 583864017898) on 2026-11-15; run-llama/llama_index was counted at ref main (commit 99d7433f6f71) on 2026-11-14. See the counting methodology for ignored directories and analysis options.
Both reports use the same engine and effective counting rules. Repository declarations, when enabled, are specific to each repository. langchain-ai/langchain: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed. run-llama/llama_index: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.
Background observations recorded on 2026-09-16; language descriptions here are historical context, not claims about the current filtered shares. Use this page's measured language breakdown for current counts. Repository layout before counting filters: langchain-ai/langchain is the LangChain monorepo: Python and JavaScript/TypeScript packages for the framework, plus documentation and cookbook examples. run-llama/llama_index is the LlamaIndex monorepo: the Python core, integration packages, and the TypeScript library in one tree. Both are integration-heavy LLM application frameworks, counted with the rules shown above.
Both per-language tables are polyglot — Python alongside TypeScript on each side — because each project maintains parallel library code for the two ecosystems in a single repository.
A large share of each tree is integration packages connecting to third-party model, vector-store, and data providers; that share grows with ecosystem breadth rather than with the size of either framework's core, so the totals substantially count connector surface.
Repository size here mostly tracks how many external providers each framework integrates with, not the power of its core abstractions — and neither total measures retrieval quality, latency, or cost for your application.
Sources: langchain-ai/langchain repository (Python and JS/TS monorepo) · run-llama/llama_index repository (Python core and integrations). Statements verified 2026-09-16.
Evidence and next steps:
Saved reports remain subject to cache cleanup and replacement. Export their JSON for durable citation; live report URLs can change.
Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.
As of 2026-11-15, langchain-ai/langchain contains 273,100 total lines (208,965 code) across 1,980 files, while run-llama/llama_index contains 402,567 total lines (307,351 code) across 4,419 files as of 2026-11-14. run-llama/llama_index has about 1.5x the counted code lines of langchain-ai/langchain under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.
Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for langchain-ai/langchain, run-llama/llama_index, or any repository.
Methodology: both counts come from cached OctoCounts reports generated with tokei. langchain-ai/langchain was counted at ref master (commit 583864017898) on 2026-11-15; run-llama/llama_index was counted at ref main (commit 99d7433f6f71) on 2026-11-14. See the counting methodology for ignored directories and analysis options.
Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.