# AI Helper - DE Decompiler

> AI Helper in DE Decompiler for supported VCL applications written in Delphi or built with C++Builder. Win32/Win64 analysis and edition requirements.

Canonical HTML: <https://www.de-decompiler.com/help/ai_code_enhancement.htm>

## AI Helper

AI Helper processes the Delphi-like Pascal listing already reconstructed by DE Decompiler from supported applications written in Delphi or built with C++Builder. It supports local models through Ollama and online models from OpenAI (ChatGPT) and DeepSeek through the OpenAI API integration.

1. Open a procedure and review its **Decompiler** output.

2. Select **AI Helper**.

3. Choose the **Provider**, set the server address and select a model.

4. Start processing and compare the suggestion with the original decompiled listing and native instructions.

Processing runs in a separate thread and uses the complete current procedure, including folded code. The prompt requests Object Pascal output and retains unknown call targets and recovered code inside export wrappers. Use **Cancel** to cancel a long request. Secondary connection settings can be collapsed to leave more space for code.

![AI Helper processing a recovered Delphi procedure through Ollama.](https://www.de-decompiler.com/image/help/de_decompiler_ai_assistant.png)
AI Helper processing a recovered Delphi procedure through Ollama.

### Ollama

Run Ollama on a compatible workstation or server, install the required model there, and connect AI Helper to that instance. A local Ollama server normally uses `http://localhost:11434`. The model must be installed in the instance selected by the **Host** field.

### Model choice and GPU memory

Lightweight models such as `qwen3:8b` provide only limited improvement when processing recovered Delphi code. The larger `qwen3.8:27b` model is shown in this manual.

For this local `qwen3.8:27b` setup, use the following GPU-memory guidance:

| Configuration | GPU memory | Expected use |
| --- | --- | --- |
| Minimum | 16 GB VRAM | Processing can be very slow. This is an entry-level configuration, not a comfortable workstation for regular model use. |
| Recommended | 32 GB VRAM | The preferred configuration for regular local use of the illustrated model. |

These figures refer to dedicated video memory on a GPU supported by Ollama. System RAM and the shared-memory figure reported for an old integrated graphics adapter are not equivalent to dedicated VRAM. A Pentium M-era computer with old integrated graphics is unsuitable for this setup. Check <a href="https://docs.ollama.com/gpu" rel="nofollow noopener">Ollama hardware compatibility</a> before selecting a GPU.

The requirements apply to the computer running Ollama. If AI Helper connects to a separate Ollama server, that server must provide the model resources.

### Context and other models

Choose the context size using the slider in Ollama settings; no additional Ollama extensions are required for this workflow. Context is measured in tokens and includes model instructions, input code and the generated answer. Increasing it requires more memory, so the figures above do not guarantee that every model format or context length will fit.

You may select other models supported by the configured provider. Their output quality and formatting can differ, and model-specific service text may remain in the result. Review the generated listing before using it.

### Online models: OpenAI (ChatGPT) and DeepSeek

Select **OpenAI API** in **Provider** to use OpenAI models (ChatGPT) or DeepSeek online. Set **Host**, **API key** and **Model** for the selected service. The host, API key and model identifier must belong to the same service; use a model available to that API key.

DeepSeek uses the same **OpenAI API** provider. Enter the DeepSeek host, API key and model identifier in the corresponding fields. Online inference runs on the provider's infrastructure, so the local Ollama GPU-memory recommendations do not apply to the analysis workstation when using these services.

### Data handling

Keep API keys out of screenshots and shared investigation material.

AI Helper sends the current decompiled code to the selected service. A server on another workstation or an external API can place that code outside the analyst's computer. Select the endpoint in accordance with your organization's handling requirements for proprietary source, samples and investigation evidence.

### Reviewing suggestions

AI can suggest clearer names, declarations or control flow, but a suggestion is not proof of the binary's behavior. Review changed calls, conditions and types against disassembly and related procedures. Preserve the original decompiled result when recording a model-assisted interpretation.

### Connection and model troubleshooting

- If a model is missing, confirm that it is installed in the Ollama instance selected by **Host**.

- If no response arrives, check that the service is reachable and that the host, API key and model identifier refer to the same provider.

- If processing is too slow, cancel the request and review the Ollama host's resources, model size and context setting.

- If an unfamiliar model leaves auxiliary tags or service text, remove that text while reviewing the result or select another suitable model.
