Thank you for your sharing
pytorch is a large framework that provides a wide range of capabilities. Replicating it fully in Kotlin, or even on the JVM in general, seems impossible for now. That said, there is
KotlinDL, and in the Java ecosystem,
DJL is available.
For inference, there are a sufficient number of libraries in Java, and in Kotlin, there’s
KInference. Notably, there’s
JLama and java bindings for llama.cpp.
for openapi generation, unfortunately, openapi-generator doesn’t meet the necessary quality standards in my opinion, and fern doesn’t support Kotlin. However, fern does support Java, and, for example, cohere used it for their
Java sdk. There is a
request for Kotlin support in fern.
Among larger projects, I’d highlight spring-ai and langchain4j. Both are actively working on Kotlin support:
https://spring.io/blog/2024/12/23/spring-ai-1-0-0-m5-released#kotlin-support and
https://github.com/kpavlov/langchain4j-kotlin, but even now, you can use their java api to write in Kotlin
There are also new initiatives, such as the
kotlin sdk for MCP and
xef.ai
I agree that Kotlin is currently underrepresented in the field of AI development. However, the domain is vast, and it’s not entirely clear what should be done specifically in Kotlin