Skip to main content

JetBrains Open-Sources KotlinLLM: Smart Macros for Runtime Code Generation

JetBrains Research has released KotlinLLM, an experimental IntelliJ IDEA plugin that leverages smart macros to generate and hot-reload Kotlin source code at runtime.

AI-written
Inewgen
31 Jul 2026Source: MarkTechPost3 min read (0 views)Last updated 04 Aug 2026
Share
JetBrains Open-Sources KotlinLLM: Smart Macros for Runtime Code Generation

Stock photo for illustration only, not from the actual event

Font size
  • KotlinLLM is a new open-source IntelliJ IDEA research plugin by JetBrains Research.
  • It utilizes asLlm and mockLlm calls to generate raw Kotlin source code on the fly.
  • The system relies on the Java Debug Interface (JDI) for seamless class hot-reloading.
  • The plugin targets Kotlin/JVM development specifically for evolutionary runtime loops.

JetBrains Research has introduced KotlinLLM as an open-source project, marking an experimental step forward for the IntelliJ IDEA ecosystem. The plugin leverages smart macros to dynamically create Kotlin source code during runtime, continuously evolving application logic through the Java Debug Interface (JDI).

At the core of this functionality, developers integrate special hooks such as asLlm and mockLlm directly into their codebase. These functions handle tasks ranging from querying GitHub APIs for repository issues to filtering beginner-friendly tasks, allowing the system to autonomously assemble the required execution logic.

100%Hot-reload success rate on test projects
0.89Recall score on synthetic GitHub issue parsing

When a project launches via the dedicated KotlinLLM run configuration, the plugin scans for any asLlm and mockLlm invocations. It then updates the generated bootstrap, provider, parser, and mock files while setting breakpoints on regeneration hooks. If the generated logic fails to match a live runtime scenario, execution hits a hook where runtime values and type information are captured from the suspended frame. An LLM agent then submits a code update, which the plugin compiles and redefines before retrying.

intellij plugin code editor programming

Stock photo for illustration only, not from the actual event

Integrating LLMs directly into integrated development environments through low-level debugging interfaces like JDI represents a powerful paradigm shift. By converting AI-generated logic into standard, deployable Kotlin code that runs independently of further LLM requests, developers avoid common production latency and recurring inference costs while maintaining strict control over their codebase.

Never miss the latest news?

Subscribe to get news summaries by email - not often enough to be annoying.

โฆษณา

Performance metrics from an adapted Spring Petclinic Kotlin project featuring 18 asLlm call sites showed that all 24 application scenarios completed successfully following smart macro evolution. The setup achieved a 100% hot-reload success rate, with compilation and class redefinition adding only about 1% to the total runtime overhead. Additionally, a synthetic 'GitHub Beginner Issue Radar' evaluated real issue data across 20 repositories and over 30,000 issues, achieving approximately 0.89 recall against ground-truth labels.

Requirements for running the plugin include IntelliJ IDEA 2025.2.x, JDK 21, and an OpenAI API key stored in the project's .kotlinllm configuration file via Tools > KotlinLLM Settings. Distributed under the Apache License 2.0, the repository includes runnable examples, the associated thesis write-up, and the recorded talk from KotlinConf 2026.

JetBrains explicitly designates KotlinLLM as a research prototype and an experimental IntelliJ IDEA plugin rather than a production runtime—at least for now. Although the plugin itself is experimental, its generated output is fully deployable, meaning applications can compile and execute the generated behavior without triggering additional AI requests for identical scenarios.

Source: MarkTechPost

Comments

Leave a Comment
0/2000

Found something wrong in this article? Report an issue with this article