Skip to content

[FD-6917] feat(deploy-agent): point prefix-scoped keys at an env-configured endpoint - #899

Closed
williamloo-scale wants to merge 1 commit into
mainfrom
wloo/smig-ssk-base-url
Closed

williamloo-scale wants to merge 1 commit into
mainfrom
wloo/smig-ssk-base-url

Conversation

@williamloo-scale

@williamloo-scale williamloo-scale commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

What

deploy_agent now points an agent at a dedicated inference endpoint when the run's LiteLLM key is one the default proxy won't accept — recognised by an ssk prefix — and the step chose no endpoint of its own.

Why

Some gateways issue keys that authenticate only against their own endpoint, not the default LiteLLM proxy. A run launched with such a key passes the hub's key preflight (preflighted against that endpoint) but then the agent's model calls still default to the LiteLLM proxy and fail the key check. This closes that gap on the agent side.

How

In DeployAgentTaskStep._model_endpoint, the base URL resolves in priority order:

  1. per-run / step_params override (litellm_base_url)
  2. the step's own litellm_base_url field
  3. a LITELLM_BASE_URL baked into the step's env_vars
  4. else, for a prefix-scoped key, the endpoint the deployment configures via the SMIG_OPENAI_BASE_URL environment variable

Properties:

  • Per-agent — each deploy_agent step resolves its own endpoint, so one agent's explicit choice never overrides another's.
  • Explicit always wins — 1–3 take precedence over the key-scoped fallback.
  • No hard-coded endpoint — the URL comes only from the environment; unset means no fallback and the platform default proxy is used, exactly as before. Safe for open source.

Testing

tst/unit/task_step/test_deploy_agent_key_scoped_endpoint.py: the prefix+env fallback, each explicit choice winning (step field, baked env_vars), non-matching keys untouched, and unset-env → default proxy.

Companion (hub-side key preflight): scaleapi/scaleapi#178956.

🤖 Generated with Claude Code

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Adds an environment-configured endpoint fallback for run keys starting with ssk.

  • Agents with ssk keys use the configured model endpoint when needed.

Reviews (1) · Last reviewed commit: "feat(deploy-agent): point prefix-scoped ..." · Reviewed by Greptile

…point

Some gateways issue keys that only a dedicated inference endpoint accepts, not
the default LiteLLM proxy. When a run is authed with such a key (recognised by
an `ssk` prefix) and the deploy_agent step chose no endpoint of its own, point
the agent's LITELLM_BASE_URL at the endpoint the deployment configures via
SMIG_OPENAI_BASE_URL, so its model calls authenticate instead of failing the
key check on the default proxy.

- Per-agent: each deploy_agent step resolves its own endpoint in _model_endpoint,
  so one agent's choice never overrides another's.
- Explicit choices always win: a per-run / step_params override, the step's
  litellm_base_url field, or a LITELLM_BASE_URL baked into the step env_vars.
- The endpoint URL is supplied by the environment, never hard-coded; unset means
  no fallback (the platform default proxy is used, exactly as before).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@williamloo-scale
williamloo-scale requested a review from a team as a code owner November 23, 2026 23:41
@williamloo-scale

Copy link
Copy Markdown
Contributor Author

Closing — superseded by scaleapi#178956. To keep SMIG entirely out of the open-source framework (no ssk prefix, no SMIG_OPENAI_BASE_URL, no SMIG naming), the agent routing moved into the private worker (run_task._apply_common_context_fields), which sets the per-agent endpoint through a channel the unmodified framework already reads: user_overrides["step_params"][<step id>]["litellm_base_url"] → DeployAgentTaskStep._model_endpoint. No framework change needed.

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.

1 participant