JetBrains Open-Sources KotlinLLM, a Research Prototype for Runtime Code Generation
JetBrains open-sources KotlinLLM, letting compiled Kotlin apps generate and persist LLM-written code at runtime instead of calling a model live.
JetBrains has released KotlinLLM as open source, providing Kotlin/JVM developers with a research prototype that generates runtime logic and converts it back into ordinary, reviewable source code. The tool was built by JetBrains Research and consists of two functions in the public API: asLlm() and mockLlm(). The asLlm() function takes unstructured or semi-structured input and generates typed Kotlin values, while mockLlm() creates a stateful implementation of an interface.
Rather than querying an LLM model every time a function runs, KotlinLLM generates Kotlin source code the first time it encounters a new scenario and reuses that code for subsequent runs. This eliminates the need for model calls, reduces latency, and allows teams to maintain control over the logic by committing it to version control.
JetBrains designed KotlinLLM with three properties: explicitness, persistence, and portability. The explicit nature of the code allows reviewers to see when an LLM is involved, while persistence ensures that generated behavior is stored as source code rather than just a runtime session. Portability means that once the plugin is no longer in use, the generated code runs as standard Kotlin.
JetBrains tested KotlinLLM on two projects: an adapted version of Spring Petclinic Kotlin with 18 asLlm call sites and GitHub Beginner Issue Radar, which parsed over 30,000 issues. These tests showed a 100% hot-reload success rate and a recall rate of 0.89 against ground-truth beginner labels. The open-source KotlinLLM repository, licensed under Apache License 2.0, includes the IntelliJ plugin, the Smart macro API, and runnable example projects.
JetBrains is seeking feedback from teams experimenting with agentic AI in their development pipelines, particularly examples of successful and unsuccessful use cases.
Written by urgent.news from DevOps.com's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.