Foso

Foso/Ktorfit

Kotlin Apache-2.0 Mobile

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
active
GitHub +7 / week

2.1k

Stars

79

Forks

59

Open issues

30

Contributors

2.7.5 07 Jun 2026

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.

Mobile Developer Tool Discovery value: 6/10
Documentation 8/10
Activity 9/10
Community 8/10
Code quality 5/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 8/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

kotlin-multiplatform ksp-processor http-client code-generation ktor-ecosystem
Actively maintained Well documented Niche/specialized use case Production ready
Deep Analysis · Based on README and public signals
5d ago

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.

Origin

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.

Growth

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.

In production

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.

Code analysis
Architecture

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.

Tests

Not documented in README. No mention of testing strategy, CI/CD pipeline details, or test framework integration.

Maintenance

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.

Honest verdict

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

Risks
  • 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.
Prediction

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.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

Kotlin
99.1%
Ruby
0.6%
Java
0.2%
Swift
0.1%

Information

Language
Kotlin
License
Apache-2.0
Last updated
3d ago
Created
84mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Similar repos

ktorio

ktorio/ktor

Ktor is an asynchronous web framework for Kotlin that enables rapid development...

14.5k Kotlin Web Dev
ktorio

ktorio/ktor-samples

ktor-samples is an official JetBrains collection of example projects...

1.6k Kotlin Web Dev
kittinunf

kittinunf/fuel

Fuel is a Kotlin HTTP client library for JVM and Android, built on Kotlinx...

4.7k Kotlin Mobile
google

google/ksp

Kotlin Symbol Processing (KSP) is an official Kotlin compiler plugin API for...

3.5k Kotlin Dev Tools
http4k

http4k/http4k

http4k is a lightweight, functional HTTP toolkit for Kotlin that enables...

2.8k Kotlin Web Dev
vs. alternatives
Retrofit (Square)

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 (JetBrains)

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 (kittinunf)

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 (http4k)

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).

Manual Ktor Client (no code gen)

Direct Ktor Client usage requires manual endpoint definitions. Ktorfit reduces boilerplate and improves type safety at the cost of annotation dependency and generated code.