Add ROBOFLOW_REGION env var for easy EU region selection in inference-cli#2701
Add ROBOFLOW_REGION env var for easy EU region selection in inference-cli#2701imbgar-roboflow wants to merge 1 commit into
Conversation
…-cli ROBOFLOW_REGION=eu points the CLI's Roboflow API defaults at https://api.roboflow.eu (the EU data-residency platform). Explicit API_BASE_URL / ROBOFLOW_API_HOST overrides still win, unknown region values warn and fall back to US, and with no region set behavior is unchanged. Mirrors the region switch shipping in roboflow-python (ROBOFLOW_REGION / roboflow auth login --region eu). INF-314
|
👋 Thanks for the pull request! Here is how automated Claude review works here, so you spend credits (and reviewer time) wisely. 🚦 This PR is marked Ready for review, so automated Claude review will run — and every pass spends real credits. Warning 💸 The Claude reviewer bills in credits, not vibesAutomated review spins up a real agent that reads real code and spends real credits on every pass. It is glad to help — but it is not a rubber duck, a linter you poke in a loop, or a substitute for reading the contributing guide. Treat it like an expensive senior reviewer whose time you booked, and show up prepared. Draft when unsure, Ready when you mean it:
However you get there, arrive prepared:
Reviews are not free. A draft costs nothing to review; a Ready PR is a promise that it is worth reviewing.
|
|
🤖 Claude review started at commit New commits are not auto-reviewed. Add the |
|
🤖 Claude review started at commit New commits are not auto-reviewed. Add the |
PawelPeczek-Roboflow
left a comment
There was a problem hiding this comment.
That's a bigger change - let's make it right so that we could easily select all regions / environments with staging / prod switches + propagate to all components the same way (sdk, inference models etc)
Description
One env var now points
inference-cliat the Roboflow EU data-residency platform:ROBOFLOW_REGION=eu inference ... # API calls go to https://api.roboflow.euPart of the EU region rollout across our CLI tools (Linear INF-314);
roboflow-pythonis getting the sameROBOFLOW_REGIONswitch plusroboflow auth login --region euin a sibling PR.Changes
inference_cli/lib/env.py—API_BASE_URLdefault honorsROBOFLOW_REGION(usdefault /eu, case-insensitive). Precedence: explicitAPI_BASE_URL>ROBOFLOW_REGION=eu> existingPROJECT-based default. Unknown values warn on stderr and fall back tous.inference_cli/lib/enterprise/inference_compiler/constants.py— same forROBOFLOW_API_HOST(explicit override > region >ROBOFLOW_ENVIRONMENTdefault).tests/inference_cli/unit_tests/lib/test_env.py— 7 unit tests: defaults unchanged with no region set, EU mapping, normalization, override precedence, unknown-region fallback.With
ROBOFLOW_REGIONunset, behavior is byte-identical to today.Testing
python -m pytest tests/inference_cli/unit_tests— 166 passed (7 new)api.roboflow.com;ROBOFLOW_REGION=eu→api.roboflow.eu(both constants);ROBOFLOW_REGION=eu API_BASE_URL=…→ explicit override winsapi.roboflow.euverified live