Skip to content

Add the provider's E2EE coverage to each /v1/models entry - #232

Open
ai-13rac1 wants to merge 1 commit into
13rac1:mainfrom
ai-13rac1:models-teep-member
Open

ai-13rac1 wants to merge 1 commit into
13rac1:mainfrom
ai-13rac1:models-teep-member

Conversation

@ai-13rac1

Copy link
Copy Markdown
Contributor

Problem

With E2EE enabled, teep refuses an endpoint that the provider's E2EE does not cover (see "Why teep refused my request" in docs/api_support.md). The dashboard lists the covered and uncovered endpoints for each provider. A client that reads GET /v1/models cannot see them, so it learns that an endpoint is refused only when it sends a request.

Change

  • Each entry of the aggregated /v1/models list gets a teep member:
    • e2ee_enabled: the E2EE setting of the entry's provider in the running config.
    • e2ee_covers and e2ee_does_not_cover: the endpoint paths that the provider's E2EE covers and does not cover.
  • The lists come from e2eeCoverage, the same function the dashboard uses, which reads each encryptor's CoversE2EE declaration. The change adds no new coverage logic, and no code path names a provider.
  • With E2EE off, both lists are empty arrays, because teep then refuses no endpoint for coverage.
  • The coverage is the provider's. It does not state that each listed model serves every covered endpoint.
  • Teep replaces a teep member that a provider sends, so only teep states the coverage.
  • Teep sends no request to the provider to build the member. The member is computed once per provider for each model-list fetch and is cached with the list.
  • docs/api_support.md describes the member, with an example.

Effect

A client can read from /v1/models which endpoints of a model teep sends with E2EE, and which ones it refuses while E2EE is enabled. Existing members of each entry do not change.

To verify

go test -race ./internal/proxy -run 'TestAnnotateModel|TestModelTeepMember|TestHandleModels'
make check
  • TestModelTeepMember checks that the member holds the same lists as the dashboard for NearDirect with E2EE on, and empty lists with E2EE off.
  • TestAnnotateModel checks the id prefix and that an upstream teep member is replaced.
  • TestHandleModels checks the member through GET /v1/models.

Checklist

  • I added unit tests for new code and regression tests for fixed bugs.
  • make check passes.
  • For a major feature: make integration and make reports pass.
  • I updated the documentation that this change affects.

A client that reads /v1/models could not tell which endpoints teep
refuses for a model while E2EE is enabled. The dashboard showed the
coverage, but the model list did not.

Each entry of the aggregated model list now has a `teep` member: the
E2EE setting of the entry's provider in the running config
(e2ee_enabled) and the endpoints that its E2EE covers and does not
cover (e2ee_covers, e2ee_does_not_cover). The lists come from the same
coverage declarations as the dashboard. With E2EE off both lists are
empty, because teep then refuses no endpoint for coverage. Teep
replaces a `teep` member that a provider sends, and sends no request to
build the member.

To verify: go test ./internal/proxy -run
'TestAnnotateModel|TestModelTeepMember|TestHandleModels'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant