 |
UmpleOnline AI Capabilities
This page describes the AI capabilities built in to UmpleOnline. This works at a basic level and is subject to extensive improvement in late 2026 and 2027. The capabilities described below focus on classic UmpleOnline, but the same capability is present in UmpleOnline V2.
The AI capability can use various large language models (LLMs) to generate class diagrams and state machines from requirements specified in Umple. Before using this feature you will need to create a set of requirements, or load an example set of requirements, such as one of the examples in this manual.
- AI setup. UmpleOnline uses a BYOK (bring-your-own-key) approach for AI features. Your API key is stored locally in your browser's local storage and is never sent to our servers. All AI requests are made directly from your browser to the selected provider.
AI settings dialog. In UmpleOnline, open the AI settings from the AI menu which appears at the bottom of the central menu. When you open this for the first time, click where it says 'Not Configured'
Select a provider. Currently, the supported providers are OpenAI, Google Gemini, and OpenRouter.
Enter API key.
- If you already have an API key, enter it in the field.
- If you don't have one, click the "Get API Key" link next to the provider selection to obtain a key from your provider.
Verify API key. Click the Verify button. The system checks the key's validity with the provider. If verification succeeds, a list of available models is displayed.
Select a model. Choose a model from the dropdown list. Free models are listed at the top, followed by paid models grouped by provider. The cost per million tokens (input and output) is displayed below the selection dropdown.
- Status indicator. The AI status indicator in the sidebar shows the current configuration status. Once a model is selected, the indicator displays the model name and provider name. AI preferences (provider, model, verification, usage) are stored in your browser's local storage.
- Prompt caching and token usage. Prompt caching reuses previously computed prompt prefixes. Cache hits require exact prefix matches, so stable/repeated content should be placed first and request-specific content last. UmpleOnline sends AI requests as chat messages and appends new turns, which helps preserve a reusable prefix across related requests. When cache hits occur, billed input tokens and latency can drop, but cache behavior is provider/model dependent and not guaranteed on every request. For details and examples (including OpenAI's automatic caching behavior, token thresholds, and the
cached_tokens usage metric), see OpenAI Prompt Caching.
- Explain code. Open the AI Explain tool. The dialog analyzes the entire editor content and streams the explanation. You can use the follow-up input to ask questions about the same model, as the dialog maintains a short conversation history for context. If the editor is empty, an alert dialog will prompt you to enter Umple code first.
- Fix guidance. After compiling your model, when errors appear, each issue is shown in the bottom pane. Click the AI fix icon beside an issue to generate guidance. The tool highlights the relevant line in the editor and returns a short fix suggestion. Note that this feature provides guidance only and does not auto-edit your code.
- Generate from requirements. Add requirement blocks to your model with the syntax
req ID { ... }. Learn more about requirements. Open the AI Requirements dialog and choose what to generate:
All requirements, or specific ones that you tick.
Only requirements not yet implemented: offered when some requirements already have an implementsReq in the model, and selected by default in that case. Implemented requirements are marked "(implemented)" in the list.
New requirement: type its ID (the next free one is suggested) and its text. The requirement is added at the top of your model, then the AI implements it; clicking Generate again does not add it a second time. This is also what the dialog offers when the model has no requirement yet.
Modify a requirement: pick one and change its wording. If nothing implements it yet, the AI implements the new wording. If it is already implemented, the AI returns your whole model updated to match, and the dialog lists the lines it adds and removes; inserting it replaces the model text (the diagram layout is kept, and Undo restores the previous version). If you stop the generation, or the output is cut off, your model is not replaced. With New and Modify, Cancel puts your model back as it was if nothing was inserted.
Select a generation type (state machine or class diagram). Under Also generate, you can ask for the methods the requirements imply and for a main method that demonstrates the model. Click Generate. The AI sees your existing model, so it reuses your classes instead of declaring them again. The result is streamed into the dialog, where you can stop generation, review the output, and insert it into the editor. When enabled, the system runs a compiler-based self-correction loop to repair issues in the generated block before insertion.
- Troubleshooting.
If AI actions are disabled, ensure you have selected a provider, entered an API key, verified it successfully, and selected a model.
If you see messages such as Rate limited or Provider error, or if you are unsure about keys and OpenRouter integrations, see Help with AI keys.
If no requirements are found, confirm your model contains req ... { ... } blocks.
If a generated block fails to compile, review the error list and re-run generation with fewer or clearer requirements.
|