Text Generation
Transformers
Safetensors
English
qwen3
qwen
qwen-3
qwen-3-4b
qwen3-4b-thinking-2507
4b
reasoning
uml-generator
uml
unified-modeling-language
modeling
xml
xmi
code
architecture
devops
planning
diagrams
state-machine
design
analysis
development
business-process
systems-engineering
reverse-engineering
data-modeling
services
cloud
problem-solving
creative
analytical
expert
rationality
conversational
chat
instruct
text-generation-inference
metadata
language:
- en
library_name: transformers
pipeline_tag: text-generation
tags:
- qwen
- qwen-3
- qwen-3-4b
- qwen3-4b-thinking-2507
- 4b
- reasoning
- uml-generator
- uml
- unified-modeling-language
- modeling
- xml
- xmi
- code
- architecture
- devops
- planning
- diagrams
- state-machine
- design
- analysis
- development
- business-process
- systems-engineering
- reverse-engineering
- data-modeling
- services
- cloud
- problem-solving
- creative
- analytical
- expert
- rationality
- conversational
- chat
- instruct
base_model: Qwen/Qwen3-4B-Thinking-2507
datasets:
- sequelbox/UML-Generator-Dataset-DeepSeek-V3.2
license: apache-2.0
Support our open-source dataset and model releases!
UML Generator: Qwen3-4B-Thinking-2507, Qwen3-14B, gpt-oss-20b, gpt-oss-120b
UML Generator is one of our Experimental Reasoning Models with custom output format; for standard chat, try Shining Valiant 3 or Esper 3.1!
UML Generator is a specialist code-reasoning assistant, performing situational analysis and reasoning to create Unified Modeling Language diagrams.
- Finetuned on our UML creation dataset data generated with DeepSeek-V3.2!
- Multi-step reasoning reliably identifies diagram structure before a user response of XMI 2.5.1 code containing the UML diagram.
- UML Generator Format provides a single clear, readable XMI that is ready to load into the UML tools of your choice.
- Trained in a variety of subjects for flexible analysis: software architecture, software development, business processes, systems engineering, data modeling, microservices, reverse engineering and more!
- Small model sizes allow running on local desktop and mobile, plus super-fast server inference!
Prompting Guide
UML Generator uses the Qwen3-4B-Thinking-2507 prompt format to create an XMI 2.5.1 file using UML Generator Format.
UML Generator is an experimental reasoning finetune:
- the assistant performs multi-step reasoning during the thinking phase, before producing a user response containing only the XMI code block.
- request the assistant to "Generate UML" and describe the situation to be analyzed in order to prompt for the UML Generator Format; see the example script below for examples. Focus on clearly articulating your requirements and allow the UML generator to perform analysis and generate your XMI file.
- structural validation of outputs is strongly recommended for production contexts. the reasoning section contains four reasoning steps and the final user response contains only XMI code.
Example inference script to get started:
from transformers import pipeline
import torch
model_id = "sequelbox/Qwen3-4B-Thinking-2507-UML-Generator"
pipe = pipeline(
"text-generation",
model=model_id,
torch_dtype="auto",
device_map="auto",
)
prompt = "Generate a UML class diagram modeling a feature toggle framework. A FeatureToggleManager provides an isEnabled(featureName) method. The manager's implementation must be designed using the Strategy pattern, where it delegates the actual check to an IFeatureToggleStrategy interface. This allows the framework to support different backends (e.g., ConfigFileStrategy, DatabaseStrategy, CloudConfigStrategy) for storing the toggle states."
#prompt = "Generate a UML component diagram for a CAN bus interface, clearly separating the hardware and software. Show a Vehicle_Control_App component requiring an I_CAN_Message interface (e.g., sendMessage(id, data)). This interface is provided by a CAN_HAL component. The CAN_HAL component, in turn, requires an I_CAN_Registers interface, which is provided by the <<hardware>>CAN_Controller component. The <<hardware>>CAN_Controller is then connected to a <<device>>CAN_Transceiver."
#prompt = "Generate a UML composite structure diagram for a HospitalInformationSystem component. This system must show its internal parts (subsystems): PatientAdmissions, ElectronicHealthRecord (EHR), Billing, and Pharmacy. PatientAdmissions must be connected to EHR and Billing. EHR must be connected to Pharmacy and Billing. The EHR part must also expose an external port HL7_Interface for communicating with external lab systems."
#prompt = "Generate a UML State Machine Diagram for an avionics Flight Mode Annunciator. The FMA must have two orthogonal regions: Autothrottle (States: Off, ARM, N1, SPEED) and Autopilot (States: Off, FD (Flight Director), CMD). The Autopilot region must also be a composite state with nested orthogonal regions for LateralMode (States: LNAV, HDG_SEL) and VerticalMode (States: LVNAV, ALT_HOLD). A TakeoffGoAround (TOGA) event must force-transition all regions to their respective armed/takeoff states."
messages = [
{"role": "user", "content": prompt},
]
outputs = pipe(
messages,
max_new_tokens=16000,
)
print(outputs[0]["generated_text"][-1])
UML Generator is one of our experimental reasoning releases; we've got more to come soon!
Do as you will.