Skip to content

feat: add per-alias Replicate use deployments override and provider-scoped alias sub-config validation - #4018

Merged
akshaydeo merged 1 commit into
devfrom
06-02-feat_add_replicate_alias_config_support
Jun 9, 2026
Merged

feat: add per-alias Replicate use deployments override and provider-scoped alias sub-config validation#4018
akshaydeo merged 1 commit into
devfrom
06-02-feat_add_replicate_alias_config_support

Conversation

@Pratham-Mishra04

@Pratham-Mishra04 Pratham-Mishra04 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds per-alias control over whether Replicate requests are routed to the deployments endpoint or the predictions endpoint. Previously this was only configurable at the key level, meaning all aliases on a single Replicate API token had to use the same endpoint. This change allows individual aliases to override the key-level setting, enabling production-pinned models (deployments) and experimental versioned models (predictions) to coexist under the same key.

Additionally, KeyAliases.Validate now accepts the owning key's provider and rejects provider-specific sub-configs (e.g. AzureAliasCfg, BedrockAliasCfg, VertexAliasCfg, ReplicateAliasCfg) when attached to a key belonging to a different provider.

Changes

  • useDeploymentsEndpoint now accepts a *schemas.BifrostContext and checks ReplicateAliasCfg.UseDeploymentsEndpoint on the resolved alias first, falling back to the key-level ReplicateKeyConfig.UseDeploymentsEndpoint when the alias override is absent.
  • KeyAliases.Validate now takes a ModelProvider argument and returns an error if a provider-specific alias sub-config is attached to a key from a different provider.
  • All call sites for KeyAliases.Validate (config file loading, HTTP handler create/update, GORM BeforeSave hook) pass the owning provider.
  • Tests added for the alias override priority logic and for the cross-provider sub-config validation.

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (React)
  • Docs

How to test

go test ./core/providers/replicate/... ./core/schemas/...

To validate the alias override:

  1. Configure a Replicate key with use_deployments_endpoint: false at the key level.
  2. Add an alias with replicate_alias_cfg.use_deployments_endpoint: true.
  3. Send a request using that alias and confirm it is routed to the deployments endpoint.
  4. Send a request without the alias and confirm it uses the predictions endpoint.

To validate cross-provider sub-config rejection:

  1. Attach an azure_alias_cfg to a Bedrock key alias and confirm the config fails validation with a descriptive error.

Breaking changes

  • Yes
  • No

KeyAliases.Validate() now requires a ModelProvider argument. Any code calling Validate() directly must be updated to pass the provider the key belongs to.

Related issues

Security considerations

None beyond standard config validation.

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

Summary by CodeRabbit

  • New Features

    • Per-alias control for Replicate endpoint selection applied across deployments and all prediction flows (text, chat, responses, images, video, and streams).
  • Bug Fixes / Validation

    • Alias configuration is now provider-aware; alias sub-configs are validated against their provider, surfacing misconfiguration errors earlier.
  • Tests

    • Added unit tests covering alias-level endpoint override precedence and provider-scoped alias validation.

@coderabbitai

coderabbitai Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Pratham-Mishra04, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 27 minutes and 31 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 5fb0502b-0c73-4d4c-8668-84c6683bf3f7

📥 Commits

Reviewing files that changed from the base of the PR and between 3d3e263 and b81beba.

📒 Files selected for processing (8)
  • core/providers/replicate/replicate.go
  • core/providers/replicate/replicate_test.go
  • core/providers/replicate/use_deployments_endpoint_test.go
  • core/schemas/account.go
  • core/schemas/account_test.go
  • framework/configstore/tables/key.go
  • transports/bifrost-http/handlers/provider_keys.go
  • transports/bifrost-http/lib/config.go
📝 Walkthrough

Walkthrough

KeyAliases.Validate now requires a provider argument and validation rejects provider-specific alias sub-configs when the alias provider doesn't match. Replicate's useDeploymentsEndpoint was refactored to accept ctx and prefer a resolved alias's ReplicateAliasCfg.UseDeploymentsEndpoint; all Replicate callers were updated and a unit test was added.

Changes

Provider alias validation and Replicate endpoint override

Layer / File(s) Summary
Provider-scoped alias validation contract and tests
core/schemas/account.go, core/schemas/account_test.go
KeyAliases.Validate() signature changed to Validate(providerKey ModelProvider). Validation now rejects provider-specific alias sub-configs (Azure, Vertex, Bedrock, Replicate) when the alias is registered under a different provider. Tests expanded to cover provider-aware success and error cases.
Validation call site updates
framework/configstore/tables/key.go, transports/bifrost-http/handlers/provider_keys.go, transports/bifrost-http/lib/config.go
Alias validation calls in key persistence (BeforeSave), provider key HTTP handlers (createProviderKey, updateProviderKey), and configuration processing (processProvider, processAuthoritativeProvider) now pass the resolved base provider into Aliases.Validate(...).
Replicate context-aware deployments endpoint
core/providers/replicate/replicate.go, core/providers/replicate/use_deployments_endpoint_test.go, core/providers/replicate/replicate_test.go
useDeploymentsEndpoint now accepts ctx and checks schemas.GetResolvedAlias(ctx) for ReplicateAliasCfg.UseDeploymentsEndpoint; if absent, it falls back to the key-level config. All callers updated (text/chat/responses/image/video endpoints and listing) and a test verifies alias override precedence.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 I hop through keys and alias trails,
I check the provider in my sails.
Replicate listens to context first,
Then key defaults when aliases are nursed.
A tiny hop — configs now prevail! 🥕

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 71.43% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately summarizes the two main changes: per-alias Replicate endpoint override and provider-scoped alias sub-config validation.
Description check ✅ Passed The PR description covers all required template sections with sufficient detail: summary, changes, type, affected areas, test steps, breaking changes note, and checklist. Some optional sections were omitted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 06-02-feat_add_replicate_alias_config_support

Comment @coderabbitai help to get the list of available commands and usage tips.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Pratham-Mishra04 commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@greptile-apps

greptile-apps Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5

Safe to merge on the Replicate and config-load paths; the GORM hook omission (noted in existing threads) remains an open gap in the database write path but does not affect the new alias-override feature itself.

The alias override logic and cross-provider sub-config validation are implemented correctly across the HTTP handler and config-file load paths. The only open concern — the removal of Validate from the GORM BeforeSave hook without replacement — was already identified and discussed in prior review threads. Bulk writes, admin scripts, or any path that bypasses the HTTP handlers can now persist structurally invalid aliases silently.

framework/configstore/tables/key.go — the BeforeSave hook no longer validates aliases at all after the signature change.

Important Files Changed

Filename Overview
core/providers/replicate/replicate.go All 12 call sites of useDeploymentsEndpoint updated to accept ctx; nil-ctx path is safe via GetResolvedAlias nil guard.
core/providers/replicate/use_deployments_endpoint_test.go New test file covers nil ctx fallback, alias-true-overrides-key-false, alias-false-overrides-key-true, and alias-present-but-no-cfg-falls-through cases.
core/schemas/account.go KeyAliases.Validate now takes ModelProvider; cross-provider sub-config checks are correct for Azure, Vertex, Bedrock, and Replicate.
core/schemas/account_test.go Existing tests updated for new Validate signature; new table-driven cases cover each provider's accept/reject paths cleanly.
framework/configstore/tables/key.go Alias validation removed from BeforeSave GORM hook without replacement, leaving the database write path unguarded (discussed in previous review threads).
transports/bifrost-http/handlers/provider_keys.go createProviderKey and updateProviderKey now pass resolved baseProvider to Validate, consistent with the custom-provider resolution pattern.
transports/bifrost-http/lib/config.go processProvider and processAuthoritativeProvider gain ValidateCustomProvider and baseProvider resolution; aliases now validated against the correct provider in config-file load path.

Reviews (11): Last reviewed commit: "feat: add replicate alias config support" | Re-trigger Greptile

Comment thread framework/configstore/tables/key.go Outdated
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from 78dfe46 to 49c18dc Compare June 3, 2026 21:47
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_vertex_alias_config_support branch from a2efd42 to 129a7ae Compare June 3, 2026 21:47
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_vertex_alias_config_support branch from 129a7ae to ccbe37d Compare June 4, 2026 20:49
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from 49c18dc to 787b2fe Compare June 4, 2026 20:49
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from 787b2fe to 8c8ed24 Compare June 5, 2026 09:48
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_vertex_alias_config_support branch 2 times, most recently from 0ef24e1 to ddf4e34 Compare June 7, 2026 07:25
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from 8c8ed24 to f70d020 Compare June 7, 2026 07:25

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/providers/replicate/use_deployments_endpoint_test.go`:
- Around line 13-73: Add a new assertion in
TestUseDeploymentsEndpoint_AliasOverride to cover the documented default when
the key has a nil ReplicateKeyConfig and no alias is present: create a
schemas.Key with ReplicateKeyConfig == nil and call useDeploymentsEndpoint(nil,
keyWithNilConfig) and assert it returns false; reference the existing test setup
(useDeploymentsEndpoint, schemas.Key, ReplicateKeyConfig, and
schemas.NewBifrostContext for pattern) and place this check alongside the other
nil-ctx assertions so the edge-case cannot regress silently.

In `@transports/bifrost-http/lib/config.go`:
- Around line 1243-1246: Validate and normalize
providerCfgInFile.CustomProviderConfig.BaseProviderType before assigning to
baseProvider and using it for alias enforcement: ensure the custom
BaseProviderType is non-empty and is allowed for the owning provider (provider)
at the config-processing site, otherwise reject/ignore it (keep baseProvider =
provider) and surface a validation error; update the assignment and the
alias-check code paths that reference baseProvider so they call this validation
helper (or inline the check) before using baseProvider for alias
validation/enforcement.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: ca7948a8-6468-46c8-b3a5-f35b9b641922

📥 Commits

Reviewing files that changed from the base of the PR and between 787b2fe and f70d020.

📒 Files selected for processing (8)
  • core/providers/replicate/replicate.go
  • core/providers/replicate/replicate_test.go
  • core/providers/replicate/use_deployments_endpoint_test.go
  • core/schemas/account.go
  • core/schemas/account_test.go
  • framework/configstore/tables/key.go
  • transports/bifrost-http/handlers/provider_keys.go
  • transports/bifrost-http/lib/config.go
💤 Files with no reviewable changes (1)
  • framework/configstore/tables/key.go

Comment thread core/providers/replicate/use_deployments_endpoint_test.go
Comment thread transports/bifrost-http/lib/config.go
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from f70d020 to 70920f8 Compare June 8, 2026 06:54
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_vertex_alias_config_support branch from ddf4e34 to 12cdd14 Compare June 8, 2026 06:55

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/schemas/account_test.go`:
- Around line 259-287: The test table in account_test.go contains three
duplicated entries for the KeyAliases validation cases; locate the repeated test
cases that use KeyAliases with ModelID and ModelName (the entries named
"whitespace model_id", "whitespace model_name", and "duplicate source
case-insensitive" that construct KeyAliases{"k": {ModelID: "v "}} /
KeyAliases{"k": {ModelID: "v", ModelName: Ptr(" canonical ")}} /
KeyAliases{"Key": {ModelID: "v"}, "key": {ModelID: "v"}}) and remove the second
occurrence of each duplicate so each case appears only once in the test table.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: b5a4d135-05b5-46ef-9bb1-115ec6892742

📥 Commits

Reviewing files that changed from the base of the PR and between f70d020 and 70920f8.

📒 Files selected for processing (6)
  • core/providers/replicate/replicate.go
  • core/providers/replicate/replicate_test.go
  • core/providers/replicate/use_deployments_endpoint_test.go
  • core/schemas/account.go
  • core/schemas/account_test.go
  • framework/configstore/tables/key.go
💤 Files with no reviewable changes (1)
  • framework/configstore/tables/key.go

@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_vertex_alias_config_support branch from 12cdd14 to f5d3f4c Compare June 8, 2026 07:18
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from 70920f8 to 3d3e263 Compare June 8, 2026 07:18

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/schemas/account_test.go`:
- Around line 259-272: The three table-driven test entries named "whitespace
model_id", "whitespace model_name", and "duplicate source case-insensitive" omit
the provider and therefore use the zero-value ModelProvider(""); update each
KeyAliases map value in those cases to include provider: OpenAI (or any valid
ModelProvider) so they match the other tests and avoid relying on validation
order (look for the KeyAliases{"k": {ModelID: ...}} and KeyAliases{"Key": {...},
"key": {...}} entries in account_test.go and add provider: OpenAI to those
inline struct literals).

In `@core/schemas/account.go`:
- Around line 205-226: VLLMAliasCfg is defined but never used; either remove it
or wire it into AliasConfig and validation—prefer wiring: embed *VLLMAliasCfg
inside AliasConfig alongside *AzureAliasCfg etc., then update
KeyAliases.Validate(providerKey) to handle providerKey == VLLM (add the branch
that validates the VLLM-specific fields on the alias, mirroring how
AzureAliasCfg/VertexAliasCfg/BedrockAliasCfg/ReplicateAliasCfg are validated) so
the type is reachable and validated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c9b8e884-940d-4d27-9cc2-2e0f39c41748

📥 Commits

Reviewing files that changed from the base of the PR and between 70920f8 and 3d3e263.

📒 Files selected for processing (8)
  • core/providers/replicate/replicate.go
  • core/providers/replicate/replicate_test.go
  • core/providers/replicate/use_deployments_endpoint_test.go
  • core/schemas/account.go
  • core/schemas/account_test.go
  • framework/configstore/tables/key.go
  • transports/bifrost-http/handlers/provider_keys.go
  • transports/bifrost-http/lib/config.go
💤 Files with no reviewable changes (1)
  • framework/configstore/tables/key.go

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

Caution

Inline review comments failed to post. This is likely due to GitHub's internal server error or limits when posting large numbers of comments. If you are seeing this consistently it is likely a permissions issue. Please check "Moderation" -> "Code review limits" under your organization settings.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@core/schemas/account_test.go`:
- Around line 259-272: The three table-driven test entries named "whitespace
model_id", "whitespace model_name", and "duplicate source case-insensitive" omit
the provider and therefore use the zero-value ModelProvider(""); update each
KeyAliases map value in those cases to include provider: OpenAI (or any valid
ModelProvider) so they match the other tests and avoid relying on validation
order (look for the KeyAliases{"k": {ModelID: ...}} and KeyAliases{"Key": {...},
"key": {...}} entries in account_test.go and add provider: OpenAI to those
inline struct literals).

In `@core/schemas/account.go`:
- Around line 205-226: VLLMAliasCfg is defined but never used; either remove it
or wire it into AliasConfig and validation—prefer wiring: embed *VLLMAliasCfg
inside AliasConfig alongside *AzureAliasCfg etc., then update
KeyAliases.Validate(providerKey) to handle providerKey == VLLM (add the branch
that validates the VLLM-specific fields on the alias, mirroring how
AzureAliasCfg/VertexAliasCfg/BedrockAliasCfg/ReplicateAliasCfg are validated) so
the type is reachable and validated.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: c9b8e884-940d-4d27-9cc2-2e0f39c41748

📥 Commits

Reviewing files that changed from the base of the PR and between 70920f8 and 3d3e263.

📒 Files selected for processing (8)
  • core/providers/replicate/replicate.go
  • core/providers/replicate/replicate_test.go
  • core/providers/replicate/use_deployments_endpoint_test.go
  • core/schemas/account.go
  • core/schemas/account_test.go
  • framework/configstore/tables/key.go
  • transports/bifrost-http/handlers/provider_keys.go
  • transports/bifrost-http/lib/config.go
💤 Files with no reviewable changes (1)
  • framework/configstore/tables/key.go
🛑 Comments failed to post (2)
core/schemas/account_test.go (1)

259-272: 🧹 Nitpick | 🔵 Trivial | 💤 Low value

Test cases missing provider field use zero-value ModelProvider.

The test cases at lines 259-272 ("whitespace model_id", "whitespace model_name", "duplicate source case-insensitive") don't set the provider field, so they use the zero-value ModelProvider(""). While these tests will still pass because the validation errors they check occur before the provider sub-config checks, it's inconsistent with other test cases and could mask issues if the validation order changes.

Consider adding provider: OpenAI (or any valid provider) for consistency:

♻️ Suggested consistency fix
 		{
-			name:    "whitespace model_id",
+			name:     "whitespace model_id",
+			provider: OpenAI,
 			ka:      KeyAliases{"k": {ModelID: "v "}},
 			wantErr: "model_id cannot have leading or trailing whitespace",
 		},
 		{
-			name:    "whitespace model_name",
+			name:     "whitespace model_name",
+			provider: OpenAI,
 			ka:      KeyAliases{"k": {ModelID: "v", ModelName: Ptr(" canonical ")}},
 			wantErr: "model_name cannot have leading or trailing whitespace",
 		},
 		{
-			name:    "duplicate source case-insensitive",
+			name:     "duplicate source case-insensitive",
+			provider: OpenAI,
 			ka:      KeyAliases{"Key": {ModelID: "v"}, "key": {ModelID: "v"}},
 			wantErr: "duplicate alias source",
 		},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/schemas/account_test.go` around lines 259 - 272, The three table-driven
test entries named "whitespace model_id", "whitespace model_name", and
"duplicate source case-insensitive" omit the provider and therefore use the
zero-value ModelProvider(""); update each KeyAliases map value in those cases to
include provider: OpenAI (or any valid ModelProvider) so they match the other
tests and avoid relying on validation order (look for the KeyAliases{"k":
{ModelID: ...}} and KeyAliases{"Key": {...}, "key": {...}} entries in
account_test.go and add provider: OpenAI to those inline struct literals).
core/schemas/account.go (1)

205-226: ⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if VLLMAliasCfg is used anywhere or if it's intended to be embedded in AliasConfig
rg -n "VLLMAliasCfg" --type go

Repository: maximhq/bifrost

Length of output: 218


🏁 Script executed:

#!/bin/bash
set -euo pipefail

file="core/schemas/account.go"

echo "== AliasConfig embedding =="
sed -n '180,260p' "$file" | cat -n

echo
echo "== Validate(providerKey) implementation =="
rg -n "func \\(.*\\) Validate\\(providerKey ModelProvider\\)" "$file"
# Print a focused window around the Validate method
# (use match line to derive range)
line=$(rg -n "func \\(.*\\) Validate\\(providerKey ModelProvider\\)" "$file" | head -n1 | cut -d: -f1)
start=$((line-40))
end=$((line+120))
sed -n "${start},${end}p" "$file" | cat -n

echo
echo "== Search for Validate checks referencing VLLM or VLLMAliasCfg =="
rg -n "VLLM|VLLMAliasCfg|vLLM" "$file"

Repository: maximhq/bifrost

Length of output: 13046


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n "ModelProvider.*VLLM|VLLM.*ModelProvider|type ModelProvider|const \\(.*VLLM" core/schemas/bifrost.go

Repository: maximhq/bifrost

Length of output: 127


🏁 Script executed:

#!/bin/bash
set -euo pipefail
file="core/schemas/account.go"

echo "== Search for VLLM references in account.go =="
rg -n "VLLM" "$file"

echo
echo "== Search for providerKey == VLLM usage =="
rg -n "providerKey[[:space:]]*!=|providerKey[[:space:]]*==|==[[:space:]]*VLLM|VLLM" "$file" | head -n 80

Repository: maximhq/bifrost

Length of output: 1492


Wire or remove unused VLLMAliasCfg
core/schemas/account.go defines VLLMAliasCfg, but AliasConfig only embeds *AzureAliasCfg, *VertexAliasCfg, *BedrockAliasCfg, and *ReplicateAliasCfg, and KeyAliases.Validate(providerKey) only validates those four—so VLLMAliasCfg is currently unreachable/unused. Either embed *VLLMAliasCfg into AliasConfig and add the providerKey == VLLM validation, or remove the unused type.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@core/schemas/account.go` around lines 205 - 226, VLLMAliasCfg is defined but
never used; either remove it or wire it into AliasConfig and validation—prefer
wiring: embed *VLLMAliasCfg inside AliasConfig alongside *AzureAliasCfg etc.,
then update KeyAliases.Validate(providerKey) to handle providerKey == VLLM (add
the branch that validates the VLLM-specific fields on the alias, mirroring how
AzureAliasCfg/VertexAliasCfg/BedrockAliasCfg/ReplicateAliasCfg are validated) so
the type is reachable and validated.

@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from 3d3e263 to 481d427 Compare June 8, 2026 11:55
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_vertex_alias_config_support branch from 0173bbf to 7c99fd8 Compare June 8, 2026 12:24
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from 481d427 to 95c1fa5 Compare June 8, 2026 12:24
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_vertex_alias_config_support branch from 7c99fd8 to 95dedc6 Compare June 8, 2026 12:28
@Pratham-Mishra04
Pratham-Mishra04 force-pushed the 06-02-feat_add_replicate_alias_config_support branch from 95c1fa5 to b81beba Compare June 8, 2026 12:28

akshaydeo commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Merge activity

  • Jun 9, 5:17 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 9, 5:26 AM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo
akshaydeo changed the base branch from 06-02-feat_add_vertex_alias_config_support to graphite-base/4018 June 9, 2026 05:25
@akshaydeo
akshaydeo changed the base branch from graphite-base/4018 to dev June 9, 2026 05:25
@akshaydeo
akshaydeo merged commit c38ec8f into dev Jun 9, 2026
10 of 11 checks passed
@akshaydeo
akshaydeo deleted the 06-02-feat_add_replicate_alias_config_support branch June 9, 2026 05:26
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