Repository navigation
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.ymlreadsOPENFGA_HOST,OPENFGA_PORTandOPENFGA_AUTHN_PRESHARED_KEYS, the pre-shared key the OpenFGA server also reads. OpenFGA stores its data in its ownopenfgaPostgreSQL database (#1143, #1501) - Create the
openfgadatabase yourself on an existing PostgreSQL:compose.example.ymlcreates it throughscripts/postgres_entrypoint.sh, which the postgres image only runs on an empty data directory (#1143) - Authorize
POSTandDELETE /v1/admin/organizationsandGET,POST,PATCHandDELETE /v1/admin/userswith OpenFGA: they answer 403 to a user who does not holdplatform: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 theadminpermission 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-migratenow runsalembic upgrade head, thenscripts/setup_openfga.sh(store and model), thenpython -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_strategyon routers: it is ignored when sent and no longer returned by the admin router endpoints. Routers whose providers all have aqos_limitsend each request to the provider with the lowest load rate; the others shuffle their providers, including those set toleast_busy. Run the Alembic migration2b8e23234402, and deploy the playground together with the API (#1473) - Give a
qos_limitto every open provider of a router, or to none of them:POSTandPATCH /v1/admin/providersanswer 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_authfield inPOST /v1/admin/providersand in the configuration file: it is ignored, no longer in the OpenAPI schema, and has had no effect since #1448. Theprovider.basic_authcolumn is dropped in a later release (#1446, #1448, #1461) - Replace any healthcheck that runs
curlin the api or playground image: the images no longer ship it. Usepython -c "import urllib.request; urllib.request.urlopen('http://localhost:<port>/<path>', timeout=5)", as incompose.example.yml(8000/healthfor the api,8501/pingfor 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 againstqos_limit, not from the provider/metrics. A vLLM provider with waiting requests is no longeryellow, a closed provider that answers isred, and a model with one healthy provider out of several isgreen(#1443)
Features
- Keep
platform:api#adminin 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 throughPATCH /v1/admin/users/{user_id}(#1327, #1346, #1412) - Grant
platform:api#adminto the bootstrap admin at every start-up, idempotently, so a fresh store always has an admin (#1143) - Backfill
platform:api#adminfor every user whose role holdsADMIN(m001_platform_admins) and attach every organization to the platform (m002_organizations_platform). The migrations are idempotent and never delete anything: a second run reportsgranted=0, and--dry-runwrites nothing (#1496)
Refactoring
- Remove the forwarding toward the provider
/metricsendpoint, unused since model health stopped reading it (#1448) - Write the router access rule once, with
can_access_routerandhas_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 headon a fresh database withoutdependencies.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.shfinds nodependencies.openfga, instead of a bare yq error (#1501)
Chore
- Install only the Debian packages the images use, and drop
curl,poppler-utilsandunzip: 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,yqandoauth2-proxyin 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
- Create the
openfgadatabase on your PostgreSQL if it does not exist yet, and deploy theopenfga-migrateandopenfgaservices ofcompose.example.yml, withOPENFGA_AUTHN_PRESHARED_KEYSset on both OpenFGA and the API. - Add
dependencies.openfgato the configuration file; removeload_balancing_strategyfrom the routers andbasic_authfrom the providers, and give every open provider of a model aqos_limit, or none. - Run
db-migratebefore starting the new API containers, and read its report:m001_platform_adminsandm002_organizations_platformprintgrantedandalready_granted. - Replace the
curlhealthchecks of the api and playground containers, and deploy the playground together with the API. - A user created or promoted to admin through SSO login does not receive
platform:api#adminyet:m001_platform_adminsgrants it at the next run ofdb-migrate. - Rolling back to 0.9.3 leaves the OpenFGA store untouched, and the Alembic migration
2b8e23234402downgrades 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