Feat/add litellm provider#260
Open
RheagalFire wants to merge 3 commits into
Open
Conversation
Author
Author
|
@Wh1isper do you have any update on this PR? |
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.
Description
Adds
SingleTableLiteLLMModelas a new LLM-based synthetic data generation model alongsideSingleTableGPTModel. Uses LiteLLM to route to 100+ LLM providers through a single class.Files changed:
sdgx/models/LLM/single_table/litellm.py-- NewSingleTableLiteLLMModel(LLMBaseModel)following the exact same pattern asgpt.py:ask_llm(),fit()(raw data + metadata),sample()with batch querying, same prompt templates. Useslitellm.completion()withdrop_params=Truefor cross-provider kwarg compatibility.pyproject.toml-- Addedlitellm>=1.80.0,<1.87under[project.optional-dependencies].litellm.Motivation and Context
The existing
SingleTableGPTModelis hardcoded to OpenAI's API. Users who want to generate synthetic data using Anthropic, Google, Groq, local models via Ollama, or any other provider have no path today. Related: issue #259 requests adding MiniMax as a provider -- LiteLLM covers MiniMax and 100+ other providers in one integration.LiteLLM provides a unified interface where users switch providers by changing the model string (e.g.
anthropic/claude-sonnet-4-6,groq/llama-3.3-70b-versatile) without changing code. API keys are read from provider-specific environment variables automatically.How has this been tested?
Testing environment: macOS (Apple Silicon), Python 3.12, litellm 1.85.0
Lint:
Live e2e against Anthropic:
Existing test suite: 10 pre-existing collection errors on both main and this branch (unchanged). No regressions introduced.
Impact on other areas: Additive only.
SingleTableGPTModelandLLMBaseModelare untouched. The new file is a sibling togpt.pywith no shared mutable state.Types of changes
Checklist: