Repository navigation
fix(e2e): register batch + rust OCR deployments via /model/new - #32166
mubashir1osmani merged 2 commits into
Conversation
The batches conftest registers deployments at runtime with client.create_model(provider.model, provider.litellm_params()), but BatchClient had no create_model and Provider had no litellm_params, so the batch_deployments fixture would AttributeError before any batch test ran. Add create_model/delete_model on BatchClient, the per-provider litellm_params() (openai/azure/vertex_ai/bedrock) on Provider, enable the bedrock provider with its create+retrieve-only scenarios, and update COVERAGE.md to match.
Convert the rust OCR suite from reading the gateway config (model_list / /model/info) to registering each provider's deployment at runtime via /model/new and deleting it on teardown, so nothing is hardcoded into the gateway config and the suite matches the rest of tests/e2e/.
Greptile SummaryThis PR completes the runtime
Confidence Score: 3/5The batch suite changes introduce a method delegation chain that calls a method that does not exist on the target object, meaning the batch deployment fixture will throw before any test body runs against a live proxy. The OCR conversion is clean and wires correctly through EndpointsClient.create_model, which has a working implementation. The batch side has BatchClient.create_model and BatchClient.delete_model both forwarding to self.gateway.create_model/self.gateway.delete_model — methods absent from Gateway (a frozen-slots dataclass; e2e_gateway.py is untouched by this PR). The batch_deployments session fixture calls these unconditionally once the proxy answers its liveness probe, so the entire batch suite fails at fixture setup with AttributeError, reproducing the original breakage this PR aimed to fix. tests/e2e/batches/batch_client.py — the new create_model/delete_model methods delegate to a missing Gateway method and need to be reimplemented directly against self.gateway.transport, following the pattern in tests/e2e/llm_translation/endpoints_client.py.
|
| Filename | Overview |
|---|---|
| tests/e2e/batches/batch_client.py | Adds create_model/delete_model to BatchClient, but both delegate to self.gateway.create_model/self.gateway.delete_model which do not exist on Gateway — will AttributeError on every run with a live proxy. |
| tests/e2e/batches/capabilities.py | Adds litellm_params() to Provider, enables bedrock, and restricts bedrock to encoded/unified scenarios; bedrock raw_model includes provider prefix unlike all other providers, which may cause JSONL validation failures upstream. |
| tests/e2e/llm_translation/test_ocr_rust_e2e.py | Converts from static config-based model discovery to runtime /model/new registration per test; cleanup via resources.defer is correct; uses endpoints_client (which has a working create_model) rather than a missing gateway method. |
| tests/e2e/batches/COVERAGE.md | Documentation updated to reflect runtime registration, bedrock enablement, and the addition of conftest.py to the file table; accurate. |
Reviews (1): Last reviewed commit: "test(e2e): register rust OCR deployments..." | Re-trigger Greptile
| def create_model(self, model_name: str, litellm_params: LiteLLMParamsBody) -> str: | ||
| return self.gateway.create_model(model_name, litellm_params, mode="batch") | ||
|
|
||
| def delete_model(self, model_id: str) -> None: | ||
| self.gateway.delete_model(model_id) |
There was a problem hiding this comment.
Gateway has no create_model or delete_model — both calls will AttributeError at runtime.
BatchClient.create_model delegates to self.gateway.create_model(model_name, litellm_params, mode="batch") and delete_model to self.gateway.delete_model(model_id), but neither method exists on Gateway (e2e_gateway.py is unchanged and defines no such methods; the class also uses slots=True, ruling out dynamic dispatch). The batch_deployments fixture in conftest.py calls these methods unconditionally whenever the proxy is live, so the entire batch suite will fail with AttributeError before any test body runs — the same breakage this PR set out to fix.
EndpointsClient.create_model shows the correct pattern: call self.gateway.transport.post("/model/new", ...) directly, passing ModelInfoBody(id=model_name, mode="batch") for the batch variant. The delete_model counterpart mirrors EndpointsClient.delete_model.
| Provider( | ||
| "bedrock", | ||
| "bedrock-batch", | ||
| "bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0", | ||
| can_cancel=False, | ||
| can_list=False, | ||
| ), |
There was a problem hiding this comment.
Bedrock
raw_model includes the bedrock/ prefix, inconsistent with every other provider.
All other providers store just the bare model identifier in raw_model (e.g. "gpt-4o-mini", "gemini-2.5-flash"). The bedrock row stores "bedrock/us.anthropic.claude-haiku-4-5-20251001-v1:0", which jsonl_model will embed in the JSONL for the "encoded" scenario. If LiteLLM's Bedrock batch handler does not strip the bedrock/ prefix from JSONL request bodies before submission, Bedrock will reject the job. Consider using only the native model ID ("us.anthropic.claude-haiku-4-5-20251001-v1:0") in raw_model and keeping the provider prefix only in litellm_params.model, consistent with the other providers.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Relevant issues
Follow-up to #32165
Linear ticket
Pre-Submission checklist
@greptileaiand received a Confidence Score of at least 4/5 before requesting a maintainer reviewScreenshots / Proof of Fix
Two pieces here. First, a fix: #32165 merged the batches
conftest.pywhosebatch_deploymentsfixture registers deployments at runtime withclient.create_model(provider.model, provider.litellm_params()), but the plumbing those calls need never landed, so onlitellm_internal_stagingtodayBatchClienthas nocreate_modelandProviderhas nolitellm_params. The fixture wouldAttributeErrorbefore any batch test ranWith this branch the batches suite (now including the bedrock cells) and the converted OCR suite collect cleanly
These are live e2e tests; the assertions run in the e2e pipeline against the deployed gateway with real provider keys, and skip locally when no proxy answers the liveness probe
Type
🐛 Bug Fix
Changes
The batches change completes the runtime
/model/newregistration the merged fixture already assumes:BatchClientgetscreate_model/delete_model(mode=batch),Providergets a per-providerlitellm_params()for openai, azure, vertex_ai and bedrock, and the bedrock provider is enabled with its create + retrieve-only scenarios (scenarios_for_provider, no cancel or list upstream).COVERAGE.mdis updated to match. This restores the batches suite that #32165 left non-runnableThe OCR change converts
test_ocr_rust_e2e.pyfrom reading the static gateway config (model_list//model/info, a_ConfiguredModelread) to registering each provider's OCR deployment at runtime via/model/newand deleting it on teardown, so nothing is hardcoded into the gateway config and the suite matches the rest oftests/e2e/. Every case (mistral, azure_ai mistral, azure doc-intelligence, vertex mistral, vertex deepseek) now creates its own deployment, drives a real/v1/ocrcall, and asserts a well-formed document