An LLM agent that generates UML and activity diagrams from code.
Project description
DeepCodeGraph
DeepCodeGraph is an LLM agent that automatically generates UML and activity diagrams from codebases using PlantUML.
Installation
git clone https://github.com/rhochgraf21/DeepCodeGraph/
pip install -e codegraph
Usage
The codegraph tool is designed to analyze your code repositories by generating dependency graphs or exporting the repository structure.
Below are the details on how to use the available commands and options.
Commands
-
graph
Visualize a repository’s dependency graph. Graphs are generated using the public PlantUML server. -
export
Export the repository’s structure for further analysis of the agent progress.
Global Options
-
-h, --help
Show a help message and exit. -
-v, --verbose
Increase verbosity. This flag can be used multiple times for more detailed output. -
--api-key API_KEY
Specify your LLM API key. Alternatively, set theCODEGRAPH_API_KEYenvironment variable, or the API key environment variable for your provider as found in LiteLLM. -
--provider PROVIDER
Choose the LLM provider. The default provider isgemini. -
--model MODEL
Specify the model to use with the provider. The default isgemini-2.0-flash-exp. -
--path PATH
Required if not using--github. Provide the local filesystem path to your repository. -
--github GITHUB_URL
Required if not using--path. Provide the URL of the GitHub repository to analyze.
Example
To generate a dependency graph for a local repository located at /path/to/repo, run:
codegraph graph --path /path/to/repo
To analyze a GitHub repository, run:
codegraph graph --github https://github.com/username/repository
Run codegraph -h for more detailed information.
Note: You must provide either the --path option (for local repositories) or the --github option (for GitHub repositories). The GitHub functionality is provided to analyze repositories hosted on GitHub.
Supported Providers
DeepCodeGraph uses LiteLLM to provide access to models.
| Provider | Supported Models (Examples) | Documentation Link |
|---|---|---|
| OpenAI | gpt-4o, o3-mini, etc. |
OpenAI Docs |
| Anthropic | claude-3.7, claude-3.5, claude-3, etc. |
Anthropic Docs |
| Azure | OpenAI models via Azure | Azure Docs |
| Google Vertex AI | Various models from Google | Google Vertex Docs |
| Google Gemini (AI Studio) | gemini-2.0-pro, gemini-2.0-flash, etc. |
Google Gemini Docs |
| Mistral AI | mistral-small-latest, mistral-medium-latest, mixtral-8x7b, etc. |
Mistral AI Docs |
| AWS Bedrock | Various models from Anthropic, Meta, Deepseek, Mistral, Amazon, etc. | AWS Bedrock Docs |
| OpenRouter | Various models available through OpenRouter | OpenRouter Docs |
| Huggingface | Various open-source models from Huggingface | Huggingface Docs |
| Cohere | command-r-plus, command-r, command, etc. |
Cohere Docs |
| Ollama | Various models like mistral, gemma, llama3, etc. |
Ollama Docs |
| Groq | llama3-8b, gemma-7b, mixtral-8x7b, etc. |
Groq Docs |
To connect to a provider, set CODEGRAPH_CUSTOM_API_ENV=1 and the LiteLLM environment variables specified in the docs, or set CODEGRAPH_API_KEY.
For example, for Gemini on OpenRouter:
# custom setup [api key variable inferred]
export CODEGRAPH_CUSTOM_API_ENV=1
export GEMINI_API_KEY=<your_api_key>
# explicit api key
export CODEGRAPH_API_KEY=<your_api_key>
Then set the CODEGRAPH_LLM_PROVIDER and CODEGRAPH_LLM_MODEL environment variables.
export CODEGRAPH_LLM_PROVIDER=openrouter
export CODEGRAPH_LLM_MODEL=google/gemini-2.0-flash-lite-preview-02-05:free
Note: The API key variable will be inferred from the provided model and provider unless
CODEGRAPH_API_KEYis provided.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file deepcodegraph-0.1.0.tar.gz.
File metadata
- Download URL: deepcodegraph-0.1.0.tar.gz
- Upload date:
- Size: 20.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
38fdef646d1cbaef50689273f8e38c6782d8686f6820eae3755fd66bc01b5ea6
|
|
| MD5 |
3e67dc123df0472a12641375d2026a2f
|
|
| BLAKE2b-256 |
153b9b4c4917a1431de6963422ad7eb876d2f525d3b1a1ebf6379ecbabfc3c98
|
File details
Details for the file deepcodegraph-0.1.0-py3-none-any.whl.
File metadata
- Download URL: deepcodegraph-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd883d30225d90b4e05a734f0021f4d0cd134cb47b9d79fd0a47e457b5bf1d9b
|
|
| MD5 |
9fb0eba0d4d9451b211e2cb656ba1093
|
|
| BLAKE2b-256 |
a877aa2bb32e6779ec273f6a6c26cf53c92e665d20c42c3002d9264f432aafa0
|