Skip to main content

LLM diagram generation library for Mermaid, PlantUML, and draw.io style workflows.

Project description

llm-draw

PyPI version Python versions

Generate diagram source from natural-language prompts using LLMs.

llm-draw infers the diagram type and output format from your prompt, then returns Mermaid, PlantUML, draw.io XML, or Markdown diagram text.

Install

Install from PyPI:

python -m pip install "llm-draw[openai]"

Other extras are available for specific integrations:

python -m pip install "llm-draw[langchain]"

Example

import os

from llm_draw import LlmDraw

client = LlmDraw(provider="openai")
result = client.generate(
    prompt="Show a web app with browser, API, PostgreSQL, Redis, and Stripe.",
    apikey=os.environ["OPENAI_API_KEY"],
    model_id="gpt-4.1-mini",
)

print(result.content)
print(result.diagram_type, result.output_format)

CLI

export OPENAI_API_KEY="..."

llm-draw \
  "Draw a payment workflow with fraud checks and refund handling" \
  --model-id gpt-4.1-mini \
  --output workflow.mmd

llm-draw writes inferred metadata to stderr and writes diagram source to stdout, unless --output is provided.

Supported Diagrams

  • Architecture, system architecture, network, AWS, Azure, GCP, Kubernetes, Terraform
  • Flowchart, process flow, workflow, process map, BPMN, swimlane, state, sequence
  • ERD, UML, use case, block, data flow, user flow, user journey map, org chart
  • Mermaid editor and PlantUML editor modes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

llm_draw-0.1.2.tar.gz (12.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_draw-0.1.2-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file llm_draw-0.1.2.tar.gz.

File metadata

  • Download URL: llm_draw-0.1.2.tar.gz
  • Upload date:
  • Size: 12.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for llm_draw-0.1.2.tar.gz
Algorithm Hash digest
SHA256 1b6e674c0108137a7e0c860868b4f8504146974be6f0d4f260fd5c8744b67eb2
MD5 749cc630c631f7621e4ba466c3db9a4a
BLAKE2b-256 5af990426a191cbbd33ed2183b15e17ac8875fa6540c80be5e7f73bfa56bd7db

See more details on using hashes here.

File details

Details for the file llm_draw-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: llm_draw-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for llm_draw-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e92f9c01a475ec9613deb028b8bad0067895eafb4a2d43a1c999fad82dbde82f
MD5 90bbe86fa6b4ea4a7565ef16b5347c92
BLAKE2b-256 b6e13392d9fa659327aa12af35b2eea09a13a8dc9e28fec7f1078c54a6d5f0a9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page