Trigger
- User runs
/update-free-tier-models - Free badges look wrong (missing or incorrectly present)
- Either catalog’s
stale_afterdate is today or in the past (see OpenRouter, Ollama Cloud) - Free models appear or disappear at OpenRouter or Ollama Cloud
Preconditions
- Read index.md for scope and layering (runtime vs knowledge).
- Read policy sections in openrouter.md and ollama-cloud.md before scraping.
- Only OpenRouter and Ollama Cloud — do not expand services without an explicit product decision.
Steps
1. OpenRouter
- Fetch
https://openrouter.ai/api/v1/models(no auth). - Keep models where
pricing.promptandpricing.completionare both numeric0. - Drop non-chat models using the same idea as app
isChatModel()(see OpenRouter policy). - Prefer
:freesuffix ids andopenrouter/free. - Build the candidate lowercase id set.
2. Ollama Cloud
- Fetch
https://ollama.com/v1/modelsfor cloud model ids. - For each id, check library usage level at
https://ollama.com/library/{id}(try cloud tag variants when needed). - Include Low only by default; never High / Extra High.
- Store API-style ids; rely on runtime alias normalization for
:cloud/-cloud.
3. Diff and apply
- Diff candidates against the Current set sections in this bundle (and against
FreeTierModels.kt). - Show a short added/removed summary per service before writing.
- Update runtime sets in:
composeApp/src/commonMain/kotlin/com/inspiredandroid/kai/data/FreeTierModels.kt
Preserve file structure and comments; sets only.
4. Update this bundle:
- Replace Current set lists in openrouter.md and ollama-cloud.md
- Set generated: { by: process:update-free-tier-models, at: <ISO-8601 UTC> }
- Set stale_after to ~14 days ahead (YYYY-MM-DD)
- Optionally set verified after tests pass (see below)
5. Append a dated entry to log.md (newest first under today’s heading).
4. Verify
./gradlew :composeApp:compileKotlinDesktop./gradlew :composeApp:desktopTest --tests '*FreeTierModels*' --tests '*ModelTransformations*'./gradlew spotlessApply- Update
FreeTierModelsTest.ktonly if fixture seed ids changed. - On green tests, set on both catalogs:
verified: { by: process:desktopTest-FreeTierModels, at: <ISO-8601 UTC> }
Hard rules
- Do not add runtime network calls for free flags.
- Free-ness is per service — never put free ids into
ModelCatalogas global metadata. - Keep all set members lowercase.
- When unsure about an Ollama model’s free eligibility, leave it out.