Skip to content

Support Azure OpenAI deployment-name resolution in the router #2

@navintkr

Description

@navintkr

Azure OpenAI doesn't surface the underlying model id through
vscode.lm — it surfaces a deployment name chosen by whoever
provisioned the resource (e.g. gpt-4o-prod, my-team-mini). Right
now Token Proctor's router only matches on canonical ids, so Azure
users see their deployments as "unknown" and get routed to whatever
non-Azure model is available.

What to do

  1. Add an optional azureDeployments section to .token-proctor.json
    that maps deployment name → canonical model id, e.g.:
    {
      "azureDeployments": {
        "gpt-4o-prod": "gpt-4o",
        "my-team-mini": "gpt-4o-mini"
      }
    }
  2. Update src/core/policy.ts to parse the new
    field.
  3. In src/core/modelRouter.ts, when
    resolving a model id that isn't in the catalog, check the deployment
    map before marking it unknown.
  4. Document it in the README policy block.

Acceptance

  • New config field parsed without breaking existing policies.
  • A deployment name like my-team-mini gets costed as
    gpt-4o-mini in the estimate.
  • Unit test covering a policy with two deployments.

Why this matters

Teams on Azure-hosted Copilot / Foundry are exactly the audience that
cares most about cost visibility — and today they get the worst
experience.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions