Let me tell you a little story.
In 2015, I created Kodein: the KOtlin DEpendency INjection framework. It was the very first non-JetBrains Kotlin/Multiplatform library to be published.
In 2018, frustrated by the complexity Kodein was imposing, Arnaud Giuliani introduced Koin: a direct competitor to Kodein.
In 2020, it became clear that Koin was winning the DI library race, thanks to Arnaud's great work and dedication. We started discussing internally whether Kodein was still worth maintaining, and we decided to keep it: it still had its loyal user base.
Since 2022, I have grown to dislike the paradigm that libraries like Kodein and Koin were using, so I stopped using them entirely.
So here we are: I created Kodein, yet I now believe it to be detrimental to the Kotlin Multiplatform ecosystem.

When I was advocating for Kodein, this is the push-back I kept hearing:
I like Dependency Injection, but I hate DI frameworks. They are too complex and too magic. I do my own modules by hand, and that's more than enough for me.
A lot of reasonable developers.
And in 2022, I started making this very argument myself. A traditional DI container made me uncomfortable: its runtime graph resolution algorithm and its famous "ask me a type, and I'll give you an instance from context" paradigm. I want to understand what's going on in my code, and I want to control how it behaves.
So what do I mean by "I do my own modules by hand"?
Very simply: I design a suite of interfaces that provide my dependencies (the modules) and I implement them. Here is what it looks like:
// module definition
interface NetworkModule {
val baseUrl: String
fun httpClient(): HttpClient
}
// App module implementation
class AppNetworkModule : NetworkModule {
// Value
override val baseUrl = "https://kodein-koders.com/wp-json/"
// Singleton
private val _httpClient by lazy { KtorHttpClient(baseUrl) }
override fun httpClient() = _httpClient
}
// Test module implementation
@UsesMock(HttpClient::class)
class TestNetworkModule(mocker: Mocker) : NetworkModule {
override val baseUrl = "http://test-wp-json.api"
override fun httpClient() = mocker.mock<MockHttpClient>()
}
// ListViewModel does not know of the module
fun ListViewModel(module: NetworkModule) = ListViewModel(
httpClient = module.httpClient()
)In my projects, I want:
- No runtime overhead: a dependency either exists in an interface module, or it does not. There's no way to ask for a dependency without knowing if it exists.
- Explicit discriminator: I do not request any
HttpClient; I requestNetworkModule.httpClient(). The meaning of a dependency comes from the member's name, not just its return type. - Composable modules: because modules are interfaces, I can easily write
interface AppModule : NetworkModule, DatabaseModule. - Light presence: business classes (here
ListViewModel) do not know about the modules. They stay independent of the architecture and focus only on business logic.
But manually writing a layer, however light, is still tedious and error-prone.
So...
Introducing Inara: Compile-time dependency injection for Kotlin Multiplatform
Inara is a Kotlin Symbol Processor (KSP) that writes that thin layer of interface-based modules for you.
Here is how you would define and implement the same module:
@DIModule
interface NetworkModule {
val baseUrl: String
fun httpClient(): HttpClient
}
fun main() {
val network = NetworkModule(
baseUrl = value("https://api.example.com"),
httpClient = single { HttpClient(baseUrl) },
)
//... do stuff!
}
fun test(mocker: Mocker) {
val network = NetworkModule(
baseUrl = value("http://test-wp-json.api"),
httpClient = provider { mocker.mock<HttpClient>() },
)
//... test stuff!
}It has no runtime overhead as it resolves everything at compile time, not because of complex internal binding, but thanks to simple Kotlin syntax.
It is based on my "manual DI" architecture so it also inherits explicit discriminators (by design), Composable modules, and most importantly Light presence.
@DIFactory(builds = ListViewModel::class, from = NetworkModule::class) object VMFactory //Usage val listVM = VMFactory.ListViewModel(network)
On top of that, Inara natively handles bindings as values, suspend bindings, extension & overwrite, and per-module scoping.
Because each module interface is reified with a constructor function that takes Bindings, you can delegate the creation of a particular binding.
fun httpClientBinding(
test: Boolean = false
) : Binding<NetworkModule, Unit, HttpClient> =
if (test) Binding.provider { MockHttpClient() }
else Binding.single { HttpClient(baseUrl) }Inara is opinionated
After years of accommodating everyone in Kodein (especially by adding new behavior every time I was asked to), I have come to a realization. A good tool is defined as much by what it does not do as by what it does. With Kodein, I wanted a "universal" tool. With Inara, I most certainly do not want one.
- No mutable modules. Immutability is the future of Kotlin, of the JVM, and of programming in general.
Any kind of mutable architecture logic makes me deeply uncomfortable.
- No global modules. Global contexts impede testability and, more importantly, isolation.
The very idea of global complex logic or business state turns my stomach.
In short, I want to write code that is, in order of importance, correct, isolated, idempotent, and only then easy to write.
Yes, I know that Koin's default is a global mutable container, and that it is certainly part of what made it successful. Because of it, I ended up making concessions in Kodein and integrating these concepts. You can imagine how I felt about that...
I am very happy about Inara taking a different route. Maybe my hubris is coming down a little bit. I now want to make libraries help me write code I feel comfortable with. Not everyone anymore, not the entire Kotlin ecosystem, just me (and developers who happen to think alike).
The future of Kodein DI
With the official announcement of Inara, we have decided to sunset Kodein. We will keep maintaining its current version, but we will stop adding new features.
If you like how Kodein worked and how it architected your modules & applications, we warmly encourage you to migrate to Koin. It supports everything Kodein does, and much more (with better optimizations & integrations).
And if the premises and promises of Inara speak to you, here's where to go next:
Kodein was my first library, and Inara is the one I would write today. I would love to hear what you think of it.
Join the conversation:
Meet Inara: compile-time dependency injection for Kotlin Multiplatform, with no runtime overhead and plain Kotlin. I created Kodein, but I no longer like the paradigm behind it. Inara is what I would write today. kodein-koders.com/en/blog/inar... #Kotlin #KMP
— kodein-koders.bsky.social (@kodein-koders.bsky.social) 9:06 AM · Nov 3, 2026
[image or embed]
These articles might interest you
Tutorials, lessons learned and best practices around KOSI and the Kotlin ecosystem, from the people who maintain the libraries.
09/11/2026
LARPing enthusiasm: the ghost of disengagement
I can hand the work to AI, but not my judgment or my product sense. A story of sliding into disengagement, and of a comeback still in progress.
Read more
26/10/2026
Agentic coding has killed cross-platform frameworks!
Agents made it cheap to write native code twice, so is cross-platform dead? Not quite: what changed is the question. Share what must be identical, and check it once.
Read more
19/10/2026
LARPing enthusiasm: the AI creativity frenzy
AI lets me build in weeks what once took years, and it feels like a drug. Am I really creating, or just LARPing enthusiasm? A personal reflection on agency, will and shared code.
Read more
17/10/2026
MocKMP: a mocking processor for Kotlin/Multiplatform
Want to run your unit tests on every Kotlin/Multiplatform target? MocKMP generates mocks and fakes at compile time with a Kotlin Symbol Processor, no reflection needed, and keeps a familiar mocking API.
Read more
04/09/2025
Use Swift in a Kotlin/Multiplatform library
Need to use a Swift-only iOS API such as CryptoKit in your Kotlin/Multiplatform library? Salomon shows how to bridge it through Objective-C and Kotlin/Native cinterop, with tested code.
Read more