-
Notifications
You must be signed in to change notification settings - Fork 762
Move optimization credentials to configuration #5410
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/merge-queue |
|
🚀 Merge queue workflow triggered! View the run: https://github.com/tensorzero/tensorzero/actions/runs/20508839409 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors optimization configuration by moving credential-like fields (API keys, account IDs, API base URLs) from individual optimization job configs to provider-level configuration. It also unifies mock server handling under a single environment variable TENSORZERO_INTERNAL_MOCK_PROVIDER_API (renamed from multiple provider-specific environment variables) to support testing of both batch inference and optimization workflows.
Key Changes:
- Credentials and provider-specific settings (e.g., Fireworks
account_id, Together wandb/HuggingFace tokens) moved from per-job optimizer configs to[provider_types.<provider>.sft]sections in gateway config - Mock API handling unified under
TENSORZERO_INTERNAL_MOCK_PROVIDER_APIenvironment variable with new helper functions inutils/mock.rs - All optimizer configs (
load()methods) simplified from async to sync since credential resolution is now handled at runtime via provider defaults
Reviewed changes
Copilot reviewed 97 out of 111 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
tensorzero-core/src/optimization/{openai_sft,openai_rft,fireworks_sft,together_sft,dicl,gepa}/mod.rs |
Removed credential/api_base fields from configs, simplified load() to sync, credentials now fetched at job launch/poll time |
tensorzero-core/src/config/provider_types.rs |
Added FireworksSFTConfig and TogetherSFTConfig for provider-level SFT settings |
tensorzero-core/src/utils/mock.rs |
New module with is_mock_mode() and get_mock_provider_api_base() helpers |
tensorzero-optimizers/src/{openai_sft,openai_rft,fireworks_sft,together_sft}.rs |
Updated to fetch credentials and API base from config at runtime instead of storing in job handle |
ui/fixtures/config/tensorzero.toml |
Added Fireworks SFT account_id configuration |
ui/fixtures/config/tensorzero.mock_optimization.toml |
Deleted (no longer needed with new mock approach) |
| Docker compose files | Renamed mock-inference-provider to mock-provider-api |
| CI configurations | Updated environment variables and container names |
| Python client and TypeScript bindings | Removed credential parameters from optimizer constructors |
| Recipes and documentation | Updated to reflect new configuration approach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is being reviewed by Cursor Bugbot
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 100 out of 114 changed files in this pull request and generated no new comments.
|
/merge-queue |
|
@codex review |
|
🚀 Merge queue workflow triggered! View the run: https://github.com/tensorzero/tensorzero/actions/runs/20509067148 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
/merge-queue |
|
@codex review |
|
🚀 Merge queue workflow triggered! View the run: https://github.com/tensorzero/tensorzero/actions/runs/20509388384 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 101 out of 115 changed files in this pull request and generated no new comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@greptile review |
Greptile SummaryThis PR successfully centralizes optimizer credentials in configuration files and refactors mock provider handling. The changes move credential-like fields (API keys, account IDs, base URLs) from per-job optimizer configurations to Major Changes
Implementation Quality
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant UI as UI/Client
participant Gateway as Gateway
participant Config as Configuration
participant Optimizer as Optimizer
participant ProviderAPI as Provider API
Note over UI,ProviderAPI: Optimization Job Launch Flow
UI->>Gateway: POST /optimize (job config)
Gateway->>Config: Load provider_types config
Config-->>Gateway: Provider SFT settings<br/>(account_id, credentials, etc)
Gateway->>Optimizer: launch(config, credentials)
Optimizer->>Config: Get provider defaults
Config-->>Optimizer: Credential locations<br/>(from provider_types)
Optimizer->>Optimizer: Resolve credentials<br/>(API keys, etc)
Optimizer->>ProviderAPI: Upload training data
ProviderAPI-->>Optimizer: File/dataset ID
Optimizer->>ProviderAPI: Create fine-tuning job
ProviderAPI-->>Optimizer: Job ID
Optimizer-->>Gateway: JobHandle (minimal state)
Gateway-->>UI: Job created response
Note over UI,ProviderAPI: Optimization Job Polling Flow
UI->>Gateway: GET /optimize/status (job_handle)
Gateway->>Config: Load provider_types config
Config-->>Gateway: Provider SFT settings
Gateway->>Optimizer: poll(job_handle)
Optimizer->>Config: Get provider defaults
Config-->>Optimizer: Credential locations
Optimizer->>Optimizer: Resolve credentials
Optimizer->>ProviderAPI: Check job status
ProviderAPI-->>Optimizer: Job status/model info
Optimizer-->>Gateway: OptimizationJobInfo
Gateway-->>UI: Status response
Note over Config,ProviderAPI: Key Changes in This PR
Note over Config: Credentials moved from<br/>per-job config to<br/>provider_types config
Note over Optimizer: JobHandle stores<br/>minimal state<br/>(no credentials)
Note over ProviderAPI: Mock provider unified<br/>under single API
|
Greptile found no issues!From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section. This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR". |
|
/merge-queue |
|
@codex review |
|
🚀 Merge queue workflow triggered! View the run: https://github.com/tensorzero/tensorzero/actions/runs/20510538059 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 104 out of 118 changed files in this pull request and generated no new comments.
|
Codex Review: Didn't find any major issues. Bravo. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
/merge-queue |
|
🚀 Merge queue workflow triggered! View the run: https://github.com/tensorzero/tensorzero/actions/runs/20510909893 |
|
/merge-queue |
|
🚀 Merge queue workflow triggered! View the run: https://github.com/tensorzero/tensorzero/actions/runs/20511270037 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 104 out of 118 changed files in this pull request and generated no new comments.
api_baseand account IDs from the optimizer interface #5384TENSORZERO_INTERNAL_MOCK_PROVIDER_APIinstead of configuration, and rename tomock-provider-api(since it covers more than inference now).Note
Centralizes optimizer credential management and standardizes the mock provider across the stack.
provider_types.*.sftblocks (Fireworks, GCP Vertex Gemini, Together); optimizer loading made sync; internal loaders updated to useBox::pin.mock-inference-provider→mock-provider-api; adoptTENSORZERO_INTERNAL_MOCK_PROVIDER_API; all compose, env, and scripts updated; gateway uses mock API base for OpenAI when set.mock-provider-api; added mock-only UI E2E job; adjusted build/push steps.mockmarker; minor test script quoting fix.sftconfig reference details; update Fireworks SFT recipe to use configaccount_id; minor benchmark command change.Written by Cursor Bugbot for commit 687a61d. This will update automatically on new commits. Configure here.
Important
Centralizes optimizer credentials in configuration and standardizes mock provider API for testing.
TENSORZERO_INTERNAL_MOCK_PROVIDER_APIfor standardization.provider_typesforfireworks.sft,gcp_vertex_gemini.sft, andtogether.sftin configuration files.mock-inference-providerwithmock-provider-apiacross tests and CI configurations.This description was created by
for 687a61d. You can customize this summary. It will automatically update as commits are pushed.