Expand free-model catalogs; add /version, non-root Docker, and config sync#30
Merged
Merged
Conversation
The proxy reads believed_free / model_reasoning / free_limits at runtime from the user's config.json, not the package sidecar. Add an optional --config PATH so the scraper can reconcile a live config in the same run: - Scope limited to providers configured in that file; custom/unconfigured providers and non-model keys (e.g. free_limits "_note") are left untouched. - believed_free and free_limits are synced (add newly-free, remove no-longer-free); model_reasoning is add-only (never pruned), matching the scraper and config.example.json semantics. - Honors --dry-run (prints a per-section diff, writes nothing) and also runs under --regen-config-only; preserves providers/server and all other sections. Adds tests/test_scraper/test_config_sync.py and documents the flag in the README "Keeping the free-models list current" section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refreshes the free-model catalogs for two already-supported providers and adds three quality-of-life fixes that came up while working through deployment. Four self-contained commits:
1. Expand believed-free model sets for GitHub Models and Google
Refreshed
believed_free(+model_reasoning, andfree_limitsfor Google) using current free-tier catalogs, verified against the maintainedcheahjs/free-llm-api-resourceslist:gemini-3-flash-preview,gemini-3.1-flash-lite-preview) and the Gemma 3 instruct line (27b/12b/4b/1b), with free-tier limits.free_models.jsonat runtime;config.example.jsonis regenerated from the same source of truth.gemma-*IDs (not justgemini-*), so the new Gemma models are covered on future scrapes.2.
/versionendpoint + gunicorn temp-dir permission fixGET /version→{"name": "llmproxy", "version": ...}. Without it, Flask 404s since the/v1/<path>pass-through only covers/v1/*.worker_tmp_dirto gunicorn (prefers/dev/shm). In containers run read-only or with an arbitrary--user, Python's tempfile resolution can fall through to the CWD (/app), which a non-root user can't write — crashing startup with a PermissionError.3. Non-root Docker by default + docs
USER(uid 1000, gid 0) with group-writable config/home dirs, sodocker runworks without--userand also under an arbitrary--user <uid>:0(OpenShift-style).HOMEis fixed soPath.home()resolves for unmapped uids./versionin the endpoints table; note the image is non-root by default; update the named-volume config path.4.
--config PATHto sync a live config.jsonThe proxy reads
believed_free/model_reasoning/free_limitsat runtime from the user'sconfig.json, not the package sidecar.scripts/update_free_models.py --config PATHnow reconciles a live config in the same run:free_limits_note) untouched.believed_free/free_limitssynced (add new, remove no-longer-free);model_reasoningis add-only (never pruned), matching the scraper andconfig.example.jsonsemantics.--dry-run, works under--regen-config-only, preservesproviders/serverand all other sections.Test plan
tests/test_scraper/test_config_sync.py(8 cases) and a/versionroute smoke test.config.example.jsonregen test passes byte-for-byte; regen does not dirty the committed file.--configdry-run shows a per-section diff and writes nothing; real run reconciles correctly and is idempotent on re-run; API keys / server /_notepreserved.Notes / caveats
update_free_models.py --dry-runfrom an environment with outbound web access will reconcile against live/v1/models.google/gemini-2.5-prodespite signals it may have moved to paid-only in 2026 — evidence was conflicting and the repo only removes on high-confidence negatives.docker build && docker run … && curl /versionis worth doing before relying on it.https://claude.ai/code/session_01Ey3m4qS4tWxG6kT5fF7YrA
Generated by Claude Code