ollama/ollama
By the numbers
A quantitative snapshot of the ollama/ollama repository. Data collected on 2026-04-30 from git history and a find-based file scan that excludes the vendored llama.cpp tree.
Size
The Go codebase (excluding the vendored llama.cpp under llama/llama.cpp/) is roughly 267k lines across 772 Go files, of which 269 are tests. Counting C/C++/Objective-C/Metal/CUDA in the rest of the repo (still excluding vendored llama.cpp) brings the total to about 498k lines.
xychart-beta horizontal
title "Lines of code by category (excludes vendored llama.cpp)"
x-axis ["Go (production)", "Go (tests)", "C/C++/Metal/CUDA"]
y-axis "Lines" 0 --> 200000
bar [165000, 102000, 231000]The numbers above are approximate; production vs test Go split is derived from the _test.go filename convention.
| Statistic | Value |
|---|---|
| Go files | 772 |
| Go test files | 269 |
| Total Go lines | ~267,000 |
| Files containing TODO/FIXME/HACK | 107 |
| TODO/FIXME/HACK occurrences | ~201 |
| Unique authors (entire history) | ~602 |
| Tags released | many — newest at the time of writing is v0.22.1 |
Largest source files
| File | Lines |
|---|---|
middleware/anthropic_test.go |
3,006 |
cmd/launch/openclaw_test.go |
2,926 |
server/routes.go |
2,828 |
server/routes_generate_test.go |
2,690 |
cmd/launch/launch_test.go |
2,601 |
cmd/cmd.go |
2,469 |
x/imagegen/mlx/mlx.go |
2,389 |
x/create/create_test.go |
2,352 |
cmd/cmd_test.go |
2,279 |
The biggest production files are server/routes.go (2.8k lines holding every HTTP handler), cmd/cmd.go (the entire cobra command tree and most CLI logic), and x/imagegen/mlx/mlx.go (the MLX-based image-generation runner).
Activity
Commits per month over the last year (most recent on the right):
| Month | Commits |
|---|---|
| 2025-04 | 7 (partial — repo was being scanned mid-month) |
| 2025-05 | 105 |
| 2025-06 | 58 |
| 2025-07 | 46 |
| 2025-08 | 78 |
| 2025-09 | 88 |
| 2025-10 | 131 |
| 2025-11 | 106 |
| 2025-12 | 76 |
| 2026-01 | 107 |
| 2026-02 | 108 |
| 2026-03 | 124 |
| 2026-04 | 109 |
xychart-beta horizontal
title "Commits per month (last 12 months)"
x-axis ["2025-05","2025-06","2025-07","2025-08","2025-09","2025-10","2025-11","2025-12","2026-01","2026-02","2026-03","2026-04"]
y-axis "Commits" 0 --> 140
bar [105,58,46,78,88,131,106,76,107,108,124,109]The repo has settled into roughly 100 commits per month — about 25 per week — sustained over the year.
The last 90 days saw 349 commits distributed across cmd/launch/, server/, model/, and x/imagegen/ (the active feature areas).
Bot-attributed commits
A git log --pretty=%(trailers:key=Co-authored-by) scan finds 0 bot co-author trailers matching [bot] patterns (Dependabot, GitHub Actions, factory-droid, Copilot, etc.). This number is a lower bound on AI-assisted contributions: any inline assistance from tools that don't tag the commit (e.g., editor-side AI completion, paired-programming AI) is invisible to git.
Complexity
The largest production source files (above) double as complexity hotspots: server/routes.go and cmd/cmd.go each hold thousands of lines of branching logic and would be candidates for splitting if the team chose to.
The deepest CGO chain runs through llama/llama.go into llama/llama.cpp/.... Because llama.cpp is vendored, those source files stay isolated to a single Go package even though the underlying C++ tree contains hundreds of files.
Cleanup signal
There are roughly 201 TODO/FIXME/HACK comments spread across 107 files. This is the primary signal feeding cleanup-opportunities (not generated as a separate page in this run; the count is included here for visibility).
Caveats
- Lines-of-code numbers exclude the vendored llama.cpp under
llama/llama.cpp/, which would otherwise dwarf everything else. - Author counts are based on the email-deduplicated
git logauthor list and include external contributors as well as core maintainers. - The "by month" table groups commits by author date and may double-count commits that were rebased or cherry-picked.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.