{{ message }}
refactor: create tensorzero-providers crate (step 1)#7305
Open
AntoineToussaint wants to merge 4 commits intopr2-inference-traits-to-sharedfrom
Open
refactor: create tensorzero-providers crate (step 1)#7305AntoineToussaint wants to merge 4 commits intopr2-inference-traits-to-sharedfrom
AntoineToussaint wants to merge 4 commits intopr2-inference-traits-to-sharedfrom
Conversation
Move GCP credential resolution and `BatchConfig` building out of the GCP
provider constructors and into `crate::model` callers. The provider
constructors now take pre-resolved `GCPVertexCredentials` and a fully
built `Option<BatchConfig>` directly, so the GCP provider modules no
longer depend on `crate::config::provider_types::*` or
`crate::model_table::{GCPVertexAnthropicKind, GCPVertexGeminiKind,
ProviderTypeDefaultCredentials}`.
This removes the last blocker preventing extraction of `providers/`
into a standalone `tensorzero-providers` crate.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move shared types and utilities out of tensorzero-core into tensorzero-inference-types, in preparation for extracting crates/tensorzero-core/src/providers/ into a standalone tensorzero-providers crate in a follow-up PR. Moved (re-exported from core for backward compatibility): - `InferenceProvider`, `WrappedProvider`, `TensorZeroEventError` from `tensorzero-core/src/inference/mod.rs` to a new `tensorzero-inference-types::provider_trait` module. The trait is the linchpin every provider implements; relocating it lets the providers crate live without depending on tensorzero-core. - `BatchRequestRow` and `UnparsedBatchRequestRow` (plus their `sqlx::FromRow` impl for `PgRow`) into `tensorzero-inference-types`. The orphan rule means the FromRow impl had to follow the type. - `deprecation_warning`, `is_mock_mode`, `get_mock_provider_api_base` into a new `tensorzero-inference-types::utils` module. Also exposes `tensorzero-inference-types::serde_helpers` and adds `deserialize_json_string` to it (needed by the moved BatchRequestRow). Adds `async-trait` and `reqwest-sse-stream` as deps of `tensorzero-inference-types`. No behavior change. `cargo check --all-targets --all-features` and `cargo clippy --all-targets --all-features -- -D warnings` both pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…-openai providers) Create the `tensorzero-providers` crate and move the first batch of provider files that have no dependency on `openai/`: Moved: - helpers.rs, helpers_thinking_block.rs, chat_completions.rs (foundation) - aws_common.rs, aws_bedrock.rs, aws_sagemaker.rs - anthropic.rs, gcp_vertex_anthropic.rs - gcp_vertex_gemini/, google_ai_studio_gemini.rs Remaining in core (depend on openai/ or core test infra): - openai/, azure, deepseek, fireworks, groq, hyperbolic, mistral, openrouter, sglang, tgi, together, vllm, xai, dummy, test_helpers Also: - GCPVertexGeminiSupervisedRow refactored to own Vec<FunctionToolDef> - Extension trait for building supervised rows from LazyRenderedSample - From<&FunctionTool> for FunctionToolDef added in core - Pre-commit exclusion for providers gcp_vertex_gemini test key - warn_inference_parameter_not_supported + serialize_or_log added to tensorzero_inference_types::utils Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 tasks
2d6c9ad to
dd22682
Compare
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
Stacks on #7303. Creates the
tensorzero-providerscrate and moves the first batch of providers — those with no dependency onopenai/.Moved (11 modules):
helpers,helpers_thinking_block,chat_completionsaws_common,aws_bedrock,aws_sagemakeranthropic,gcp_vertex_anthropicgcp_vertex_gemini,google_ai_studio_geminiStill in core (moved in step 2):
openai/,azure,deepseek,fireworks,groq,hyperbolic,mistral,openrouter,sglang,tgi,together,vllm,xaiTest plan
cargo check --all-targets --all-featurescargo clippy --all-targets --all-features -- -D warnings🤖 Generated with Claude Code