https://github.com/zach-klippenstein/laygent
The AI-native Compose layout for token-maxxers.
https://github.com/zach-klippenstein/laygent
ai ai-agents compose-multiplatform jetbrains-compose jetpack-compose layout layout-engine
Last synced: 20 days ago
JSON representation
The AI-native Compose layout for token-maxxers.
- Host: GitHub
- URL: https://github.com/zach-klippenstein/laygent
- Owner: zach-klippenstein
- License: apache-2.0
- Created: 2026-04-22T23:45:31.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2026-05-15T03:24:22.000Z (2 months ago)
- Last Synced: 2026-05-15T03:31:22.337Z (2 months ago)
- Topics: ai, ai-agents, compose-multiplatform, jetbrains-compose, jetpack-compose, layout, layout-engine
- Language: Kotlin
- Homepage: https://zach-klippenstein.github.io/laygent/
- Size: 168 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
- Maintainers: MAINTAINERS.md
Awesome Lists containing this project
README
# Laygent   
**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.
## Example
```kotlin
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))
}
}
}
```
## Installation
The library is published to Maven Central:
```kotlin
repositories {
mavenCentral()
}
dependencies {
implementation("com.zachklipp:laygent:0.1.0")
}
```
## Demos
- **Desktop:** `./gradlew :demo:run` — full-featured Compose Desktop demo.
- **Web:** `./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.
## Targets
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](https://github.com/dokar3/quickjs-kt).
- `wasmJs` uses the browser's JS engine directly via `eval` and a `globalThis.layoutContext` bridge.