JetBrains’ Apache 2.0 IntelliJ plugin uses LLM-driven ‘Smart macros’ to generate, compile, and commit native Kotlin code directly into JVM project repositories.
On 28 July 2026, JetBrains Research open sourced KotlinLLM, an experimental research prototype that delegates runtime application logic to large language models (LLMs) directly within Kotlin codebases. Distributed under the Apache License 2.0, KotlinLLM is delivered as an IntelliJ IDEA plugin tailored for Kotlin/JVM development. It introduces ‘Smart macros’, explicit function calls whose underlying implementations are synthesized, compiled, and hot-reloaded dynamically as new runtime scenarios are encountered.
Unlike traditional runtime LLM patterns, which suffer from non-deterministic API calls, recurring billing, high request latency, or external agent reliance, JetBrains’ KotlinLLM treats the model as a compiled code generator rather than an active service dependency. While prior runtime tools predominantly targeted interpreted environments like Python, KotlinLLM brings this pattern to statically typed JVM languages.
KotlinLLM’s operational lifecycle follows four core principles:
-
Code Review Transparency: Call sites explicitly highlight LLM-backed logic during code reviews.
-
Persistent Code Generation: Synthesised behaviour is written to disk as ordinary
.ktKotlin files within the project, rather than remaining ephemeral in memory. -
Zero Latency Recurrence: Once code is generated for a specific scenario, subsequent calls run as native Kotlin, bypassing further LLM requests, eliminating API charges, and guaranteeing reproducible execution.
-
Standard Toolchain Integration: The generated
.ktfiles can be committed, audited, tested, and distributed via standard CI/CD pipelines without requiring the plugin at runtime.
The framework exposes two primary public APIs: asLlm(), which parses unstructured input into strongly typed Kotlin data structures, and mockLlm(), which dynamically generates stateful interface implementations. The official repository provides the IntelliJ IDEA plugin, the core Smart macro API, and reference projects.















































































