feat: Async Journey: LiteLLM Removal from Async Engine#310
Open
eric-tramel wants to merge 1 commit intoasync/async-facadefrom
Open
feat: Async Journey: LiteLLM Removal from Async Engine#310eric-tramel wants to merge 1 commit intoasync/async-facadefrom
eric-tramel wants to merge 1 commit intoasync/async-facadefrom
Conversation
Comprehensive analysis of removing the litellm dependency from Data Designer. Covers blast radius (per-phase), provider SDK research (OpenAI, Anthropic, Bedrock), risk assessment, and a 4-phase implementation plan using the models_v2/ parallel stack approach. Co-Authored-By: Remi <noreply@anthropic.com>
Greptile OverviewGreptile SummaryAdds comprehensive planning document for removing LiteLLM dependency from Data Designer. The document is thorough, well-structured, and demonstrates deep understanding of the codebase through 10 independent reviewer validations. Key strengths:
Implementation strategy:
The document correctly identifies that Data Designer underuses LiteLLM (single-deployment Router instead of load balancing), making removal feasible. The parallel stack approach via
|
| Filename | Overview |
|---|---|
| LITELLM_REMOVAL_ANALYSIS.md | New comprehensive planning document analyzing LiteLLM removal strategy with 4-phase implementation plan |
Sequence Diagram
sequenceDiagram
participant Config as Config Layer
participant Factory as models_v2/factory.py
participant Facade as models_v2/facade.py
participant Client as ModelClient (OpenAI/Anthropic/Bedrock)
participant SDK as Provider SDK
participant API as Provider API
Note over Config,Factory: Phase 1: OpenAI Adapter
Config->>Factory: create_model_registry(model_configs)
Factory->>Factory: Construct OpenAIModelClient
Factory->>Client: Initialize with api_key, base_url
Factory->>Facade: ModelFacade(client=OpenAIModelClient)
Note over Facade,API: Inference Request Flow
Facade->>Facade: completion(messages, **params)
Facade->>Client: client.completion(messages, **kwargs)
Client->>Client: Translate DD params → SDK params
Client->>SDK: await sdk.chat.completions.create(...)
SDK->>SDK: Built-in retry/backoff
SDK->>API: HTTPS POST /v1/chat/completions
API-->>SDK: 200 OK with response
SDK-->>Client: OpenAI response object
Client->>Client: Extract content, tool_calls, usage
Client-->>Facade: CompletionResponse
Facade-->>Config: Generated text
Note over Factory,Client: Phase 3: Multi-Provider
Factory->>Factory: match provider_type
alt provider_type == "openai"
Factory->>Client: OpenAIModelClient
else provider_type == "anthropic"
Factory->>Client: AnthropicModelClient
Note over Client: Translates content blocks → string
else provider_type == "bedrock"
Factory->>Client: BedrockModelClient
Note over Client: Manual retry for throttling
end
Note over Facade,SDK: Error Handling
SDK-->>Client: SDK-specific exception (e.g., RateLimitError)
Client->>Client: Map to DD error types
Client-->>Facade: ModelRateLimitError
Facade-->>Config: Propagate with FormattedLLMErrorMessage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a comprehensive analysis of removing the
litellmdependency from Data Designer. This is a planning document — no code changes.Key findings
engine/models/andengine/models_v2/)Implementation plan (4 phases)
models_v2/— OpenAI SDK adapter, keep OpenAI response format as canonical type.models/untouched as fallback.models/fallback still available.models/, remove litellm from deps. Only after all adapters are proven.Reviewed by
10 independent code reviewers examined the report against the actual codebase. Corrections incorporated: expanded test blast radius (4 files, ~56 functions), upgraded Anthropic risk to HIGH, added MCP facade cross-layer caveat, corrected dependency impact analysis.