UMLBot is an interactive tool for generating, revising, and validating UML diagrams using a chat-based workflow powered by LLMs. The system supports iterative UML refinement, automatic error correction, and transparent error reporting, all accessible through a conversational interface. This code is release in conjuction with publication submission to SoftwareX.
-
Chat-Based UML Revision Workflow:
Interactively describe, generate, and refine UML diagrams via a chat interface. The system supports iterative feedback, allowing users to request changes, corrections, or enhancements in natural language. -
Generic Error Handler:
All errors (LLM, prompt, PlantUML rendering, network, etc.) are captured and surfaced to the user with actionable messages. The error handler provides fallback behaviors and clear status updates, ensuring a robust user experience. -
Automated Error Correction:
When UML code or rendering fails, the system attempts to auto-correct issues using LLM-based repair strategies, with user feedback and transparency. -
Flexible UI:
Accessible via Gradio (and Streamlit) interfaces, supporting free-text input, diagram type selection, and theme customization.
From the project root:
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install pip setuptools wheel
python3 -m pip install -e .For development:
python3 -m pip install -e ".[dev]"LLM credentials resolve through aiweb_common.manage_sensitive(), which checks
in order: /run/secrets (compose secrets), /workspaces/*/secrets
(devcontainer), /mnt/p/Secrets (shared team mount), then environment
variables. Two supported workflows:
- Shared secrets mount (default): if
/mnt/p/Secrets/azure_proxy_key.txtand/mnt/p/Secrets/azure_proxy_endpoint.txtexist, no configuration is needed —docker compose upmounts them as compose secrets andmake runreads the mount directly. - .env (off-network / no mount):
cp .env.example .envand fill inazure_proxy_key/azure_proxy_endpoint. For Docker, switch each secret indocker-compose.ymlfrom itsfile:source to itsenvironment:source (instructions are in both files).
docker compose up --build- Backend API: http://localhost:8000 (override host port with
UMLBOT_API_PORT) - Streamlit frontend: http://localhost:8501 (override with
UMLBOT_STREAMLIT_PORT)
The single image bundles Python, a JRE, and the PlantUML JAR — there is no
separate PlantUML server. The streamlit service reaches the backend over
compose DNS (http://umlbot:8000).
make venv # create .venv with uv
make run # backend on :8000 + minimal testing UI on :8501make run starts the FastAPI backend and the minimal testing UI
(streamlit/diagram_builder.py). Credentials come from /mnt/p/Secrets or
your .env (loaded automatically by the Makefile). Java 17+ is required for
the PlantUML JAR; set UMLBOT_PLANTUML_JAR_PATH if yours is not at the
default location.
- Describe your system:
Enter a free-text description of the system or process you want to model. - Select diagram type and theme:
Choose the UML diagram type (e.g., class, sequence) and an optional theme. - Iterate via chat:
- Review the generated diagram and PlantUML code.
- Use the chat interface to request changes, corrections, or ask questions (e.g., "Add a new class", "Fix the association", "Why did this error occur?").
- The system will update the diagram and code, handling errors and providing feedback as needed.
- Error Handling:
- If an error occurs (e.g., invalid UML, rendering failure), the error handler will display a clear message. Refreshing and trying again is usually a sufficient fix.
- All status updates and errors are shown in the UI for transparency.
See the docs/ directory for more details.
Godwin, R. C.* , Melvin, R. L.*, “Toward Efficient Data Science: A Comprehensive MLOps Template for Collaborative Code Development and Automation”, SoftwareX, 26, 101723, 2024