Skip to content

feat(cli): add --image-uri flag for self-hosted deployments - #8482

Open
Randall Hidajat (l2and) wants to merge 6 commits into
mainfrom
randall/self-hosted-cli
Open

feat(cli): add --image-uri flag for self-hosted deployments#8482
Randall Hidajat (l2and) wants to merge 6 commits into
mainfrom
randall/self-hosted-cli

Conversation

@l2and

Copy link
Copy Markdown

Adds --image-uri <uri> to langgraph deploy so self-hosted LangSmith customers can build, push, and deploy in one command without needing to script the three steps manually.

When --image-uri is provided the CLI:

  • Builds the image tagged to the provided URI (same Docker build path as the local build flow)
  • Pushes using whatever Docker credentials are already in the environment (e.g. WIF, aws ecr get-login-password) — no auth handling in the CLI
  • PATCHes the deployment with source_revision_config.image_uri (no revision_source, which the self-hosted control plane rejects for external_docker deployments)

Also fixes two self-hosted-specific issues uncovered during testing:

  • LANGSMITH_ENDPOINT is now used as a fallback when LANGGRAPH_HOST_URL isn't set — the CLI strips the /api/v1 path and appends /api-host to reach the control plane
  • The httpx client now builds full URLs via string concatenation rather than relying on httpx base_url merging, which silently dropped the /api-host path prefix when paths started with /
  • The "Check status at" URL after a deploy now correctly points to the self-hosted LangSmith UI instead of smith.langchain.com

How did you verify your code works?
Tested end-to-end against a self-hosted LangSmith instance using ECR as the registry. langgraph deploy --image-uri <ecr-uri> successfully built, pushed, and triggered a deployment revision. Confirmed the existing SaaS flow (langgraph deploy without --image-uri) is unaffected — the new flag is opt-in and the LANGSMITH_ENDPOINT fallback only activates when LANGGRAPH_HOST_URL is unset and LANGSMITH_ENDPOINT is present.

@open-swe open-swe 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.

Open SWE Review found 4 potential issues.

Open in WebView Open SWE trace

Comment thread libs/cli/langgraph_cli/deploy.py
Comment thread libs/cli/langgraph_cli/deploy.py
Comment thread libs/cli/langgraph_cli/deploy.py
Comment thread libs/cli/langgraph_cli/deploy.py Outdated
@l2and Randall Hidajat (l2and) changed the title feat(langgraph-cli): add --image-uri flag for self-hosted deployments feat(cli): add --image-uri flag for self-hosted deployments Jul 31, 2026
- Skip known cloud LANGSMITH_ENDPOINT values so SaaS users' tracing
  env var doesn't hijack the deploy host URL
- Fix --image-uri help text to accurately describe build+push+deploy
  flow instead of claiming no build step
- Validate existing deployment source before PATCHing with
  --image-uri to give a clear error on incompatible deployments
- Move /api-host path strip before localhost check in
  _smith_dashboard_base_url so local self-hosted status URLs work
- Fix test_constructor_strips_trailing_slash to use base_url property
  instead of removed httpx base_url
- Apply ruff formatting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant