Skip to content

SDK Configures Edge#419

Open
timmarkhuff wants to merge 14 commits intomainfrom
tim/sdk-configures-edge
Open

SDK Configures Edge#419
timmarkhuff wants to merge 14 commits intomainfrom
tim/sdk-configures-edge

Conversation

@timmarkhuff
Copy link
Copy Markdown
Contributor

@timmarkhuff timmarkhuff commented Mar 20, 2026

Summary

Adds SDK methods for reading and modifying edge endpoint configuration at runtime, accessible via a namespaced gl.edge pattern. Depends on companion Edge PR.

gl = ExperimentalApi(endpoint="http://my-edge-endpoint:30101")

config = gl.edge.get_config()
gl.edge.set_config(new_config, timeout_sec=600)

New code

EdgeAPI class (groundlight/edge/api.py)

Provides three methods:

  • get_config() -- calls GET /edge-config, returns EdgeEndpointConfig
  • set_config(config, timeout_sec) -- calls PUT /edge-config, then polls GET /edge-detector-readiness until all desired detectors are ready (or timeout)
  • get_detector_readiness() -- calls GET /edge-detector-readiness, returns dict[str, bool]

All HTTP calls go through _request(), which raises EdgeNotAvailableError on 404 or connection failure with an informative message guiding the user to check their endpoint configuration.

EdgeNotAvailableError

New exception in groundlight.client. Raised when an edge-only method is called against a non-edge endpoint (cloud API, unreachable host). The error message includes a hint about the GROUNDLIGHT_ENDPOINT env var.

gl.edge access pattern

ExperimentalApi.__init__ creates an EdgeAPI instance as self.edge. Edge methods are only accessible through this namespace.

Version

Bumped to 0.26.0 (minor version bump for new public API surface).

Release order

The companion edge-endpoint PR must be deployed first. The gl.edge.* methods call endpoints (/edge-config, /edge-detector-readiness) that only exist after the edge PR is deployed. Releasing this SDK version first would cause those methods to raise EdgeNotAvailableError (404).

Authentication note

These methods do not add authentication headers beyond what the SDK already sends (the standard x-api-token). The edge endpoint does not currently enforce auth on the config or readiness endpoints. The SDK sends the token in case auth is added in the future, but it is not required today.

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