Skip to content

About

Let an LLM automatically adjust your code based on given prompts

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM Replacer

A zero-setup browser tool with two methods:

  • Algorithm (offline): the built-in rule-based converter that turns DUUI Python tool components into ones that use the duui_logging library. No setup, no LLM, fixed behaviour.
  • LLM (OpenWebUI): each file is rewritten by a model on a self-hosted OpenWebUI. What gets changed is defined by a preset: a list of file rules, each with its own prompt that you can edit. The built-in DUUI logging preset does the DUUI conversion; you can change it or write your own presets for anything else. A capable model like gpt-oss:20b is recommended; small models (e.g. llama3.2) are less reliable.

Quickstart

  1. Download this repo (green Code -> Download ZIP, or git clone) and unzip it.
  2. Open index.html in your browser (double-click it).
  3. Pick a method. For Algorithm (offline) you are ready to go. For LLM (OpenWebUI) the base URL is prefilled (https://llm.texttechnologylab.org/); paste your API key, click Load models, and pick a model. The key is forgotten when you close the tab unless you tick Remember key in this browser (it is then saved unencrypted in your browser's profile).
  4. LLM only: pick a preset under What to replace (default: DUUI logging), or edit it / make your own (see below).
  5. Drop your files: drag files (or a whole project folder) onto the drop zone. In Algorithm mode .py, .lua, .toml and .txt files are picked up; in LLM mode the files that match one of the preset's file rules.
  6. Convert & download: click Convert all, review (and edit) each diff, then Download all (.zip).

Algorithm (offline)

  • .py: print() becomes log_info / log_warn / log_error, and FastAPI apps get duui_logging.add_logging(app) (plus install(level=...) when third-party forwarding is on).
  • .lua: each print(...) becomes DUUILogging:logInfo(...).
  • *.toml / *.txt (pyproject.toml, requirements.txt): the duui-logging dependency is added (git source for pyproject.toml and duui-logging @ git+... line for requirements.txt).

LLM presets

Open Edit this preset under What to replace to change what the LLM does. A preset has:

  • File rules, checked top to bottom; each file uses the first rule that matches.
    • Rule Name: just a name, shown in the list and next to each file.
    • File names: comma separated, e.g. *.py (all Python files), pyproject.toml (exactly that file) or src/**/*.js (JavaScript files anywhere below src/). Empty means all files.
    • Conversion: LLM (the file is sent with the system prompt) or one of the built-in offline converters (DUUI Python, Lua, pyproject.toml, requirements.txt). With an offline converter the prompt fields are hidden and the files are never sent to the LLM.
    • Language hint (optional): tells the LLM what kind of file it is (python, java, ...). It labels the code block the file is sent in; when empty it is guessed from the file extension.
    • System prompt: the instructions sent to the LLM. Ask for the whole file back in one ``` code block. If the reply has no code block (or it is cut off), the file is marked as failed and left unchanged; reasoning in <think> tags is ignored.
  • User message template (advanced): what is sent per file; by default the file itself.

Placeholders in prompts and the user message: {{path}}, {{filename}}, {{lang}}, {{code}}, and for DUUI {{duui_imports}}, {{duui_wireup}}, {{duui_level}} (filled from the DUUI options, which appear when the preset uses them).

Buttons: New (blank starter), Duplicate, Reset (undo edits to a built-in preset), Delete, Export / Import (.json, to share presets). Edits are saved in your browser.

The DUUI logging preset sends *.py, pyproject.toml and requirements*.txt (e.g. requirements-dev.txt) to the LLM with the DUUI prompts; other .toml / .txt files are left alone. Its .lua rule uses the Lua offline converter, so Lua files are never sent to the LLM (you can change its Conversion like in any other rule).

Cite

If you want to use the project please quote this as follows:

Alexander Leonhardt, Giuseppe Abrami, Daniel Baumartz and Alexander Mehler. (2023). "Unlocking the Heterogeneous Landscape of Big Data NLP with DUUI." Findings of the Association for Computational Linguistics: EMNLP 2023, 385–399. [LINK] [PDF]

Daniel Bundan, Giuseppe Abrami (2026). "LLMreplacer". [LINK]

BibTeX

@inproceedings{Leonhardt:et:al:2023,
  title     = {Unlocking the Heterogeneous Landscape of Big Data {NLP} with {DUUI}},
  author    = {Leonhardt, Alexander and Abrami, Giuseppe and Baumartz, Daniel and Mehler, Alexander},
  editor    = {Bouamor, Houda and Pino, Juan and Bali, Kalika},
  booktitle = {Findings of the Association for Computational Linguistics: EMNLP 2023},
  year      = {2023},
  address   = {Singapore},
  publisher = {Association for Computational Linguistics},
  url       = {https://aclanthology.org/2023.findings-emnlp.29},
  pages     = {385--399},
  pdf       = {https://aclanthology.org/2023.findings-emnlp.29.pdf},
  abstract  = {Automatic analysis of large corpora is a complex task, especially
               in terms of time efficiency. This complexity is increased by the
               fact that flexible, extensible text analysis requires the continuous
               integration of ever new tools. Since there are no adequate frameworks
               for these purposes in the field of NLP, and especially in the
               context of UIMA, that are not outdated or unusable for security
               reasons, we present a new approach to address the latter task:
               Docker Unified UIMA Interface (DUUI), a scalable, flexible, lightweight,
               and feature-rich framework for automatic distributed analysis
               of text corpora that leverages Big Data experience and virtualization
               with Docker. We evaluate DUUI{'}s communication approach against
               a state-of-the-art approach and demonstrate its outstanding behavior
               in terms of time efficiency, enabling the analysis of big text
               data.}
}

@misc{Bundan:Abrami:2026,
  title     = {LLMreplacer},
  author    = {Bundan, Daniel and Abrami, Giuseppe},
  year      = {2026},
  month     = {Sep},
  url       = {https://github.com/texttechnologylab/LLMreplacer}
}

About

Let an LLM automatically adjust your code based on given prompts

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages