RepoWhisper 0.0.1.dev1__tar.gz → 0.5.0b1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. repowhisper-0.5.0b1/LICENSE +21 -0
  2. repowhisper-0.5.0b1/MANIFEST.in +2 -0
  3. repowhisper-0.5.0b1/PKG-INFO +242 -0
  4. repowhisper-0.5.0b1/README.md +207 -0
  5. repowhisper-0.5.0b1/RepoWhisper.egg-info/PKG-INFO +242 -0
  6. repowhisper-0.5.0b1/RepoWhisper.egg-info/SOURCES.txt +47 -0
  7. repowhisper-0.5.0b1/RepoWhisper.egg-info/requires.txt +23 -0
  8. repowhisper-0.5.0b1/pyproject.toml +67 -0
  9. repowhisper-0.5.0b1/repowhisper/__init__.py +18 -0
  10. repowhisper-0.5.0b1/repowhisper/agents/architect.py +89 -0
  11. repowhisper-0.5.0b1/repowhisper/agents/base_agent.py +93 -0
  12. repowhisper-0.5.0b1/repowhisper/agents/navigator.py +125 -0
  13. repowhisper-0.5.0b1/repowhisper/agents/package_summarizer.py +54 -0
  14. repowhisper-0.5.0b1/repowhisper/agents/reviewer.py +419 -0
  15. repowhisper-0.5.0b1/repowhisper/agents/storyteller.py +71 -0
  16. repowhisper-0.5.0b1/repowhisper/analysis/__init__.py +0 -0
  17. repowhisper-0.5.0b1/repowhisper/analysis/dependency_tracer.py +92 -0
  18. repowhisper-0.5.0b1/repowhisper/analysis/facts_extractor.py +520 -0
  19. repowhisper-0.5.0b1/repowhisper/analysis/tracers/__init__.py +0 -0
  20. repowhisper-0.5.0b1/repowhisper/analysis/tracers/base_tracer.py +33 -0
  21. repowhisper-0.5.0b1/repowhisper/analysis/tracers/python_tracer.py +76 -0
  22. repowhisper-0.5.0b1/repowhisper/analysis/tree_generator.py +112 -0
  23. repowhisper-0.5.0b1/repowhisper/grounding/__init__.py +0 -0
  24. repowhisper-0.5.0b1/repowhisper/grounding/evidence_packer.py +252 -0
  25. repowhisper-0.5.0b1/repowhisper/grounding/grounding_verifier.py +140 -0
  26. repowhisper-0.5.0b1/repowhisper/ingestion/__init__.py +0 -0
  27. repowhisper-0.5.0b1/repowhisper/ingestion/source_manager.py +60 -0
  28. repowhisper-0.5.0b1/repowhisper/laya_reviewer_calibration/calibration.json +105 -0
  29. repowhisper-0.5.0b1/repowhisper/laya_reviewer_calibration/heads.npz +0 -0
  30. repowhisper-0.5.0b1/repowhisper/laya_reviewer_calibration/manifest.json +9 -0
  31. repowhisper-0.5.0b1/repowhisper/orchestration/__init__.py +0 -0
  32. repowhisper-0.5.0b1/repowhisper/orchestration/state.py +41 -0
  33. repowhisper-0.5.0b1/repowhisper/orchestration/workflow.py +464 -0
  34. repowhisper-0.5.0b1/repowhisper/repowhisper.py +219 -0
  35. repowhisper-0.5.0b1/repowhisper/schemas/__init__.py +0 -0
  36. repowhisper-0.5.0b1/repowhisper/schemas/analysis_schema.py +64 -0
  37. repowhisper-0.5.0b1/repowhisper/ui_dist/assets/index-7ooFhLod.js +52 -0
  38. repowhisper-0.5.0b1/repowhisper/ui_dist/assets/index-jvDCWrnY.css +2 -0
  39. repowhisper-0.5.0b1/repowhisper/ui_dist/index.html +15 -0
  40. repowhisper-0.5.0b1/repowhisper/ui_dist/logo.png +0 -0
  41. repowhisper-0.5.0b1/repowhisper/ui_dist/logo_sfondo_blu.png +0 -0
  42. repowhisper-0.5.0b1/repowhisper/utils/__init__.py +0 -0
  43. repowhisper-0.5.0b1/repowhisper/utils/config.py +10 -0
  44. repowhisper-0.5.0b1/repowhisper/utils/exceptions.py +42 -0
  45. repowhisper-0.5.0b1/repowhisper/utils/token_budget.py +43 -0
  46. {repowhisper-0.0.1.dev1 → repowhisper-0.5.0b1}/setup.cfg +4 -4
  47. repowhisper-0.0.1.dev1/PKG-INFO +0 -10
  48. repowhisper-0.0.1.dev1/README.md +0 -3
  49. repowhisper-0.0.1.dev1/RepoWhisper.egg-info/PKG-INFO +0 -10
  50. repowhisper-0.0.1.dev1/RepoWhisper.egg-info/SOURCES.txt +0 -7
  51. repowhisper-0.0.1.dev1/pyproject.toml +0 -10
  52. {repowhisper-0.0.1.dev1 → repowhisper-0.5.0b1}/RepoWhisper.egg-info/dependency_links.txt +0 -0
  53. {repowhisper-0.0.1.dev1 → repowhisper-0.5.0b1}/RepoWhisper.egg-info/top_level.txt +0 -0
  54. {repowhisper-0.0.1.dev1/repowhisper → repowhisper-0.5.0b1/repowhisper/agents}/__init__.py +0 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Andrea Difino
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,2 @@
1
+ prune repowhisper-ui/node_modules
2
+ exclude repowhisper/main.py
@@ -0,0 +1,242 @@
1
+ Metadata-Version: 2.4
2
+ Name: RepoWhisper
3
+ Version: 0.5.0b1
4
+ Summary: An enterprise multi-agent AI pipeline to document and analyze Python repositories.
5
+ Author-email: Andrea Difino <adifino13@gmail.com>
6
+ License-Expression: MIT
7
+ Keywords: documentation,ai,langgraph,langchain,agents,ast
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Documentation
11
+ Classifier: Programming Language :: Python :: 3.12
12
+ Requires-Python: <3.13,>=3.12
13
+ Description-Content-Type: text/markdown
14
+ License-File: LICENSE
15
+ Requires-Dist: chardet>=7.7.0
16
+ Requires-Dist: python-dotenv>=1.0.0
17
+ Requires-Dist: gitpython>=3.2.1
18
+ Requires-Dist: langchain>=1.4.7
19
+ Requires-Dist: langgraph>=1.2.18
20
+ Requires-Dist: torch>=2.5.0
21
+ Requires-Dist: laya>=0.4.38
22
+ Requires-Dist: pydantic>=2.14.2
23
+ Requires-Dist: tqdm>=4.70.1
24
+ Requires-Dist: tree-sitter>=0.26.0
25
+ Requires-Dist: tree-sitter-languages>=1.10.2
26
+ Provides-Extra: groq
27
+ Requires-Dist: langchain-groq>=1.1.3; extra == "groq"
28
+ Provides-Extra: ollama
29
+ Requires-Dist: langchain-ollama>=1.1.0; extra == "ollama"
30
+ Provides-Extra: openai
31
+ Requires-Dist: langchain-openai>=1.8.0; extra == "openai"
32
+ Provides-Extra: anthropic
33
+ Requires-Dist: langchain-anthropic>=1.7.10; extra == "anthropic"
34
+ Dynamic: license-file
35
+
36
+ <div align="center">
37
+ <img src="imgs/badge_2.png" alt="RepoWhisper" width="700">
38
+
39
+ ### Turn an unfamiliar Python repository into an interactive, AI-guided study journey.
40
+
41
+ <p>
42
+ <a href="https://pypi.org/project/repowhisper/"><img src="https://static.pepy.tech/personalized-badge/repowhisper?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=yellow&left_text=downloads" alt="PyPI downloads"></a>
43
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.12-blue.svg" alt="Python 3.12"></a>
44
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License"></a>
45
+ <a href="https://andrea-difino.github.io/RepoWhisper/docs/"><img src="https://img.shields.io/badge/docs-MkDocs-526CFE.svg" alt="Documentation"></a>
46
+ </p>
47
+
48
+ <p>
49
+ <a href="https://andrea-difino.github.io/RepoWhisper/"><strong>🌐 Website</strong></a> •
50
+ <a href="https://andrea-difino.github.io/RepoWhisper/docs/"><strong>📚 Documentation</strong></a> •
51
+ <a href="https://pypi.org/project/repowhisper/"><strong>📦 PyPI</strong></a>
52
+ </p>
53
+
54
+ **Map the architecture. Inspect every file. Learn with your own model.**
55
+ </div>
56
+
57
+
58
+ ## A new codebase shouldn't feel like a puzzle
59
+
60
+ Joining a new team or diving into an open-source project usually starts the same way: the real architecture lives in people's heads, the docs are months out of date, and your first contribution begins with hours of clicking through imports and hidden assumptions.
61
+
62
+ **RepoWhisper gives you the map before you take the first step.**
63
+
64
+ Paste a public GitHub repository URL, plug in any LangChain-compatible LLM you prefer, and pick your seniority level. RepoWhisper currently analyzes **Python (`.py`) codebases** and launches a **local interactive study interface**—walking you from high-level system boundaries down to line-by-line insights.
65
+
66
+ > [!IMPORTANT]
67
+ > **Python only for now.** RepoWhisper supports Python source and Python import analysis. It does not currently provide equivalent analysis for JavaScript, TypeScript, Java, Go, Rust, or other languages.
68
+
69
+
70
+ ## One repository. Four specialists. One clear story.
71
+
72
+ Instead of dumping raw files into a single giant prompt, RepoWhisper orchestrates a **LangGraph multi-agent pipeline** where specialized agents collaborate and verify each other's work:
73
+
74
+ * **Architect** — Builds a grounded architectural overview from static facts, the project tree, and budgeted module notes.
75
+ * **Navigator** — Reads selected Python source files in dependency order, writing technical explanations and pinpointing critical lines (`notes`).
76
+ * **Laya Reviewer** — A local, calibrated Laya/Vega classifier acts as a zero-token quality gate and sends debugging-focused drafts back for revision.
77
+ * **Storyteller** — Weaves the static facts, approved module findings, and architect draft into a cohesive, human-readable narrative.
78
+
79
+ > [!TIP]
80
+ > **Adaptive Depth (`UserLevel`):** Tailor the entire analysis to your background—choose **`JUNIOR`** for step-by-step mental models, **`MID`** for data contracts and error boundaries, or **`SENIOR`** for concise, high-signal architectural trade-offs.
81
+
82
+ ---
83
+
84
+ ## How it works under the hood
85
+
86
+ 1. **Clone & Trace:** Fetches the GitHub repository and resolves Python import dependencies so Python modules are analyzed in logical order.
87
+ 2. **Navigate & Review:** Explains each selected Python file, shares dependency summaries with later modules, and uses the local Laya Reviewer to flag debugging-oriented drafts.
88
+ 3. **Extract & Ground:** Computes static Python facts, import centrality, package metadata, README context, and CI workflow facts; then packs module evidence into a bounded token context.
89
+ 4. **Architect & Narrate:** Builds a grounded architecture overview and final narrative, regenerating once if code references cannot be verified.
90
+ 5. **Validate & Study:** Enforces a strict Pydantic schema on the output JSON and opens the interactive React viewer in your browser.
91
+
92
+
93
+ ## Bring Your Own Model. Skip the AI Tax.
94
+
95
+ Deep repository analysis is token-heavy: a single multi-agent pass with review loops easily consumes **~150,000 tokens**.
96
+
97
+ Commercial AI coding tools lock you into pricey subscriptions or markups. **RepoWhisper decouples the workflow from the model:**
98
+
99
+ * 🏠 **Local models (Ollama)** — $0 cost, 100% private, offline-friendly.
100
+ * ⚡ **Free-tier APIs (Groq)** — Blazing-fast inference at zero or near-zero cost.
101
+ * 🚀 **Frontier APIs (OpenAI, Anthropic)** — Maximum reasoning power whenever you need it.
102
+
103
+ ### Estimated cost comparison (~150,000 tokens per repo)
104
+
105
+ Based on typical frontier API pricing (~\$4–\$5 / 1M input tokens and \$20–\$30 / 1M output tokens, assuming an 80/20 input-to-output split), a single 150k-token repository analysis costs roughly **\$1.10–\$1.50**—which quickly adds up to **\$110–\$150** across 100 analyses.
106
+
107
+ > [!NOTE]
108
+ > Actual results depend on your chosen model and provider limits. Smaller free or local models dramatically cut costs, while frontier proprietary models deliver the deepest reasoning on complex codebases.
109
+
110
+ ---
111
+
112
+ ## Get started in minutes
113
+
114
+ **Prerequisites:** Python 3.12, Git, and an API key (or local Ollama instance) for any LangChain-compatible provider.
115
+ On the first run, the Laya Reviewer downloads and caches its Vega reader and backbone model. Review itself runs locally and does not consume LLM tokens.
116
+
117
+ ### 1. Install from PyPI
118
+
119
+ ```bash
120
+ pip install repowhisper
121
+ ```
122
+
123
+ Install the extra for your preferred LLM provider:
124
+
125
+ ```bash
126
+ pip install "repowhisper[groq]" # Fast inference with free tier
127
+ pip install "repowhisper[ollama]" # 100% local & private
128
+ pip install "repowhisper[openai]" # GPT models
129
+ pip install "repowhisper[anthropic]" # Claude models
130
+ ```
131
+
132
+ ### 2. Run your first analysis
133
+
134
+ Add your API key to a `.env` file:
135
+
136
+ ```env
137
+ GROQ_API_KEY=your_key_here
138
+ ```
139
+
140
+ Inject your model into the `RepoWhisper` facade and launch the interactive UI:
141
+
142
+ ```python
143
+ import os
144
+ from dotenv import load_dotenv
145
+ from langchain_groq import ChatGroq
146
+ from pydantic import SecretStr
147
+ from repowhisper import RepoWhisper, RepoWhisperError, UserLevel
148
+
149
+ load_dotenv()
150
+
151
+ llm = ChatGroq(
152
+ api_key=SecretStr(os.environ["GROQ_API_KEY"]),
153
+ model="openai/gpt-oss-20b",
154
+ max_tokens=6000,
155
+ max_retries=0, # Let RepoWhisper handle rate-limit cooldowns gracefully
156
+ )
157
+
158
+ engine = RepoWhisper(
159
+ source_target="https://github.com/owner/repository",
160
+ llm=llm,
161
+ user_level=UserLevel.MID,
162
+ )
163
+
164
+ # Generates the validated report and opens http://127.0.0.1:8543
165
+ try:
166
+ engine.analyze()
167
+ except RepoWhisperError as e:
168
+ print(f"An error occured during the analysis: {e}")
169
+ ```
170
+
171
+ #### Export JSON or reopen a saved study session
172
+
173
+ ```python
174
+ # Export the validated JSON string directly
175
+ report_json = engine.generate_documentation()
176
+
177
+ # Or reopen a previously generated JSON report without re-running the LLM
178
+ engine.analyze(json_path="path/to/report.json")
179
+ ```
180
+
181
+ For full setup guides, see the [Quick Start Documentation](https://andrea-difino.github.io/RepoWhisper/docs/).
182
+
183
+
184
+ ## The Study Experience
185
+
186
+ Every run produces a structured, interactive learning workspace in your browser:
187
+
188
+ * **Executive Architectural Narrative** — Understand the big picture before reading a single line of code.
189
+ * **Interactive File Tree** — Navigate modules in logical dependency order.
190
+ * **Split-Screen Code & Explanation** — Read clean, flowing technical prose right alongside the syntax-highlighted source code.
191
+ * **Line-Level Whispers** — Click highlighted lines to reveal targeted insights, edge cases, and gotchas.
192
+ * **Progress Tracking & Keyboard Shortcuts** — Mark modules as studied and move effortlessly through the codebase.
193
+
194
+ ### Clean, Pydantic-validated JSON schema
195
+
196
+ ```json
197
+ {
198
+ "title": "RepoWhisper Analysis",
199
+ "tree_structure": "├── src/\n│ └── example.py",
200
+ "narrative": "## Architectural Overview...",
201
+ "raw_modules": [
202
+ {
203
+ "file": "src/example.py",
204
+ "explanation": "Flowing technical explanation tailored to your UserLevel...",
205
+ "code_snippet": "def process(data):\n ...",
206
+ "notes": {
207
+ "11": "Important implementation detail or edge case."
208
+ }
209
+ }
210
+ ]
211
+ }
212
+ ```
213
+
214
+
215
+ ## Current Scope & Boundaries
216
+
217
+ RepoWhisper is actively evolving and transparent about its current design:
218
+
219
+ * **Language Support:** RepoWhisper is currently for **Python code analysis only**. Dependency tracing and static facts are Python-specific.
220
+ * **Repository Sources:** Supports public **GitHub HTTP(S) repository URLs**. Local paths are not accepted by the source manager.
221
+ * **Token & Rate Limits:** Large repositories require more time and tokens; built-in rate-limit handling automatically paces requests on free tiers.
222
+ * **Local UI:** The React study interface is designed to run locally on your machine.
223
+
224
+
225
+ ## Contributing & Development
226
+
227
+ RepoWhisper is maintained independently alongside academic research. Contributions, bug reports, and small, focused pull requests are very welcome!
228
+
229
+ ```bash
230
+ git clone https://github.com/Andrea-Difino/RepoWhisper.git
231
+ cd RepoWhisper
232
+ uv sync --group dev
233
+ uv run pytest -q
234
+ ```
235
+
236
+ 1. Open an issue first to discuss new features or architectural changes.
237
+ 2. Keep pull requests small and focused on a single concern.
238
+ 3. Add or update unit tests and verify everything passes with `uv run pytest -q`.
239
+
240
+ ---
241
+
242
+ Distributed under the **MIT License**. See [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,207 @@
1
+ <div align="center">
2
+ <img src="imgs/badge_2.png" alt="RepoWhisper" width="700">
3
+
4
+ ### Turn an unfamiliar Python repository into an interactive, AI-guided study journey.
5
+
6
+ <p>
7
+ <a href="https://pypi.org/project/repowhisper/"><img src="https://static.pepy.tech/personalized-badge/repowhisper?period=total&units=INTERNATIONAL_SYSTEM&left_color=GRAY&right_color=yellow&left_text=downloads" alt="PyPI downloads"></a>
8
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/python-3.12-blue.svg" alt="Python 3.12"></a>
9
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License"></a>
10
+ <a href="https://andrea-difino.github.io/RepoWhisper/docs/"><img src="https://img.shields.io/badge/docs-MkDocs-526CFE.svg" alt="Documentation"></a>
11
+ </p>
12
+
13
+ <p>
14
+ <a href="https://andrea-difino.github.io/RepoWhisper/"><strong>🌐 Website</strong></a> •
15
+ <a href="https://andrea-difino.github.io/RepoWhisper/docs/"><strong>📚 Documentation</strong></a> •
16
+ <a href="https://pypi.org/project/repowhisper/"><strong>📦 PyPI</strong></a>
17
+ </p>
18
+
19
+ **Map the architecture. Inspect every file. Learn with your own model.**
20
+ </div>
21
+
22
+
23
+ ## A new codebase shouldn't feel like a puzzle
24
+
25
+ Joining a new team or diving into an open-source project usually starts the same way: the real architecture lives in people's heads, the docs are months out of date, and your first contribution begins with hours of clicking through imports and hidden assumptions.
26
+
27
+ **RepoWhisper gives you the map before you take the first step.**
28
+
29
+ Paste a public GitHub repository URL, plug in any LangChain-compatible LLM you prefer, and pick your seniority level. RepoWhisper currently analyzes **Python (`.py`) codebases** and launches a **local interactive study interface**—walking you from high-level system boundaries down to line-by-line insights.
30
+
31
+ > [!IMPORTANT]
32
+ > **Python only for now.** RepoWhisper supports Python source and Python import analysis. It does not currently provide equivalent analysis for JavaScript, TypeScript, Java, Go, Rust, or other languages.
33
+
34
+
35
+ ## One repository. Four specialists. One clear story.
36
+
37
+ Instead of dumping raw files into a single giant prompt, RepoWhisper orchestrates a **LangGraph multi-agent pipeline** where specialized agents collaborate and verify each other's work:
38
+
39
+ * **Architect** — Builds a grounded architectural overview from static facts, the project tree, and budgeted module notes.
40
+ * **Navigator** — Reads selected Python source files in dependency order, writing technical explanations and pinpointing critical lines (`notes`).
41
+ * **Laya Reviewer** — A local, calibrated Laya/Vega classifier acts as a zero-token quality gate and sends debugging-focused drafts back for revision.
42
+ * **Storyteller** — Weaves the static facts, approved module findings, and architect draft into a cohesive, human-readable narrative.
43
+
44
+ > [!TIP]
45
+ > **Adaptive Depth (`UserLevel`):** Tailor the entire analysis to your background—choose **`JUNIOR`** for step-by-step mental models, **`MID`** for data contracts and error boundaries, or **`SENIOR`** for concise, high-signal architectural trade-offs.
46
+
47
+ ---
48
+
49
+ ## How it works under the hood
50
+
51
+ 1. **Clone & Trace:** Fetches the GitHub repository and resolves Python import dependencies so Python modules are analyzed in logical order.
52
+ 2. **Navigate & Review:** Explains each selected Python file, shares dependency summaries with later modules, and uses the local Laya Reviewer to flag debugging-oriented drafts.
53
+ 3. **Extract & Ground:** Computes static Python facts, import centrality, package metadata, README context, and CI workflow facts; then packs module evidence into a bounded token context.
54
+ 4. **Architect & Narrate:** Builds a grounded architecture overview and final narrative, regenerating once if code references cannot be verified.
55
+ 5. **Validate & Study:** Enforces a strict Pydantic schema on the output JSON and opens the interactive React viewer in your browser.
56
+
57
+
58
+ ## Bring Your Own Model. Skip the AI Tax.
59
+
60
+ Deep repository analysis is token-heavy: a single multi-agent pass with review loops easily consumes **~150,000 tokens**.
61
+
62
+ Commercial AI coding tools lock you into pricey subscriptions or markups. **RepoWhisper decouples the workflow from the model:**
63
+
64
+ * 🏠 **Local models (Ollama)** — $0 cost, 100% private, offline-friendly.
65
+ * ⚡ **Free-tier APIs (Groq)** — Blazing-fast inference at zero or near-zero cost.
66
+ * 🚀 **Frontier APIs (OpenAI, Anthropic)** — Maximum reasoning power whenever you need it.
67
+
68
+ ### Estimated cost comparison (~150,000 tokens per repo)
69
+
70
+ Based on typical frontier API pricing (~\$4–\$5 / 1M input tokens and \$20–\$30 / 1M output tokens, assuming an 80/20 input-to-output split), a single 150k-token repository analysis costs roughly **\$1.10–\$1.50**—which quickly adds up to **\$110–\$150** across 100 analyses.
71
+
72
+ > [!NOTE]
73
+ > Actual results depend on your chosen model and provider limits. Smaller free or local models dramatically cut costs, while frontier proprietary models deliver the deepest reasoning on complex codebases.
74
+
75
+ ---
76
+
77
+ ## Get started in minutes
78
+
79
+ **Prerequisites:** Python 3.12, Git, and an API key (or local Ollama instance) for any LangChain-compatible provider.
80
+ On the first run, the Laya Reviewer downloads and caches its Vega reader and backbone model. Review itself runs locally and does not consume LLM tokens.
81
+
82
+ ### 1. Install from PyPI
83
+
84
+ ```bash
85
+ pip install repowhisper
86
+ ```
87
+
88
+ Install the extra for your preferred LLM provider:
89
+
90
+ ```bash
91
+ pip install "repowhisper[groq]" # Fast inference with free tier
92
+ pip install "repowhisper[ollama]" # 100% local & private
93
+ pip install "repowhisper[openai]" # GPT models
94
+ pip install "repowhisper[anthropic]" # Claude models
95
+ ```
96
+
97
+ ### 2. Run your first analysis
98
+
99
+ Add your API key to a `.env` file:
100
+
101
+ ```env
102
+ GROQ_API_KEY=your_key_here
103
+ ```
104
+
105
+ Inject your model into the `RepoWhisper` facade and launch the interactive UI:
106
+
107
+ ```python
108
+ import os
109
+ from dotenv import load_dotenv
110
+ from langchain_groq import ChatGroq
111
+ from pydantic import SecretStr
112
+ from repowhisper import RepoWhisper, RepoWhisperError, UserLevel
113
+
114
+ load_dotenv()
115
+
116
+ llm = ChatGroq(
117
+ api_key=SecretStr(os.environ["GROQ_API_KEY"]),
118
+ model="openai/gpt-oss-20b",
119
+ max_tokens=6000,
120
+ max_retries=0, # Let RepoWhisper handle rate-limit cooldowns gracefully
121
+ )
122
+
123
+ engine = RepoWhisper(
124
+ source_target="https://github.com/owner/repository",
125
+ llm=llm,
126
+ user_level=UserLevel.MID,
127
+ )
128
+
129
+ # Generates the validated report and opens http://127.0.0.1:8543
130
+ try:
131
+ engine.analyze()
132
+ except RepoWhisperError as e:
133
+ print(f"An error occured during the analysis: {e}")
134
+ ```
135
+
136
+ #### Export JSON or reopen a saved study session
137
+
138
+ ```python
139
+ # Export the validated JSON string directly
140
+ report_json = engine.generate_documentation()
141
+
142
+ # Or reopen a previously generated JSON report without re-running the LLM
143
+ engine.analyze(json_path="path/to/report.json")
144
+ ```
145
+
146
+ For full setup guides, see the [Quick Start Documentation](https://andrea-difino.github.io/RepoWhisper/docs/).
147
+
148
+
149
+ ## The Study Experience
150
+
151
+ Every run produces a structured, interactive learning workspace in your browser:
152
+
153
+ * **Executive Architectural Narrative** — Understand the big picture before reading a single line of code.
154
+ * **Interactive File Tree** — Navigate modules in logical dependency order.
155
+ * **Split-Screen Code & Explanation** — Read clean, flowing technical prose right alongside the syntax-highlighted source code.
156
+ * **Line-Level Whispers** — Click highlighted lines to reveal targeted insights, edge cases, and gotchas.
157
+ * **Progress Tracking & Keyboard Shortcuts** — Mark modules as studied and move effortlessly through the codebase.
158
+
159
+ ### Clean, Pydantic-validated JSON schema
160
+
161
+ ```json
162
+ {
163
+ "title": "RepoWhisper Analysis",
164
+ "tree_structure": "├── src/\n│ └── example.py",
165
+ "narrative": "## Architectural Overview...",
166
+ "raw_modules": [
167
+ {
168
+ "file": "src/example.py",
169
+ "explanation": "Flowing technical explanation tailored to your UserLevel...",
170
+ "code_snippet": "def process(data):\n ...",
171
+ "notes": {
172
+ "11": "Important implementation detail or edge case."
173
+ }
174
+ }
175
+ ]
176
+ }
177
+ ```
178
+
179
+
180
+ ## Current Scope & Boundaries
181
+
182
+ RepoWhisper is actively evolving and transparent about its current design:
183
+
184
+ * **Language Support:** RepoWhisper is currently for **Python code analysis only**. Dependency tracing and static facts are Python-specific.
185
+ * **Repository Sources:** Supports public **GitHub HTTP(S) repository URLs**. Local paths are not accepted by the source manager.
186
+ * **Token & Rate Limits:** Large repositories require more time and tokens; built-in rate-limit handling automatically paces requests on free tiers.
187
+ * **Local UI:** The React study interface is designed to run locally on your machine.
188
+
189
+
190
+ ## Contributing & Development
191
+
192
+ RepoWhisper is maintained independently alongside academic research. Contributions, bug reports, and small, focused pull requests are very welcome!
193
+
194
+ ```bash
195
+ git clone https://github.com/Andrea-Difino/RepoWhisper.git
196
+ cd RepoWhisper
197
+ uv sync --group dev
198
+ uv run pytest -q
199
+ ```
200
+
201
+ 1. Open an issue first to discuss new features or architectural changes.
202
+ 2. Keep pull requests small and focused on a single concern.
203
+ 3. Add or update unit tests and verify everything passes with `uv run pytest -q`.
204
+
205
+ ---
206
+
207
+ Distributed under the **MIT License**. See [`LICENSE`](LICENSE) for details.