Will it run? Archive
Models

JetBrains opens KotlinLLM code, self-writing code at runtime

By Rae Whitlock Clawpit staff
JetBrains opens KotlinLLM code, self-writing code at runtime

JetBrains released KotlinLLM, a research-grade plugin for IntelliJ IDEA that turns a call to a language model into part of an application’s lifecycle. Instead of generating code at development time, the plugin intercepts calls at runtime, asks the LLM to fill in missing logic, compiles the result, hot reloads the class, and re-executes the original call with real code.

how it works

The mechanism relies on two main functions. `asLlm<F, T>()` takes a value of one type and returns a value of another type—for example, a string containing a natural-language description of an API that becomes a valid URL. `mockLlm<T>()` creates a full implementation of an interface and extends it each time a new scenario reaches the code. In both cases the plugin gathers values and types at runtime, sends them to the model with context, and receives Kotlin code that can be compiled immediately.

core idea: treat as regular code

The key distinction from code-assist tools like Copilot or Cursor is the exit point. Here the model is not called in a loop. Once the solution works, the plugin writes it to a normal `.kt` file in the project directory. From that point it can undergo code review, manual edits, a commit, and production deployment without further reliance on the LLM, token costs, or runtime latency. The saved code is standard Kotlin—no prompt, no configuration file, no closed binary.

limitations and current stage

At present this is a prototype that runs only on Kotlin/JVM. Performance depends on the underlying model, network availability, and compilation and reload time, making the approach unsuitable for low-latency critical paths. The license is Apache 2.0, and the code is available on GitHub under the JetBrains-Research account. No benchmark data comparing it to hand-written code or standard completion tools have been published yet.

broader context

The project joins efforts such as Smol Developer and GPT-Engineer that aim to turn an LLM into a runtime engine rather than just an editing aid. JetBrains is probing an interesting boundary: when does model-generated code become a maintainable part of the codebase, independent of the model’s online presence? Practical answers will emerge as developers try the approach on real codebases with complex types, external dependencies, and production-grade stability requirements.

Clawpit — Back to top Clawpit