Skip to content

Managed batches fixes for vertex - #22464

Merged
Sameerlite merged 2 commits into
BerriAI:mainfrom
Point72:ephrimstanley/batch-fixes-feb27
Mar 3, 2026
Merged

Managed batches fixes for vertex#22464
Sameerlite merged 2 commits into
BerriAI:mainfrom
Point72:ephrimstanley/batch-fixes-feb27

Conversation

@ephrimstanley

Copy link
Copy Markdown
Contributor

Relevant issues

Pre-Submission checklist

Please complete all items before asking a LiteLLM maintainer to review your PR

  • I have Added testing in the tests/litellm/ directory, Adding at least 1 test is a hard requirement - see details
  • My PR passes all unit tests on make test-unit
  • My PR's scope is as isolated as possible, it only solves 1 specific problem
  • I have requested a Greptile review by commenting @greptileai and received a Confidence Score of at least 4/5 before requesting a maintainer review

CI (LiteLLM team)

CI status guideline:

  • 50-55 passing tests: main is stable with minor issues.
  • 45-49 passing tests: acceptable but needs attention
  • <= 40 passing tests: unstable; be careful with your merges and assess the risk.
  • Branch creation CI run
    Link:

  • CI run for the last commit
    Link:

  • Merge / cherry-pick CI run
    Links:

Type

🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test

Changes

@vercel

vercel Bot commented Mar 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Error Error Mar 1, 2026 1:46am

Request Review

@ephrimstanley

Copy link
Copy Markdown
Contributor Author

@greptileai

@greptile-apps

greptile-apps Bot commented Mar 1, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR fixes several issues with Vertex AI managed batches and file operations: corrects the GcsSource.uris type from str to List[str], simplifies batch cost calculation by reading usageMetadata directly instead of transforming through VertexGeminiConfig, implements file retrieve/delete/content endpoints for Vertex AI GCS files, adds error body logging for batch creation failures, and fixes managed file ID resolution when model_info is nested under litellm_metadata.

  • Type fix: GcsSource.uris corrected to List[str] with matching usage in VertexAIBatchTransformation
  • Batch cost simplification: calculate_vertex_ai_batch_cost_and_usage now extracts token counts from usageMetadata directly and uses batch_cost_calculator, removing the complex VertexGeminiConfig transformation pipeline
  • File operations: VertexAIFilesConfig now supports retrieve, delete, and content operations against GCS via the Storage JSON API
  • Bug: transform_delete_file_response reconstructs a gs:// URI missing the bucket name — the object path is extracted from the URL but the bucket portion between /b/ and /o/ is dropped
  • Bug: afile_retrieve accepts "vertex_ai" but delegates to sync file_retrieve which does not include "vertex_ai" in its Literal type, causing a mismatch at runtime
  • Managed files: Fallback lookup for model_info under litellm_metadata correctly resolves file IDs in batch operations

Confidence Score: 3/5

  • PR has two bugs that will cause runtime issues for Vertex AI file retrieval and delete ID reconstruction — should be fixed before merging.
  • The batch cost simplification and type fix are solid improvements. However, the sync file_retrieve function was not updated to accept vertex_ai, so afile_retrieve will fail at runtime. Additionally, transform_delete_file_response produces incorrect GCS URIs missing the bucket name. Both are clear bugs introduced by this PR.
  • Pay close attention to litellm/files/main.py (sync function missing vertex_ai provider) and litellm/llms/vertex_ai/files/transformation.py (delete response missing bucket in reconstructed URI).

Important Files Changed

Filename Overview
litellm/files/main.py Added vertex_ai to afile_retrieve Literal type, but the sync file_retrieve it delegates to was not updated — will cause runtime failures for vertex_ai file retrieval.
litellm/llms/vertex_ai/files/transformation.py Implements GCS file retrieve/delete/content operations. Delete response reconstruction omits the bucket name from the returned file ID, producing an incorrect gs:// URI.
litellm/llms/vertex_ai/batches/transformation.py Correctly fixes GcsSource(uris=...) to pass a list instead of a bare string, matching the updated type definition.
litellm/types/llms/vertex_ai.py Type fix: GcsSource.uris changed from str to List[str] to match the Vertex AI API spec.
litellm/batches/batch_utils.py Simplified batch cost calculation by extracting usageMetadata directly instead of using VertexGeminiConfig transformation. Clean, correct approach using batch_cost_calculator.
litellm/llms/vertex_ai/batches/handler.py Adds try/except around HTTP POST to log error body on HTTPStatusError. Minor style issue with redundant hasattr check and f-string in logger.
enterprise/litellm_enterprise/proxy/hooks/managed_files.py Adds fallback to check litellm_metadata.model_info when top-level model_info is absent — fixes batch file ID resolution for managed files.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[afile_retrieve vertex_ai] --> B[file_retrieve sync]
    B -->|"❌ Missing vertex_ai in Literal"| C[Routing Failure]
    
    D[Batch Create Request] --> E[VertexAIBatchTransformation]
    E --> F["GcsSource(uris=[file_id])"]
    F --> G[Vertex AI API POST]
    G -->|HTTPStatusError| H[Log error body + re-raise]
    G -->|200 OK| I[Transform to LiteLLMBatch]
    
    J[Batch Retrieve] --> K[Get output file content]
    K --> L[calculate_vertex_ai_batch_cost_and_usage]
    L --> M[Extract usageMetadata per line]
    M --> N[batch_cost_calculator]
    N --> O[Aggregate cost + Usage]
    
    P[File Delete Request] --> Q[_parse_gcs_uri]
    Q --> R["GCS Storage API DELETE /b/{bucket}/o/{object}"]
    R --> S[transform_delete_file_response]
    S -->|"❌ Missing bucket in gs:// URI"| T[Incorrect file ID returned]
Loading

Last reviewed commit: b16397a

@greptile-apps greptile-apps Bot 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.

11 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment thread litellm/files/main.py
async def afile_retrieve(
file_id: str,
custom_llm_provider: Literal["openai", "azure", "gemini", "hosted_vllm", "manus"] = "openai",
custom_llm_provider: Literal["openai", "azure", "gemini", "vertex_ai", "hosted_vllm", "manus"] = "openai",

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.

Sync file_retrieve missing vertex_ai provider

afile_retrieve now accepts "vertex_ai" (and "gemini"), but it delegates to the synchronous file_retrieve at line 337 which still only accepts Literal["openai", "azure", "hosted_vllm", "manus"]. Calling afile_retrieve(file_id, custom_llm_provider="vertex_ai") will hit the sync function with a provider value it doesn't recognise, causing a type mismatch and likely a routing failure at runtime.

The Literal type on file_retrieve (line 339) needs to be updated to include "gemini" and "vertex_ai" as well.

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.

@ephrimstanley Can you fix this one

Comment on lines +408 to +414
file_id = "deleted"
if hasattr(raw_response, "request") and raw_response.request:
url = str(raw_response.request.url)
if "/o/" in url:
import urllib.parse
encoded_name = url.split("/o/")[-1].split("?")[0]
file_id = f"gs://{urllib.parse.unquote(encoded_name)}"

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.

Reconstructed delete file ID is missing the bucket name

The URL format is https://storage.googleapis.com/storage/v1/b/{bucket}/o/{encoded_object}. When this code does url.split("/o/")[-1], it extracts only the object path, omitting the bucket name. So for a file originally at gs://my-bucket/path/to/file.jsonl, the returned ID would be gs://path/to/file.jsonl instead of gs://my-bucket/path/to/file.jsonl.

The bucket name should also be extracted from the URL (between /b/ and /o/) and prepended. For example:

Suggested change
file_id = "deleted"
if hasattr(raw_response, "request") and raw_response.request:
url = str(raw_response.request.url)
if "/o/" in url:
import urllib.parse
encoded_name = url.split("/o/")[-1].split("?")[0]
file_id = f"gs://{urllib.parse.unquote(encoded_name)}"
file_id = "deleted"
if hasattr(raw_response, "request") and raw_response.request:
url = str(raw_response.request.url)
if "/o/" in url:
import urllib.parse
bucket_part = url.split("/b/")[-1].split("/o/")[0]
encoded_name = url.split("/o/")[-1].split("?")[0]
file_id = f"gs://{bucket_part}/{urllib.parse.unquote(encoded_name)}"

Comment on lines +118 to +121
error_body = e.response.text if hasattr(e, 'response') else "N/A"
litellm.verbose_logger.error(
f"Vertex AI batch create failed: status={e.response.status_code}, body={error_body[:1000]}"
)

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.

Redundant hasattr check and unsafe f-string in logger call

httpx.HTTPStatusError always has a .response attribute (it's a constructor parameter), so hasattr(e, 'response') is always True — this guard is misleading. More importantly, using an f-string in the logger.error() call means the string is always formatted, even when the error log level is disabled. Prefer %-style formatting:

Suggested change
error_body = e.response.text if hasattr(e, 'response') else "N/A"
litellm.verbose_logger.error(
f"Vertex AI batch create failed: status={e.response.status_code}, body={error_body[:1000]}"
)
error_body = e.response.text
litellm.verbose_logger.error(
"Vertex AI batch create failed: status=%s, body=%s",
e.response.status_code, error_body[:1000],
)

@giulio-leone

Copy link
Copy Markdown
Contributor

Automated patch bundle from next-100 unresolved backlog expansion.\nGenerated due limited direct branch-write access; please apply/cherry-pick minimal edits below.\n\n## PR #22464ephrimstanley/batch-fixes-feb27 (3 unresolved)

Unresolved thread summary

  • T1 litellm/files/main.py:298 — Sync file_retrieve missing vertex_ai provider
  • T2 litellm/llms/vertex_ai/files/transformation.py:414 — Reconstructed delete file ID is missing the bucket name
  • T3 litellm/llms/vertex_ai/batches/handler.py:121 — Redundant hasattr check and unsafe f-string in logger call

Minimal patch proposals

  • T1 litellm/files/main.py:298
    • Edit steps:
      1. Add vertex_ai provider handling to file_retrieve to match existing async/provider coverage.
      2. Add or update one focused regression test near this module for the corrected behavior.
  • T2 litellm/llms/vertex_ai/files/transformation.py:414
    • Edit steps:
      1. Reconstruct gs:// file ids using both bucket and object path segments.
      2. Add or update one focused regression test near this module for the corrected behavior.
  • T3 litellm/llms/vertex_ai/batches/handler.py:121
    • Edit steps:
      1. Switch to parameterized logging and remove redundant runtime attribute checks.
      2. Add or update one focused regression test near this module for the corrected behavior.

@Sameerlite Sameerlite 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.

LGTM, just make the small change i have asked

Comment thread litellm/files/main.py
async def afile_retrieve(
file_id: str,
custom_llm_provider: Literal["openai", "azure", "gemini", "hosted_vllm", "manus"] = "openai",
custom_llm_provider: Literal["openai", "azure", "gemini", "vertex_ai", "hosted_vllm", "manus"] = "openai",

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.

@ephrimstanley Can you fix this one

@Sameerlite
Sameerlite merged commit 9ffbd9e into BerriAI:main Mar 3, 2026
29 of 35 checks passed
ephrimstanley added a commit to Point72/litellm that referenced this pull request Mar 3, 2026
Sameerlite added a commit that referenced this pull request Mar 4, 2026
Managed batches - Address PR bot comments from #22464
ghost pushed a commit that referenced this pull request Mar 4, 2026
* add explicit caching to litellm proxy for gemini models via injection

* fix: add missing `supports_function_calling` for deepinfra models

All 55 deepinfra models that had `supports_tool_choice: true` were
missing the `supports_function_calling` flag, causing
`litellm.supports_function_calling()` to incorrectly return False.

Fixes #22619

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Managed batches - Address PR bot comments from #22464

* feat(togetherai): add support for TogetherAI Qwen3.5-397B-A17B model

* Agent Tracing - support context_id based trace id propogation + nested llm calls  (#22626)

* style(ui/): distinguish agent calls from llm calls on ui

* feat: initial grouping working

* feat: set stable contextid for a2a calls - allows for easily passing to downstream llm/mcp calls

* feat(a2a_endpoints.py): fix tracing to avoid recreating logging objects for the same call

allows stable trace id usage

* fix(guardrail_endpoints): handle string ui_type values in _build_field_dict

_build_field_dict unconditionally called .value on ui_type, which crashes
for guardrail configs that use plain strings (e.g. BlockCodeExecutionGuardrailConfigModel
uses "multiselect" and "percentage"). Now checks with hasattr before calling .value.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: propagate trace/session id from headers in MCP server calls

Cherry-picked mcp_server/server.py fixes from 6feb9ba: adds
get_chain_id_from_headers to extract x-litellm-trace-id /
x-litellm-session-id from raw headers, and uses it in call_tool
and list_tools to keep spend logs and tracing consistent with A2A.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

* [Feat] UI - Add Open in New Tab on leftnav Bar (#22731)

* Add minimal dev_config.yaml for proxy development

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* feat(ui): wrap left nav items in <a> tags for open-in-new-tab support

Nav items are now rendered as <a> elements with proper href attributes,
enabling right-click → 'Open in new tab', Ctrl/Cmd+click, and
middle-click to open any sidebar page in a new browser tab.

Normal clicks continue to use SPA navigation (no full page reload).

Applied to both leftnav.tsx (query-param routing) and Sidebar2.tsx
(Next.js file-based routing).

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* [Feat] Add Tool Policies for AI Gateway  (#22732)

* fix: fix ui render

* fix: fix minor bugs

* refactor: use prisma functions instead of raw sql (safer)

* fix(add-new-tiles-to-tool-policies): allow developer to see what's available

* feat: ensure tool allowlist runs correctly for tool names + mcp's

* refactor: more ui improvements

* feat: working key tool blocking

* feat(tools): show tool logs

* refactor: backend code improvements

* refactor: improve log viewer for tools

* fix: address PR review feedback for tool access control

- Add missing blocked_tools column to root schema.prisma (schema drift)
- Invalidate ToolPolicyRegistry after policy mutations so changes take effect immediately
- Remove dead code: unused get_effective_policies, get_tool_policies_cached, and helpers

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: race condition in permission resolution and remove duplicate allowlist check

- Use atomic update_many with object_permission_id=None to prevent concurrent
  requests from creating orphaned permission rows and losing tool blocks
- Remove duplicate allowed_tools enforcement from guardrail (already enforced
  in auth layer via check_tools_allowlist)
- Move inline uuid import to module level

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* update to account for  userAgent

* UI - Add ToolDetails

* input/output policy

* LiteLLM_PolicyAttachmentTable

* LiteLLM_PolicyAttachmentTable

* fix: add _enqueue_tool_registry_upsert

* fix: tool mgmt endpoints

* tool mgmt endpoints

* Update tests/test_litellm/proxy/db/test_tool_registry_writer.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update tests/test_litellm/proxy/db/test_tool_registry_writer.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update tests/test_litellm/proxy/db/test_tool_registry_writer.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix: sync root schema.prisma and fix test_tool_registry_writer for input/output policy

- Migrate root schema.prisma LiteLLM_ToolTable from call_policy to
  input_policy/output_policy, add missing user_agent and last_used_at columns
  (now consistent with litellm/proxy/schema.prisma and litellm-proxy-extras)
- Fix SpendLogToolIndex comment across all three schema files
- Fix all call_policy references in test_tool_registry_writer.py:
  swapped update_tool_policy arguments, wrong get_tools_by_names return type
  assertions, _mock_tool_row setting call_policy instead of input_policy

Addresses Greptile review feedback on PR #22732.

Made-with: Cursor

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* feat(proxy): add key_alias, key_hash, requested_model DD APM span tags (#22710)

* feat(proxy): add key_alias, key_hash, requested_model tags to DD APM spans

* refactor(proxy): consolidate DD APM tag helpers into DDSpanTagger class

* refactor(proxy): move DDSpanTagger to its own file litellm/proxy/dd_span_tagger.py

---------

Co-authored-by: liweiguang <codingpunk@gmail.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Ephrim Stanley <ephrim.stanley@point72.com>
Co-authored-by: Varad Khonde <varadkhonde@gmail.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: Sameer Kankute <sameer@berri.ai>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
shivamrawat1 pushed a commit that referenced this pull request Mar 5, 2026
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…es-feb27

Managed batches fixes for vertex
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…es-mar3

Managed batches - Address PR bot comments from BerriAI#22464
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…I#21881)

* add explicit caching to litellm proxy for gemini models via injection

* fix: add missing `supports_function_calling` for deepinfra models

All 55 deepinfra models that had `supports_tool_choice: true` were
missing the `supports_function_calling` flag, causing
`litellm.supports_function_calling()` to incorrectly return False.

Fixes BerriAI#22619


* Managed batches - Address PR bot comments from BerriAI#22464

* feat(togetherai): add support for TogetherAI Qwen3.5-397B-A17B model

* Agent Tracing - support context_id based trace id propogation + nested llm calls  (BerriAI#22626)

* style(ui/): distinguish agent calls from llm calls on ui

* feat: initial grouping working

* feat: set stable contextid for a2a calls - allows for easily passing to downstream llm/mcp calls

* feat(a2a_endpoints.py): fix tracing to avoid recreating logging objects for the same call

allows stable trace id usage

* fix(guardrail_endpoints): handle string ui_type values in _build_field_dict

_build_field_dict unconditionally called .value on ui_type, which crashes
for guardrail configs that use plain strings (e.g. BlockCodeExecutionGuardrailConfigModel
uses "multiselect" and "percentage"). Now checks with hasattr before calling .value.


* fix: propagate trace/session id from headers in MCP server calls

Cherry-picked mcp_server/server.py fixes from 6feb9ba: adds
get_chain_id_from_headers to extract x-litellm-trace-id /
x-litellm-session-id from raw headers, and uses it in call_tool
and list_tools to keep spend logs and tracing consistent with A2A.


---------


* [Feat] UI - Add Open in New Tab on leftnav Bar (BerriAI#22731)

* Add minimal dev_config.yaml for proxy development

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* feat(ui): wrap left nav items in <a> tags for open-in-new-tab support

Nav items are now rendered as <a> elements with proper href attributes,
enabling right-click → 'Open in new tab', Ctrl/Cmd+click, and
middle-click to open any sidebar page in a new browser tab.

Normal clicks continue to use SPA navigation (no full page reload).

Applied to both leftnav.tsx (query-param routing) and Sidebar2.tsx
(Next.js file-based routing).

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>

* [Feat] Add Tool Policies for AI Gateway  (BerriAI#22732)

* fix: fix ui render

* fix: fix minor bugs

* refactor: use prisma functions instead of raw sql (safer)

* fix(add-new-tiles-to-tool-policies): allow developer to see what's available

* feat: ensure tool allowlist runs correctly for tool names + mcp's

* refactor: more ui improvements

* feat: working key tool blocking

* feat(tools): show tool logs

* refactor: backend code improvements

* refactor: improve log viewer for tools

* fix: address PR review feedback for tool access control

- Add missing blocked_tools column to root schema.prisma (schema drift)
- Invalidate ToolPolicyRegistry after policy mutations so changes take effect immediately
- Remove dead code: unused get_effective_policies, get_tool_policies_cached, and helpers


* fix: race condition in permission resolution and remove duplicate allowlist check

- Use atomic update_many with object_permission_id=None to prevent concurrent
  requests from creating orphaned permission rows and losing tool blocks
- Remove duplicate allowed_tools enforcement from guardrail (already enforced
  in auth layer via check_tools_allowlist)
- Move inline uuid import to module level


* update to account for  userAgent

* UI - Add ToolDetails

* input/output policy

* LiteLLM_PolicyAttachmentTable

* LiteLLM_PolicyAttachmentTable

* fix: add _enqueue_tool_registry_upsert

* fix: tool mgmt endpoints

* tool mgmt endpoints

* Update tests/test_litellm/proxy/db/test_tool_registry_writer.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update tests/test_litellm/proxy/db/test_tool_registry_writer.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* Update tests/test_litellm/proxy/db/test_tool_registry_writer.py

Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* fix: sync root schema.prisma and fix test_tool_registry_writer for input/output policy

- Migrate root schema.prisma LiteLLM_ToolTable from call_policy to
  input_policy/output_policy, add missing user_agent and last_used_at columns
  (now consistent with litellm/proxy/schema.prisma and litellm-proxy-extras)
- Fix SpendLogToolIndex comment across all three schema files
- Fix all call_policy references in test_tool_registry_writer.py:
  swapped update_tool_policy arguments, wrong get_tools_by_names return type
  assertions, _mock_tool_row setting call_policy instead of input_policy

Addresses Greptile review feedback on PR BerriAI#22732.

Made-with: Cursor

---------

Co-authored-by: Krrish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>

* feat(proxy): add key_alias, key_hash, requested_model DD APM span tags (BerriAI#22710)

* feat(proxy): add key_alias, key_hash, requested_model tags to DD APM spans

* refactor(proxy): consolidate DD APM tag helpers into DDSpanTagger class

* refactor(proxy): move DDSpanTagger to its own file litellm/proxy/dd_span_tagger.py

---------

Co-authored-by: liweiguang <codingpunk@gmail.com>
Co-authored-by: Ephrim Stanley <ephrim.stanley@point72.com>
Co-authored-by: Varad Khonde <varadkhonde@gmail.com>
Co-authored-by: Krish Dholakia <krrishdholakia@gmail.com>
Co-authored-by: Sameer Kankute <sameer@berri.ai>
Co-authored-by: Ishaan Jaff <ishaanjaffer0324@gmail.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.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.

3 participants