Skip to content

feat: import LiteLLM wildcard models - #2915

Merged
howardjohn merged 3 commits into
agentgateway:mainfrom
FenjuFu:feat/litellm-wildcard-import
Aug 7, 2026
Merged

howardjohn merged 3 commits into
agentgateway:mainfrom
FenjuFu:feat/litellm-wildcard-import

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • convert LiteLLM public wildcard model names that agentgateway can represent, including *, prefix wildcards, and suffix wildcards
  • preserve the requested model for identity provider wildcards such as openai/* by omitting a literal wildcard from params.model
  • emit explicit unsupported findings for middle/multiple wildcards and wildcard rewrites that agentgateway cannot represent safely
  • expand the existing wildcard fixture and golden snapshot

This addresses the wildcard model conversion checkbox in #2607. Model-group aliases and other importer follow-ons remain out of scope.

Validation

  • git diff --check
  • generated output continues to be validated by the importer's native LocalConfig loader in the golden test
  • local Rust execution was unavailable because downloading the repository-pinned Rust 1.97 toolchain from static.rust-lang.org failed with a TLS handshake error; GitHub Actions will run the Rust test suite

Copilot AI lite review requested due to automatic review settings August 7, 2026 08:20
@FenjuFu
FenjuFu requested a review from a team as a code owner August 7, 2026 08:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds LiteLLM wildcard model import support to the standalone agentgateway import pipeline, aligning emitted model patterns with agentgateway’s concrete model matching semantics while producing explicit findings for wildcard cases that can’t be represented safely.

Changes:

  • Import “safe” wildcard model patterns (*, prefix-wildcard, suffix-wildcard) and omit params.model when the upstream model contains a wildcard so requests preserve the caller’s concrete model.
  • Emit unsupported findings for middle/multiple wildcards and for upstream wildcard rewrites that would change semantics in a way agentgateway can’t represent safely.
  • Expand the LiteLLM wildcard fixture and golden snapshot; rename the related golden test.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
crates/agentgateway/src/import.rs Implements wildcard model pattern validation/import rules and adds targeted unsupported findings for non-representable wildcard cases.
crates/agentgateway/src/tests/import/litellm/wildcard-model.yaml Expands fixture coverage for safe wildcard patterns and unsupported wildcard edge cases.
crates/agentgateway/src/tests/import/litellm/wildcard-model.snap Updates golden snapshot to include imported wildcard models and the new findings emitted for unsupported patterns.
Suppressed comments (1)

crates/agentgateway/src/import.rs:818

  • The upstream-wildcard-rewrite unsupported finding would be more actionable if it included both the public model pattern and the upstream model pattern that triggered the rewrite rejection.
			source_path: format!("{source_path}.litellm_params.model"),
			status: ImportStatus::Unsupported,
			message: "LiteLLM upstream wildcard rewrites cannot be represented safely and the model was not emitted"
				.to_string(),
		});

Comment thread crates/agentgateway/src/import.rs Outdated
Comment on lines +795 to +797
message: "LiteLLM model wildcards must appear at most once, at the beginning or end; the model was not emitted"
.to_string(),
});
@howardjohn
howardjohn merged commit 26bfdd3 into agentgateway:main Aug 7, 2026
11 checks passed
@danehans

Copy link
Copy Markdown
Collaborator

Thanks @FenjuFu for the PR. Are you able to help with any of the other checkboxes in the issue?

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.

4 participants