{"id":50734147,"url":"https://github.com/nsevent/gemini-model-registry","last_synced_at":"2026-06-10T12:01:21.760Z","repository":{"id":362166832,"uuid":"1257668120","full_name":"NSEvent/gemini-model-registry","owner":"NSEvent","description":"Public registry mapping logical Gemini model tiers (flash/pro/flash-lite) to current model IDs. Lets apps adapt to Google deprecations without an App Store release.","archived":false,"fork":false,"pushed_at":"2026-06-03T00:45:13.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-03T01:13:06.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NSEvent.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-02T22:38:34.000Z","updated_at":"2026-06-03T00:45:17.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/NSEvent/gemini-model-registry","commit_stats":null,"previous_names":["nsevent/gemini-model-registry"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/NSEvent/gemini-model-registry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fgemini-model-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fgemini-model-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fgemini-model-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fgemini-model-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NSEvent","download_url":"https://codeload.github.com/NSEvent/gemini-model-registry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NSEvent%2Fgemini-model-registry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34151276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-10T02:00:07.152Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-10T12:01:20.894Z","updated_at":"2026-06-10T12:01:21.743Z","avatar_url":"https://github.com/NSEvent.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gemini-model-registry\n\nA tiny JSON file that maps logical Gemini model tier names (`flash`, `pro`, `flash-lite`) to the current generally-available model IDs.\n\nApps fetch this file at runtime so a Gemini deprecation can be patched without an App Store release.\n\n## Usage\n\n```\nhttps://raw.githubusercontent.com/NSEvent/gemini-model-registry/main/registry.json\n```\n\nConsumers call the alias (`flash`, `pro`, `flash-lite`) and the registry resolves to the current model ID. Apps ship bundled defaults as a fallback so they work offline and on first launch.\n\n## Schema\n\n```json\n{\n  \"schemaVersion\": 1,\n  \"updated\": \"YYYY-MM-DD\",\n  \"models\": {\n    \"flash\":      \"gemini-3.5-flash\",\n    \"flash-lite\": \"gemini-3.1-flash-lite\",\n    \"pro\":        \"gemini-2.5-pro\"\n  }\n}\n```\n\n- `schemaVersion` — bump only on breaking changes to the JSON shape.\n- `updated` — ISO date of last change. Informational.\n- `models` — alias → live model ID. Aliases are stable; values change as Google deprecates.\n\n## Updating\n\nWhen a model is deprecated:\n\n1. Edit `registry.json`. Bump the value for the affected alias. Bump `updated`.\n2. Commit and push to `main`.\n3. Within 24h every consumer app picks up the new ID on its next launch (clients refresh on a 24h TTL).\n\nThat's it. No App Store release required.\n\n## Clients\n\n- Swift: [`clients/swift/GeminiModelRegistry.swift`](clients/swift/GeminiModelRegistry.swift) — singleton with UserDefaults caching, 24h TTL, bundled fallback.\n\nCopy the client file into each app rather than depending on this repo via SPM. Keeps the dependency surface zero.\n\n### Deprecation recovery\n\nThe Swift client also handles the case where Google deprecates a model mid-flight (between the user opening the app and making an API call, or before the 24h cache rolls over):\n\n1. `GeminiModelRegistry.isDeprecationError(statusCode:body:)` — static classifier. Returns `true` if the Gemini response body indicates the requested model is no longer available. Matches Google's wording today; tolerant to drift.\n2. `recoverFromDeprecation(failedModel:alias:)` — async. Force-refreshes the registry, then returns either `.retry(newModel:)` (registry now resolves the alias to a different ID, caller retries once) or `.giveUp` (no successor available, caller throws `ModelUnavailableError`).\n3. `ModelUnavailableError` — a `LocalizedError` whose `errorDescription` is \"This app's AI model is no longer available. Please update the app to the latest version.\" Designed to flow through existing per-app error UIs without per-app changes.\n\nCall-site pattern:\n\n```swift\nlet alias = \"flash\"\nvar model = GeminiModelRegistry.shared.flashModel\n\nfunc send(model: String) async throws -\u003e (Data, HTTPURLResponse) { /* … */ }\n\nvar (data, http) = try await send(model: model)\nif GeminiModelRegistry.isDeprecationError(statusCode: http.statusCode, body: data) {\n    switch await GeminiModelRegistry.shared.recoverFromDeprecation(failedModel: model, alias: alias) {\n    case .retry(let newModel):\n        model = newModel\n        (data, http) = try await send(model: model)\n        if GeminiModelRegistry.isDeprecationError(statusCode: http.statusCode, body: data) {\n            throw GeminiModelRegistry.ModelUnavailableError()\n        }\n    case .giveUp:\n        throw GeminiModelRegistry.ModelUnavailableError()\n    }\n}\n```\n\nSilent when the registry has a fix. User-visible message only when recovery genuinely can't help.\n\n## Consumer apps\n\n- Stock Inventory\n- VoicePad\n- WhisperCaptions (iOS app + CLI)\n- MemeReact\n- PocketDocs\n- ScanPlan\n\nWhen wiring a new app, also update bundled defaults in the copied Swift client so the first launch / offline case uses a known-good value.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsevent%2Fgemini-model-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnsevent%2Fgemini-model-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnsevent%2Fgemini-model-registry/lists"}