
AI-native layout engine generating declarative UI layouts from plain English, synthesizing layout algorithms at runtime, caching compiled frames for fast rendering, and fully AI-generated implementation.
Laygent is the AI-native Compose layout for token-maxxers.
Describe the layout you want in plain English and the algorithm is written for you at runtime, then cached so your frames stay fast. The whole library is 100% AI-generated code — the humans just held the keyboard.
val config = LaygentConfig.defaultOpenAi(openAiApiKey = myOpenAiKey)
@Composable
fun Example() {
val state = rememberLaygentState(config) {
"Arrange items in a 3-column grid with 8 dp of spacing between them."
}
Laygent(state) {
repeat(12) {
Box(Modifier.size(50.dp).background(Color.Blue))
}
}
}The library is published to Maven Central:
repositories {
mavenCentral()
}
dependencies {
implementation("com.zachklipp:laygent:0.1.0")
}./gradlew :demo:run — full-featured Compose Desktop demo../gradlew :demo-web:wasmJsBrowserDevelopmentRun — runs the same Laygent runtime in
the browser via Compose Multiplatform / wasmJs. Once it prints a localhost URL, open it and paste
an OpenAI key to drive the LLM-generated layout.The :laygent library publishes for jvm, iosArm64, iosSimulatorArm64, iosX64, and
wasmJs. The host JavaScript runtime is platform-specific:
jvm and the iOS targets use quickjs-kt.wasmJs uses the browser's JS engine directly via eval and a globalThis.layoutContext bridge.Laygent is the AI-native Compose layout for token-maxxers.
Describe the layout you want in plain English and the algorithm is written for you at runtime, then cached so your frames stay fast. The whole library is 100% AI-generated code — the humans just held the keyboard.
val config = LaygentConfig.defaultOpenAi(openAiApiKey = myOpenAiKey)
@Composable
fun Example() {
val state = rememberLaygentState(config) {
"Arrange items in a 3-column grid with 8 dp of spacing between them."
}
Laygent(state) {
repeat(12) {
Box(Modifier.size(50.dp).background(Color.Blue))
}
}
}The library is published to Maven Central:
repositories {
mavenCentral()
}
dependencies {
implementation("com.zachklipp:laygent:0.1.0")
}./gradlew :demo:run — full-featured Compose Desktop demo../gradlew :demo-web:wasmJsBrowserDevelopmentRun — runs the same Laygent runtime in
the browser via Compose Multiplatform / wasmJs. Once it prints a localhost URL, open it and paste
an OpenAI key to drive the LLM-generated layout.The :laygent library publishes for jvm, iosArm64, iosSimulatorArm64, iosX64, and
wasmJs. The host JavaScript runtime is platform-specific:
jvm and the iOS targets use quickjs-kt.wasmJs uses the browser's JS engine directly via eval and a globalThis.layoutContext bridge.