Skip to content

Commit 2e393e9

Browse files
committed
adding documentation
1 parent 80b3ac5 commit 2e393e9

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

docs/docs/guide/8-edge.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,46 @@ python your_app.py
3838
In the above example, the `edge-endpoint` is running on the same machine as the application, so the endpoint URL is `http://localhost:30101`. If the `edge-endpoint` is running on a different machine, you should replace `localhost` with the IP address or hostname of the machine running the `edge-endpoint`.
3939
:::
4040

41+
## Configuring the Edge Endpoint at Runtime
42+
43+
:::note
44+
Runtime edge configuration is currently in beta and available through the `ExperimentalApi`.
45+
:::
46+
47+
You can programmatically configure which detectors run on the edge and how they behave, without redeploying.
48+
49+
This allows applications to define the desired state of the Edge Endpoint, thereby eliminating the need to manually configure the Edge Endpoint separately.
50+
51+
```python notest
52+
from groundlight import ExperimentalApi
53+
from groundlight.edge import EdgeEndpointConfig
54+
from groundlight.edge.config import NO_CLOUD, EDGE_ANSWERS_WITH_ESCALATION
55+
56+
# Connect to an Edge Endpoint
57+
gl = ExperimentalApi(endpoint="http://localhost:30101")
58+
59+
# Build a configuration with detectors and inference presets
60+
config = EdgeEndpointConfig()
61+
config.add_detector("det_YOUR_DETECTOR_ID_HERE_01", NO_CLOUD)
62+
config.add_detector("det_YOUR_DETECTOR_ID_HERE_02", DEFAULT)
63+
64+
# Apply the configuration and wait for detectors to be ready
65+
print("Applying configuration...")
66+
config = gl.edge.set_config(config)
67+
print(f"Applied config with {len(config.detectors)} detector(s)")
68+
```
69+
70+
`set_config` replaces the current configuration and blocks until all detectors have inference pods ready to serve requests (or until the timeout expires).
71+
72+
You can also inspect the current configuration:
73+
74+
```python notest
75+
# Retrieve the active configuration
76+
config = gl.edge.get_config()
77+
for det in config.detectors:
78+
print(f" {det.detector_id} -> {det.edge_inference_config}")
79+
```
80+
4181
## Edge Endpoint performance
4282

4383
We have benchmarked the `edge-endpoint` handling 500 requests/sec at a latency of less than 50ms on an off-the-shelf [Katana 15 B13VGK-1007US](https://us.msi.com/Laptop/Katana-15-B13VX/Specification) laptop (Intel® Core™ i9-13900H CPU, NVIDIA® GeForce RTX™ 4070 Laptop GPU, 32GB DDR5 5200MHz RAM) running Ubuntu 20.04.

0 commit comments

Comments
 (0)