Skip to content

0.9.4

Latest

Choose a tag to compare

@tibo-pendino tibo-pendino released this 24 Nov 16:20
· 16 commits to main since this release
0743e3f

OpenGateLLM 0.9.4 brings OpenFGA in as the authorization engine: creating and deleting organizations and every /v1/admin/users route are now decided by relations stored in OpenFGA, not by the Postgres role.
OpenFGA becomes a required dependency, with its own database, and db-migrate now publishes the authorization model and backfills the relations that existing admins and organizations need.
Routers infer their load-balancing strategy from their providers' qos_limit and reject providers that mix both modes, and model health is computed from the gateway's own load.
The images are lighter and no longer ship curl: review your healthchecks, configuration file and deployment order before upgrading.

Breaking changes

  • Deploy OpenFGA next to the API and declare it in the configuration file: dependencies.openfga (url, store_name, api_token) is required, and the API refuses to start without a reachable OpenFGA holding a store and a model. config.example.yml reads OPENFGA_HOST, OPENFGA_PORT and OPENFGA_AUTHN_PRESHARED_KEYS, the pre-shared key the OpenFGA server also reads. OpenFGA stores its data in its own openfga PostgreSQL database (#1143, #1501)
  • Create the openfga database yourself on an existing PostgreSQL: compose.example.yml creates it through scripts/postgres_entrypoint.sh, which the postgres image only runs on an empty data directory (#1143)
  • Authorize POST and DELETE /v1/admin/organizations and GET, POST, PATCH and DELETE /v1/admin/users with OpenFGA: they answer 403 to a user who does not hold platform:api#admin, whatever their Postgres role. Organizations that were never registered in OpenFGA answer 403, not 404, on delete (#1143, #1244, #1339, #1341, #1347, #1350, #1351)
  • Change an admin user's role instead of the role itself: PATCH /v1/admin/roles/{role_id} answers 409 when the request adds or removes the admin permission of an existing role. The playground role form still shows the Admin switch when editing (#1412)
  • Run the OpenFGA data migrations after the Alembic upgrade and before starting the API. In compose.example.yml, db-migrate now runs alembic upgrade head, then scripts/setup_openfga.sh (store and model), then python -m api.infrastructure.openfga.migrations, and fails if OpenFGA is unreachable. Without them, admins and organizations created before 0.9.4 get a 403 on the routes above (#1496)
  • Stop setting load_balancing_strategy on routers: it is ignored when sent and no longer returned by the admin router endpoints. Routers whose providers all have a qos_limit send each request to the provider with the lowest load rate; the others shuffle their providers, including those set to least_busy. Run the Alembic migration 2b8e23234402, and deploy the playground together with the API (#1473)
  • Give a qos_limit to every open provider of a router, or to none of them: POST and PATCH /v1/admin/providers answer 400 to a change that would mix both, and a model of the configuration file that mixes both stops the API at start-up on a database with no router yet. Existing mixed routers keep working, with their providers shuffled; closing a provider (qos_limit: 0) is always accepted (#1502)
  • Stop sending the provider basic_auth field in POST /v1/admin/providers and in the configuration file: it is ignored, no longer in the OpenAPI schema, and has had no effect since #1448. The provider.basic_auth column is dropped in a later release (#1446, #1448, #1461)
  • Replace any healthcheck that runs curl in the api or playground image: the images no longer ship it. Use python -c "import urllib.request; urllib.request.urlopen('http://localhost:<port>/<path>', timeout=5)", as in compose.example.yml (8000/health for the api, 8501/ping for the playground) (#1487)
  • Check the alerts built on GET /health/models: the response shape is unchanged, but statuses now come from provider liveness (/models) and the gateway concurrency load against qos_limit, not from the provider /metrics. A vLLM provider with waiting requests is no longer yellow, a closed provider that answers is red, and a model with one healthy provider out of several is green (#1443)

Features

  • Keep platform:api#admin in step with the Postgres role: it is granted when an admin user is created, revoked when a user is deleted, and follows a user moving in or out of an admin role through PATCH /v1/admin/users/{user_id} (#1327, #1346, #1412)
  • Grant platform:api#admin to the bootstrap admin at every start-up, idempotently, so a fresh store always has an admin (#1143)
  • Backfill platform:api#admin for every user whose role holds ADMIN (m001_platform_admins) and attach every organization to the platform (m002_organizations_platform). The migrations are idempotent and never delete anything: a second run reports granted=0, and --dry-run writes nothing (#1496)

Refactoring

  • Remove the forwarding toward the provider /metrics endpoint, unused since model health stopped reading it (#1448)
  • Write the router access rule once, with can_access_router and has_providers, and remove their negative counterparts (#1450)

Bug fix

  • Count the literal text of a tiktoken special token (<|endoftext|>) as ordinary text in prompt tokens, instead of answering 500 and leaving sessions that contain it stuck (#1506)
  • Answer 422 with a clear message, instead of 500, to a prompt tiktoken cannot tokenize, on every model-forward endpoint (#1507, #1513)
  • Run alembic upgrade head on a fresh database without dependencies.openfga: two old migrations no longer validate the whole configuration file. To keep the playground database passwords when upgrading from a release older than 0.2.1, upgrade to 0.8.0 first (#1498)
  • Name the missing key and file when scripts/setup_openfga.sh finds no dependencies.openfga, instead of a bare yq error (#1501)

Chore

  • Install only the Debian packages the images use, and drop curl, poppler-utils and unzip: the api image goes from 627.7 to 537.2 MB and from 172 to 100 Debian packages (#1487)
  • Rebuild the apt layer of the images once a day so Debian security fixes reach them, and let Dependabot track fga, yq and oauth2-proxy in the Dockerfiles (#1480, #1482)
  • Ignore three nginx CVEs of the playground image that only affect HTTP/2 and HTTP/3 until 2027-01-15; nginx only serves HTTP/1.1 (#1471)
  • Upgrade openai to 3.46.0 and mistralai to 3.7.0, and refresh Python, Docker and GitHub Actions dependencies (#1438, #1439, #1440, #1441, #1442, #1483, #1484, #1485)
  • Stop sending Semgrep metrics, and merge the breaking changes and deployment checklist of the PR template into one "Deployment and compatibility" section (#1456, #1499)
  • Update the generated documentation and release versions (#1424, #1497)

Playground

  • Remove the load-balancing strategy from the router forms (#1473)

Upgrade notes

  1. Create the openfga database on your PostgreSQL if it does not exist yet, and deploy the openfga-migrate and openfga services of compose.example.yml, with OPENFGA_AUTHN_PRESHARED_KEYS set on both OpenFGA and the API.
  2. Add dependencies.openfga to the configuration file; remove load_balancing_strategy from the routers and basic_auth from the providers, and give every open provider of a model a qos_limit, or none.
  3. Run db-migrate before starting the new API containers, and read its report: m001_platform_admins and m002_organizations_platform print granted and already_granted.
  4. Replace the curl healthchecks of the api and playground containers, and deploy the playground together with the API.
  5. A user created or promoted to admin through SSO login does not receive platform:api#admin yet: m001_platform_admins grants it at the next run of db-migrate.
  6. Rolling back to 0.9.3 leaves the OpenFGA store untouched, and the Alembic migration 2b8e23234402 downgrades without losing data.

Full Changelog: 0.9.3...0.9.4

  • chore(deps): bump pytest-asyncio from 1.4.1 to 1.4.1.post1 by @dependabot[bot] in #1442
  • chore(deps): bump the github-actions group across 2 directories with 1 update by @dependabot[bot] in #1438
  • chore(deps): bump the python-minor-and-patch group with 4 updates by @dependabot[bot] in #1439
  • chore(deps): bump mistralai from 2.0.0 to 3.7.0 by @dependabot[bot] in #1440
  • feat(health): compute the model health from the gateway concurrency l… by @benjaminpilia in #1443
  • refactor(providers): remove the forwarding toward the provider /metrics endpoint by @benjaminpilia in #1448
  • feat(auth): use openfga to implement rebac protocole and implement organization creation by @tibo-pendino in #1143
  • chore(doc): update generated documentation and release versions by @github-actions[bot] in #1424
  • refactor(domain): move the remaining callers to can_access_router / has_providers and remove their negative counterparts by @benjaminpilia in #1450
  • ci(github): merge the breaking changes block and the deployment check… by @benjaminpilia in #1456
  • refactor(providers): remove basic_auth from the providers, keeping the column (#1445) by @benjaminpilia in #1461
  • ci(trivy): ignore the three nginx HTTP/2 and HTTP/3 CVEs of the playground image until 2027-01-15 by @benjaminpilia in #1471
  • feat(openfga): authorize organization deletion with OpenFGA by @tibo-pendino in #1244
  • feat(openfga): grant the platform admin relation when creating an admin user by @tibo-pendino in #1327
  • feat(openfga): check platform:api#can_create_user on POST /v1/admin/users by @tibo-pendino in #1339
  • feat(openfga): check platform:api#can_delete_user on DELETE /v1/admin/users by @tibo-pendino in #1341
  • feat(openfga): detach the platform admin relation when deleting a user by @tibo-pendino in #1346
  • feat(openfga): check platform:api#can_read_user on GET /v1/admin/users by @tibo-pendino in #1347
  • feat(openfga): check platform:api#can_read_user on GET /v1/admin/users/{user_id} by @tibo-pendino in #1350
  • feat(openfga): check platform:api#can_update_user on PATCH /v1/admin/users/{user_id} by @tibo-pendino in #1351
  • feat(openfga): keep the platform admin relation in step with role changes by @bakr-a in #1412
  • ci(docker): refresh the Debian packages of the images once a day (#1476) by @benjaminpilia in #1480
  • ci(dependabot): track the images and binaries copied into the Dockerfiles (#1477) by @benjaminpilia in #1482
  • feat(routers): infer the load-balancing strategy from the providers' qos_limit (#1389) by @benjaminpilia in #1473
  • chore(deps): bump the docker group across 2 directories with 2 updates by @dependabot[bot] in #1483
  • chore(deps): bump the github-actions group across 1 directory with 2 updates by @dependabot[bot] in #1484
  • chore(deps): bump the python-minor-and-patch group with 6 updates by @dependabot[bot] in #1485
  • chore(deps): bump openai from 2.15.0 to 3.46.0 by @dependabot[bot] in #1441
  • ci(docker)!: install only the Debian packages the images use (#1478) by @benjaminpilia in #1487
  • fix(alembic): stop validating the whole configuration file in migrations (#1495) by @benjaminpilia in #1498
  • fix(openfga): name the missing key when the configuration file has no dependencies.openfga by @benjaminpilia in #1501
  • feat(semgrep): stop sending metrics to Sempgrep by @moscaale in #1499
  • chore(doc): update generated documentation and release versions by @github-actions[bot] in #1497
  • feat(routers)!: reject routers that mix providers with and without a qos_limit (#1489) by @benjaminpilia in #1502
  • fix(chat): count special-token strings as ordinary text in prompt tokens (#1406) by @leoguillaume in #1506
  • fix(chat): return a 422 instead of a 500 when the prompt is too large to tokenize by @leoguillaume in #1507
  • fix(chat): count tokens with encode() so an untokenizable prompt answers 422 by @bakr-a in #1513
  • feat(openfga): ship the OpenFGA data migrations with OpenGateLLM by @tibo-pendino in #1496