Skip to content

allenanswerzq/llmcc

Repository files navigation

llmcc

"Prompts are the modern assembly language, models are the modern CPU."

llmcc is a universal context builder for any language, any document.

abstract

llmcc explores automated context generation through symbolic graph analysis. bridging the semantic gap between human-written code/documents and AI model understanding, using modern compiler design principles.

design

llmcc design diagram

examples

Install with: cargo install llmcc

llmcc --dir codex/codex-rs --lang rust --design-graph --pagerank --top-k 100

codex: graph

llmcc --dir kimi-cli --lang python --design-graph --pagerank --top-k 80

kimi-cli: graph

llmcc --design-graph --pagerank --top-k 100 --lang python --dir scikit-learn

scikit-learn: graph

llmcc --design-graph --pagerank --top-k 100 --lang rust --dir ripgrep

ripgrep: graph

llmcc --design-graph --pagerank --top-k 100 --lang rust --dir tokio

tokio: graph

run

llmcc [OPTIONS] < --file <FILE>...|--dir <DIR>... >

Input (required, one of):

  • -f, --file <FILE>... — Individual files to compile (repeatable)
  • -d, --dir <DIR>... — Directories to scan recursively (repeatable)

Language (optional):

  • --lang <LANG> — Language: 'rust' or 'python' [default: rust]

Analysis (optional):

  • --design-graph — Generate high-level design graph
  • --pagerank --top-k <K> — Rank by importance (PageRank) and limit to top K
  • --query <NAME> — Symbol/function to analyze
  • --depends — Show what the symbol depends on
  • --dependents — Show what depends on the symbol
  • --recursive — Include transitive dependencies (vs. direct only)

Output format (optional):

  • --summary — Show file paths and line ranges (vs. full code texts)
  • --print-ir — Internal: print intermediate representation
  • --print-block — Internal: print basic block graph

Examples:

# Design graph with PageRank ranking
llmcc --dir crates --lang rust --design-graph --pagerank --top-k 100

# Dependencies and dependents of a symbol
llmcc --dir crates --lang rust --query CompileCtxt --depends
llmcc --dir crates --lang rust --query CompileCtxt --dependents --recursive

# Cross-directory analysis
llmcc --dir crates/llmcc-core/src --dir crates/llmcc-rust/src --lang rust --design-graph --pagerank --top-k 25

# Multiple files
llmcc --file crates/llmcc/src/main.rs --file crates/llmcc/src/lib.rs --lang rust --query run_main

python

Install the published package from PyPI:

pip install llmcc

With the package available, invoke the API directly:

import llmcc

help(llmcc.run)

output = llmcc.run(
	dirs=["crates/llmcc-core/src"],
	lang="rust",
	query="CompileCtxt",
	depends=True,
	summary=True,
)
print(output)

testing

llmcc-test provides a corpus-style harness (similar to tree-sitter) for end-to-end parser+resolver checks. See doc/testing.md for the file format and CLI usage.

About

llmcc is a universal context builder for any programming language, any document (wip)

Resources

License

Stars

Watchers

Forks

Packages

No packages published