1. In settings.gradle.kts, inside dependencyResolutionManagement { repositories { ... } }:
exclusiveContent {
forRepository { maven { url = uri("https://getramenai.com/maven") } }
filter { includeGroup("com.getramenai") }
}
2. In app/build.gradle.kts (minSdk 29):
implementation("com.getramenai:ramen:0.9.0")
3. Hello world:
val ramen = Ramen.open(context, File(context.filesDir, "Qwen3-1.7B-Q4_K_M.gguf"))
ramen.reply(listOf(Message.user("Name three kinds of noodles.")), session = "chat-1") { r ->
when (r) {
is Reply.Text -> answer.append(r.text)
is Reply.Done -> Log.i("app", "read ${r.readTokens} new tokens, memory: ${r.memory}")
is Reply.Failed -> Log.e("app", r.message)
is Reply.Started -> {}
}
}
Send the whole conversation each time (system, user and assistant messages), as with the OpenAI API: RAMen keeps the part the model already holds, in memory or restored from its file, and reads only the rest. history(session) returns a conversation's saved messages, forget(session) deletes it, close() saves and frees the model's memory. Answers arrive on the main thread, one model and one answer at a time.
Inside: llama.cpp for arm64 phones and x86_64 emulators, one CPU build per processor generation (the best one is picked when your app starts), 16 KB pages, no permissions needed. Tested in a blank app with only these two snippets on an Android emulator: the conversation came back after Android closed the app, and the model read only the new message. This is a 0.9.0 preview; a Swift package for iPhone apps is next. Questions: support@getramenai.com.