HTTP client generator / KSP plugin for Kotlin Multiplatform (Android, iOS, Js, Jvm, Native, WasmJs)) using KSP and Ktor clients inspired by Retrofit https://foso.github.io/Ktorfit
2.1k
Stars
79
Forks
59
Open issues
30
Contributors
AI Analysis
Ktorfit is a Kotlin Symbol Processor (KSP) that generates HTTP clients for Kotlin Multiplatform projects, supporting Android, iOS, JavaScript, JVM, Native, and WebAssembly via Ktor clients. It serves developers building cross-platform Kotlin applications who need a Retrofit-like declarative API for HTTP communication. Best suited for Kotlin Multiplatform Mobile and backend teams; less relevant for non-Kotlin or single-platform projects.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Kotlin Multiplatform HTTP client generator using KSP, inspired by Retrofit but targeting Ktor
Ktorfit is a Kotlin Symbol Processor (KSP) that generates type-safe HTTP clients for Kotlin Multiplatform projects (Android, iOS, JS, JVM, Native, WASM). It bridges Retrofit-style declarative API definitions with Ktor's multiplatform client capabilities. Adoption appears concentrated among Kotlin Multiplatform developers seeking compile-time generated clients without reflection. Real-world production usage is not extensively documented in public sources.
Created in August 2019, Ktorfit emerged as the Kotlin ecosystem adopted Kotlin Multiplatform Mobile (KMM) as a serious cross-platform strategy. It adapted Retrofit's proven annotation-based API definition pattern to KSP (Google's replacement for annotation processors) and Ktor clients, filling a gap where Retrofit alone could not serve multiplatform codebases.
The project gained steady traction as KSP matured (2021–2023) and multiplatform adoption increased. Growth appears organic but modest—2,069 stars after 7 years suggests niche but consistent interest. Recent activity (last push July 1, 2026) indicates active maintenance, though 5 stars in the last week suggests growth is measured rather than accelerating.
Adoption not verified. README contains no case studies, company testimonials, or documented production deployments. No evidence of enterprise adoption or scale-of-use metrics. Maven Central presence suggests some production use, but cannot quantify or characterize it.
Based on README, Ktorfit operates as a KSP plugin that generates code at compile time. It likely produces Ktor client instances from annotated interface definitions, similar to Retrofit's strategy. The project maintains multiple packages (lite variant, flow converters, call/response converters) suggesting a modular architecture designed to reduce bundle size on multiplatform targets. Specific implementation details cannot be verified from README alone.
Not documented in README. No mention of testing strategy, CI/CD pipeline details, or test framework integration.
Last push July 1, 2026 (current date July 5, 2026) confirms very recent activity. Published on Maven Central with version badges suggests active releases. However, the rate of commits and issue resolution cannot be assessed from metadata alone. The 7-year project history with continued maintenance suggests stable, long-term commitment rather than abandonment risk.
ADOPT IF: You are building a Kotlin Multiplatform project, need type-safe HTTP API generation similar to Retrofit, and target Ktor. Your team is comfortable with KSP and annotation-driven code generation. AVOID IF: You require extensive production battle-testing evidence or working primarily on single-platform JVM/Android (Retrofit is more mature). You dislike code generation or compile-time dependency on annotation processors. MONITOR IF: You are evaluating Kotlin Multiplatform HTTP solutions and want to track Ktorfit's adoption and stability over the next 1–2 release cycles.
Independent dimensions
Mainstream potential
4/10
Technical importance
7/10
Adoption evidence
3/10
- Adoption not verified—no public production case studies or scale metrics; adoption may be narrower than star count suggests.
- KSP ecosystem maturity risk—Ktorfit depends on KSP and Ktor both evolving; changes in either can create friction.
- Smaller maintainer pool—single-author project (Jens Klingenberg) increases bus-factor risk compared to Square/JetBrains backed libraries.
- Multiplatform fragmentation—compatibility matrix across Android, iOS, JS, JVM, Native, WASM is complex; edge cases or platform-specific bugs may not be caught early.
- Limited ecosystem integrations—no evidence of community plugins, middleware, or third-party extensions; diverges from Retrofit's rich plugin ecosystem.
Ktorfit will likely remain a stable, niche tool for Kotlin Multiplatform teams. It is unlikely to achieve Retrofit-scale adoption but may solidify as the preferred HTTP code-gen solution within the KMM ecosystem as multiplatform adoption grows slowly in enterprise.
Explore similar
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Website
- https://foso.github.io/Ktorfit
- Language
- Kotlin
- License
- Apache-2.0
- Last updated
- 3d ago
- Created
- 84mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Top contributors
Recent releases
Similar repos
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
2.1k | +7 | Kotlin | 8/10 | 3d ago |
|
|
14.5k | — | Kotlin | 8/10 | 1d ago |
|
|
1.6k | — | Kotlin | 7/10 | 24h ago |
|
|
4.7k | — | Kotlin | 7/10 | 2w ago |
|
|
3.5k | — | Kotlin | 8/10 | 13h ago |
|
|
2.8k | — | Kotlin | 8/10 | 15h ago |
Retrofit is the semantic inspiration and handles JVM/Android only; Ktorfit extends the pattern to multiplatform via KSP and Ktor. Retrofit remains vastly more widely adopted and battle-tested, but does not solve multiplatform HTTP generation.
Ktor Client is the underlying HTTP transport and lower-level abstraction. Ktorfit is a code generator on top of Ktor Client, trading flexibility for type safety and boilerplate reduction.
Fuel is a lightweight HTTP library for Kotlin but does not offer compile-time code generation or multiplatform parity. Serves a different use case (manual HTTP calls vs. declarative APIs).
http4k is a functional HTTP toolkit; orthogonal to Ktorfit. It can work with Ktor but serves different design philosophy (functional composition vs. annotation-driven generation).
Direct Ktor Client usage requires manual endpoint definitions. Ktorfit reduces boilerplate and improves type safety at the cost of annotation dependency and generated code.