A modern LLM integration framework for Kotlin Multiplatform (KMP) targeting JVM servers, JVM desktop applications, and Android — with the same library, same API, and same semantics on both targets.
Mojentic provides a clean abstraction over multiple LLM providers with tool
support, structured output, streaming, an event-driven agent system, and
realtime voice — all built natively on Kotlin coroutines and Flow.
Status: Phase 0 — skeleton. This repository currently contains only the Kotlin Multiplatform project scaffolding (Gradle build, target configuration, quality gates, smoke test). The actual LLM features land in Phase 1+ — see
KOTLIN.mdin themojentic-unifymonorepo for the full plan, roadmap, and parity-target rationale.
- 🔌 Multi-Provider Support: Ollama, OpenAI, and Anthropic gateways
- ⚡ Coroutine-First:
suspend+Flowend to end; structured concurrency throughout; cooperative cancellation - 🛠️ Tool System: Extensible tool calling with automatic recursive execution, serial (default) or parallel runners
- 📊 Structured Output: Type-safe
@Serializable-derived JSON Schema - 🌊 Streaming: Cold
Flow<StreamEvent>with full recursive tool execution - 🔍 Tracer System: Observability via
MutableSharedFlowofTracerEvent, correlation IDs threaded through nested broker / tool calls - 🤖 Agent System: Event-driven multi-agent coordination with the ReAct pattern and shared working memory
- 🎙️ Realtime Voice: OpenAI Realtime API over Ktor
WebSocketswith server / manual VAD and barge-in - 🧩 Per-Provider Modules:
mojentic-core,mojentic-ollama,mojentic-openai,mojentic-anthropic,mojentic-realtime-openai— apps pull only what they use
- Kotlin 2.3+ (K2 compiler stable, standard-library
Uuid, current KMP target shape) - JDK 17 and JDK 21 for the build: 17 compiles the library, 21 runs the Gradle daemon
- Android:
compileSdk37 or later (Ktor 3.6 brings OkHttp 5.5, which requires it), minimum API 24 (Android 7.0). The build uses AGP 9.4. - Gradle: 9.8+ (managed via the wrapper)
The Gradle wrapper is committed (gradle/wrapper/gradle-wrapper.jar +
gradlew / gradlew.bat), so a fresh clone is immediately buildable:
./gradlew build # compile + test all targets the host can build
./gradlew :mojentic-core:jvmTest # JVM smoke test
./gradlew ktlintCheck detekt # lint gateCI runs the full quality-gate matrix on every push — see
.github/workflows/build.yml.
Not yet published. Targeted for the Phase 0 → Phase 1 transition.
Once published to Maven Central:
// build.gradle.kts
dependencies {
implementation("com.vetzal.mojentic:mojentic-core:<version>")
// Add gateways as they ship:
// implementation("com.vetzal.mojentic:mojentic-ollama:<version>")
// implementation("com.vetzal.mojentic:mojentic-openai:<version>")
}Dokka HTML output will be published to GitHub Pages on every v* tag.
Handwritten use-case guides will live under docs/use-cases/.
See request fidelity and 3.0 migration for nullable completion settings and provider output limits.
MIT — see LICENSE.