Add serverless usc1 hostnames to SDK hosted-API URL list#2437
Draft
ecarrara wants to merge 1 commit into
Draft
Conversation
InferenceHTTPClient picks API v0 (hosted platform protocol) only for URLs in ALL_ROBOFLOW_API_URLS; any other URL is treated as a self-hosted server (v1) and the client manages models via /model/registry + /model/add. The serverless deployments do not expose /model/add, so v1 clients fail with 403 when pointed at the new us-southcentral1 hostnames. Add serverless.usc1.roboflow.com/.one so the SDK uses v0 against them, matching the existing serverless hosts.
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.
What does this PR do?
Adds
https://serverless.usc1.roboflow.comandhttps://serverless.usc1.roboflow.onetoALL_ROBOFLOW_API_URLSininference_sdk/config.py.InferenceHTTPClientselects API v0 (hosted platform protocol) only for URLs in this list; any other URL is treated as a self-hosted server (v1), where the SDK manages models viaGET /model/registry+POST /model/add. The serverless deployments do not expose/model/add— the request falls into the legacy/{dataset_id}/{version_id}route, which interpretsmodel/addas a model ID and fails with a 403RoboflowAPIForbiddenError.Related Issue(s): —
Type of Change
Testing
Test details:
Verified
_determine_client_moderesolves the new hostnames to v0 and that unrelated URLs still resolve to v1. Reproduced the original failure against the new staging deployment (serverless.usc1.roboflow.one): v1 mode fails onPOST /model/addwith 403, while v0 mode (client.select_api_v0()) works end to end.Checklist
Additional Context
Until this ships in a release, the workaround for SDK users on the usc1 hostnames is
InferenceHTTPClient(...).select_api_v0().