JetBrains Research has officially announced the open-source release of KotlinLLM, a pioneering IntelliJ IDEA plugin designed to integrate Large Language Models (LLMs) directly into the Kotlin/JVM development lifecycle through a new language feature known as "Smart macros." Unlike traditional AI coding assistants that function primarily as autocomplete engines or chat interfaces, KotlinLLM embeds generative capabilities into the application’s runtime environment. This allows software to "evolve" its own implementation logic during execution, subsequently freezing that logic into standard, deployable Kotlin code. By leveraging the Java Debug Interface (JDI) and advanced prompt engineering, KotlinLLM aims to bridge the gap between probabilistic AI generation and the deterministic requirements of enterprise software engineering.
The project, which was a centerpiece of the KotlinConf 2026 presentations, represents a significant shift in the "Software 2.0" paradigm. While previous iterations of AI-assisted development focused on the "write-time" experience—helping developers write code faster—KotlinLLM focuses on the "runtime" experience. It allows developers to define high-level intentions through a minimal API, leaving the complex implementation details to be resolved, tested, and compiled by an LLM agent during the actual execution of the program. This "runtime evolution loop" ensures that the generated code is not only syntactically correct but also functionally validated against real-world data and state transitions.
The Technical Architecture: Smart Macros and the JDI Loop
At the core of KotlinLLM are "Smart macros," which are expressed as regular Kotlin function calls. These macros act as placeholders for logic that has not yet been written or is too tedious to implement manually. The framework provides a deliberately lean public API to minimize developer friction. The primary function, asLlm<F, T>(from, hint), facilitates the conversion of an input of type F into a structured, typed value T. This target type can range from simple primitives and enums to complex data classes and lists. A second function, mockLlm<T>(), allows for the generation of stateful implementations of interfaces, where the behavior of the mock is dynamically determined by the sequence of method calls it receives during runtime.
The mechanism that enables this evolution is a sophisticated runtime loop. When a developer initiates a project using the specific KotlinLLM run configuration, the plugin performs an initial scan of the codebase to identify all instances of asLlm and mockLlm. It then generates a series of bootstrap files, including providers and parsers. The application is launched under the Java Debug Interface (JDI), with the plugin registering specific breakpoints on "regenerate hooks."
If the currently generated logic fails to handle a specific runtime scenario—for instance, if a JSON response from a third-party API changes structure—the execution reaches a hook and suspends. At this point, the KotlinLLM plugin captures the full context of the suspended frame, including runtime values, local variables, and comprehensive type information. This context is bundled into a prompt and submitted to an LLM agent. The agent generates a code update, which the plugin then compiles on the fly. Using the JVM’s ability to redefine classes, the plugin hot-swaps the new logic into the running process and retries the original call. This cycle continues until the code successfully handles the input, at which point the logic is persisted to the source tree.
Historical Context and Project Chronology
The development of KotlinLLM began as a focused research initiative within JetBrains Research, aiming to solve the "hallucination" and "integration" problems inherent in AI-generated code. Traditional AI tools often produce code that looks correct but fails to compile or integrate with existing project dependencies. By moving the generation process into the IDE’s compiler and debugger infrastructure, JetBrains sought to ensure that every line of AI-generated code is verified by the Kotlin compiler before it ever reaches the developer’s screen.
The timeline of the project reflects a rigorous academic and industrial vetting process:
- Early 2025: Conceptualization of the "Smart Macro" and the JDI-based evolution loop.
- Late 2025: Internal testing within JetBrains, focusing on the Kotlin/JVM ecosystem and IntelliJ IDEA integration.
- May 2026: Formal presentation of the KotlinLLM thesis and a demonstration at KotlinConf 2026, where the project’s capabilities were showcased to the global developer community.
- July 2026: Official open-source release under the Apache License 2.0, including the plugin source code, research documentation, and runnable examples.
This chronology highlights JetBrains’ commitment to a "research-first" approach, ensuring that the tool is grounded in robust engineering principles rather than mere hype surrounding generative AI.
Performance Metrics and Empirical Evidence
To validate the efficacy of KotlinLLM, JetBrains Research conducted extensive testing on both real-world and synthetic projects. One of the primary benchmarks involved an adapted version of the Spring Petclinic Kotlin project, a standard reference architecture for Spring-based applications.

In this test, 18 asLlm call sites were introduced to handle various data transformation and business logic tasks. The results were highly favorable:
- Scenario Completion: 24 out of 24 application scenarios were completed successfully after the Smart macro evolution phase.
- Hot-Reload Success: The system achieved a 100% success rate in redefining classes at runtime without requiring a full application restart.
- Overhead: The performance impact of the JDI monitoring and redefinition logic was measured at approximately 1% of the total runtime overhead, making it negligible for development and testing environments.
In a more complex synthetic test, the "GitHub Beginner Issue Radar," the system was tasked with parsing real-world issue data from over 20 repositories, encompassing more than 30,000 individual issues. The goal was to identify "beginner-friendly" tasks based on nuanced descriptions and labels. The KotlinLLM-generated logic reached a recall rate of 0.89 against ground-truth labels. This demonstrates that the system can handle large-scale, unstructured data with a level of accuracy that rivals manual heuristic-based parsing.
Strategic Implications for Software Development
The release of KotlinLLM introduces several profound implications for the future of software engineering. Perhaps the most significant is the concept of "Model-Agnostic Deployment." While the development phase of a KotlinLLM project requires an active connection to an LLM (currently OpenAI via an API key), the final output is standard, human-readable Kotlin code.
Once the Smart macros have "evolved" to cover the necessary business requirements, the generated code is checked into version control. At this stage, the application no longer requires an LLM dependency or an internet connection to function. This solves two of the biggest hurdles in adopting AI in enterprise software: high inference costs and the latency associated with calling an LLM at runtime. By shifting the "intelligence" to the build and test phase, JetBrains allows developers to ship high-performance, deterministic binaries that benefit from AI without the baggage of AI-at-runtime.
Furthermore, KotlinLLM addresses the "Boilerplate Fatigue" that often plagues modern development. By using mockLlm<T>(), developers can avoid writing thousands of lines of manual mock implementations for complex interfaces. The system learns how the interface should behave based on how the rest of the application interacts with it, effectively creating a "living" mock that adapts to the evolving needs of the test suite.
Requirements, Setup, and Accessibility
KotlinLLM is currently positioned as a research prototype, but its integration with the existing JetBrains ecosystem is seamless. To utilize the plugin, developers require:
- IntelliJ IDEA 2025.2.x: The plugin is built to leverage the latest internal APIs of the IDE.
- JDK 21: The runtime evolution loop relies on modern JVM features found in the latest Long-Term Support (LTS) release.
- OpenAI API Key: Currently, the system uses OpenAI’s models for logic generation, though the architecture is theoretically model-agnostic.
- Project Configuration: Users must store their API credentials in a
.kotlinllmfile within the project directory, accessible viaTools > KotlinLLM Settings.
The project is hosted on GitHub under the Apache License 2.0, encouraging community contributions and experimentation. The repository includes not only the plugin source but also the full thesis write-up and the recorded session from KotlinConf 2026, providing a comprehensive resource for developers and researchers alike.
Future Outlook and Production Readiness
While JetBrains categorizes KotlinLLM as an experimental research prototype, the distinction between the "experimental plugin" and the "deployable output" is critical. The plugin itself is the laboratory where the code is grown; however, the resulting Kotlin source files are as production-ready as any code written by a human developer.
The next phase of development for KotlinLLM is expected to focus on expanding support beyond the JVM. Given JetBrains’ heavy investment in Kotlin Multiplatform (KMP), there is significant interest in how "Smart macros" might translate to Native, JS, or Wasm targets. However, since the current evolution loop relies on the specific capabilities of the Java Debug Interface and JVM class redefinition, porting these features to other platforms will require significant architectural innovation.
In conclusion, KotlinLLM represents a major milestone in the integration of artificial intelligence and formal programming languages. By treating the LLM as a sophisticated compiler component rather than just a text generator, JetBrains Research has provided a glimpse into a future where software can intelligently adapt to its environment during development while maintaining the rigor, performance, and stability required for production deployment. As the community begins to explore the boundaries of Smart macros, the traditional boundaries between "writing code" and "training models" will likely continue to blur.
