> Markdown version of [/videos/620-the-best-of-both-worlds-combining-python-and-kotlin-for-machine-learning](https://www.wearedevelopers.com/videos/620-the-best-of-both-worlds-combining-python-and-kotlin-for-machine-learning). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # The best of both worlds: Combining Python and Kotlin for Machine Learning A staggering 90% of machine learning models fail to reach production. Bridge this gap by combining Python's experimental power with Kotlin's robust enterprise deployment capabilities. - **Speakers:** Nils Kasseckert - **Event:** World Congress 2023 - **Published:** August 11, 2023 - **Duration:** 26:28 - **URL:** https://www.wearedevelopers.com/videos/620-the-best-of-both-worlds-combining-python-and-kotlin-for-machine-learning ## Summary A massive 90% of machine learning models fail to reach production, largely due to the fundamental disconnect between data scientists working in Python and software engineers operating in enterprise languages like Kotlin or Java. Bringing a model to life requires far more than just writing an algorithm; it demands a complex ecosystem involving data pipelines, feature stores, model registries, and continuous retraining infrastructure. Bridging this gap requires strategically combining the strengths of both languages rather than forcing a single paradigm across the entire machine learning lifecycle. Integrating Kotlin into Jupyter notebooks introduces robust type safety and null safety to data exploration, preventing common runtime errors that plague dynamic languages. Tools like Kotlin DataFrame and Lets-Plot enable seamless data preparation, while the Ktor framework simplifies model deployment, allowing developers to serve pre-trained ONNX models in just over 50 lines of code. Because Kotlin interoperates natively with the massive Java ecosystem, it excels in building resilient data pipelines and high-performance production serving layers. Despite Kotlin's advantages in production integration, Python remains the undisputed standard for core model development and experimentation. Current Kotlin machine learning libraries, such as KotlinDL, are still highly experimental and struggle with hardware compatibility issues, like lacking support for ARM-based Mac chips. Ultimately, the most effective architecture delegates model training and experimentation to Python's feature-complete ecosystem while relying on Kotlin's stability and speed for enterprise deployment, data preparation, and business logic integration. **Keywords:** machine learning production, python vs kotlin, kotlin jupyter notebooks, kotlin dataframe library, data pipeline architecture, model deployment challenges, ktor framework, ONNX model serving, kotlindl limitations, null safety in data analysis, feature store management, continuous model retraining, JVM ecosystem interoperability, lets-plot visualization, enterprise software integration, software engineering vs data science ## Chapters 1. **The gap between data scientists and software engineers** (00:36) — Language and architecture differences prevent most machine learning models from successfully reaching production. 1. **The complexity of the machine learning production lifecycle** (02:26) — Numerous specialized tools and processes are required to serve and maintain models effectively after development. 1. **Data pipelines and experiments with Kotlin in Jupyter** (05:44) — Kotlin Jupyter kernels enable type-safe data analysis and plotting for robust data pipelines. 1. **Model development limitations using Kotlin DL** (13:36) — Training a basic neural network with Kotlin DL reveals current hardware limitations and dependency issues. 1. **Deploying machine learning models with Ktor and ONNX** (16:18) — Serving an object detection model requires minimal code when pairing a Ktor web server with pre-trained ONNX models. 1. **Choosing between Python and Kotlin for machine learning** (20:55) — Python excels for model development while Kotlin provides stability for serving and building data pipelines. 1. **Questions on Kotlin and Python machine learning integration** (23:42) — Audience members ask about Kotlin dataframe properties, Python integration, and runtime environment support. ## Related Moments - [Introduction to Kotlin history and Java ecosystem interoperability](https://www.wearedevelopers.com/videos/384-moving-from-java-to-kotlin) (from "Moving from Java to Kotlin") - [Introduction to Kotlin and Java interoperability](https://www.wearedevelopers.com/videos/512-route-from-java-to-kotlin) (from "Route from Java to Kotlin") - [Transitioning machine learning models from notebooks to production](https://www.wearedevelopers.com/videos/501-model-governance-and-explainable-ai-as-tools-for-legal-compliance-and-risk-management) (from "Model Governance and Explainable AI as tools for legal compliance and risk management") - [Introduction to the Java and Kotlin ecosystems](https://www.wearedevelopers.com/videos/661-why-kotlin-is-the-better-java-and-how-you-can-start-using-it) (from "Why Kotlin is the better Java and how you can start using it") - [Planning a production application with Kotlin Multiplatform](https://www.wearedevelopers.com/videos/4-kotlin-multiplatform-true-power-of-native-code-reuse) (from "Kotlin Multiplatform - True power of native code reuse") - [Configuring runtime Java and Kotlin interoperability protocols](https://www.wearedevelopers.com/videos/661-why-kotlin-is-the-better-java-and-how-you-can-start-using-it) (from "Why Kotlin is the better Java and how you can start using it") ## Related Articles - [MLops – Deploying, Maintaining And Evolving Machine Learning Models in Production](https://www.wearedevelopers.com/magazine/115-mlops-deploying-maintaining-and-evolving-machine-learning-models-in-production) - [MLOps – What’s the deal behind it?](https://www.wearedevelopers.com/magazine/125-mlops-what-s-the-deal-behind-it) - [MLOps And AI Driven Development](https://www.wearedevelopers.com/magazine/82-mlops-and-ai-driven-development) - [Exploring AI: Opportunities and Risks for Developers](https://www.wearedevelopers.com/magazine/522-exploring-ai-opportunities-and-risks-for-developers) ## Related Jobs - [Model Implementation Engineer](https://www.wearedevelopers.com/jobs/48421-model-implementation-engineer) at **Sciforium** - [Lead Software Engineer, Model Serving Platform](https://www.wearedevelopers.com/jobs/48413-lead-software-engineer-model-serving-platform) at **Sciforium** - [LLM Training Engineer](https://www.wearedevelopers.com/jobs/48420-llm-training-engineer) at **Sciforium** - [MLOps AI Engineer](https://www.wearedevelopers.com/jobs/ext/2565312-mlops-ai-engineer) at **TeamViewer Germany GmbH,** - [Machine Learning Engineer](https://www.wearedevelopers.com/jobs/ext/2085365-machine-learning-engineer) at **TWILIO** - [Machine Learning Engineer](https://www.wearedevelopers.com/jobs/ext/2122890-machine-learning-engineer) at **Twilio**