Iterate AI Features Locally First in KMP
ph1b · reddit · 2026-07-20
The author shares their workflow for building AI features with KMP at Yazio:
- API keys cannot be placed directly in the app, so LLM calls must be backend-driven.
- However, prompts often require many iterations, and frequent backend deployments slow down development.
- The solution: Define a sealed interface in commonMain as a contract, using a fake implementation to drive frontend integration; use Koog locally during debugging to implement real LLM logic.
- Once the prompt and structure stabilize, migrate them to the Kotlin backend. Much of the code can be copied directly since Koog also supports backend execution.
The author notes this approach is particularly suited for structured output and rapid iteration.
More from coding & agent
- Soft Clamp cuts tool-call overuse in multi-teacher distillation, from 13.7% to 9.0% — antgroup · 2026-07-21
- Agent harness memory loss and compaction are still a major usability problem — adityaag · 2026-07-21
- SpecJudge runs locally on Ollama to pick the right-sized AI model for your project — jokiruiz · 2026-07-21
- A developer maps out six design rules for CLIs that humans and AI agents can both use — yujiezha · 2026-07-21
- A coding-agent skill that forces ADHD-friendly, answer-first output — ayghri · 2026-07-21
- A set of agent skills for CAD, robotics, and hardware design — earthtojake · 2026-07-21