Skip to content

Commit 2edc73b

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/docs/node-forge-1.3.3
2 parents bf107db + e358ee7 commit 2edc73b

54 files changed

Lines changed: 4884 additions & 221 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ PYTEST=poetry run pytest -v
3838
# `make test TEST_ARGS="-k some_filter"`
3939
TEST_ARGS=
4040

41-
CLOUD_FILTERS = -m "not run_only_for_edge_endpoint"
42-
EDGE_FILTERS = -m "not skip_for_edge_endpoint"
41+
CLOUD_FILTERS = -m "not run_only_for_edge_endpoint and not expensive"
42+
EDGE_FILTERS = -m "not skip_for_edge_endpoint and not expensive"
4343

4444
# Record information about the slowest 25 tests (but don't show anything slower than 0.1 seconds)
4545
PROFILING_ARGS = \

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", EDGE_ANSWERS_WITH_ESCALATION)
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.

docs/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

generated/.openapi-generator/FILES

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ docs/Label.md
4242
docs/LabelValue.md
4343
docs/LabelValueRequest.md
4444
docs/LabelsApi.md
45+
docs/MLPipeline.md
4546
docs/ModeEnum.md
4647
docs/MonthToDateAccountInfoApi.md
4748
docs/MultiClassModeConfiguration.md
@@ -51,10 +52,15 @@ docs/NoteRequest.md
5152
docs/NotesApi.md
5253
docs/PaginatedDetectorList.md
5354
docs/PaginatedImageQueryList.md
55+
docs/PaginatedMLPipelineList.md
56+
docs/PaginatedPrimingGroupList.md
5457
docs/PaginatedRuleList.md
5558
docs/PatchedDetectorRequest.md
5659
docs/PayloadTemplate.md
5760
docs/PayloadTemplateRequest.md
61+
docs/PrimingGroup.md
62+
docs/PrimingGroupCreationInputRequest.md
63+
docs/PrimingGroupsApi.md
5864
docs/ROI.md
5965
docs/ROIRequest.md
6066
docs/ResultTypeEnum.md
@@ -82,6 +88,7 @@ groundlight_openapi_client/api/image_queries_api.py
8288
groundlight_openapi_client/api/labels_api.py
8389
groundlight_openapi_client/api/month_to_date_account_info_api.py
8490
groundlight_openapi_client/api/notes_api.py
91+
groundlight_openapi_client/api/priming_groups_api.py
8592
groundlight_openapi_client/api/user_api.py
8693
groundlight_openapi_client/api_client.py
8794
groundlight_openapi_client/apis/__init__.py
@@ -123,17 +130,22 @@ groundlight_openapi_client/model/inline_response200_summary_class_counts.py
123130
groundlight_openapi_client/model/label.py
124131
groundlight_openapi_client/model/label_value.py
125132
groundlight_openapi_client/model/label_value_request.py
133+
groundlight_openapi_client/model/ml_pipeline.py
126134
groundlight_openapi_client/model/mode_enum.py
127135
groundlight_openapi_client/model/multi_class_mode_configuration.py
128136
groundlight_openapi_client/model/multi_classification_result.py
129137
groundlight_openapi_client/model/note.py
130138
groundlight_openapi_client/model/note_request.py
131139
groundlight_openapi_client/model/paginated_detector_list.py
132140
groundlight_openapi_client/model/paginated_image_query_list.py
141+
groundlight_openapi_client/model/paginated_ml_pipeline_list.py
142+
groundlight_openapi_client/model/paginated_priming_group_list.py
133143
groundlight_openapi_client/model/paginated_rule_list.py
134144
groundlight_openapi_client/model/patched_detector_request.py
135145
groundlight_openapi_client/model/payload_template.py
136146
groundlight_openapi_client/model/payload_template_request.py
147+
groundlight_openapi_client/model/priming_group.py
148+
groundlight_openapi_client/model/priming_group_creation_input_request.py
137149
groundlight_openapi_client/model/result_type_enum.py
138150
groundlight_openapi_client/model/roi.py
139151
groundlight_openapi_client/model/roi_request.py

generated/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ Class | Method | HTTP request | Description
128128
*DetectorsApi* | [**get_detector**](docs/DetectorsApi.md#get_detector) | **GET** /v1/detectors/{id} |
129129
*DetectorsApi* | [**get_detector_evaluation**](docs/DetectorsApi.md#get_detector_evaluation) | **GET** /v1/detectors/{id}/evaluation |
130130
*DetectorsApi* | [**get_detector_metrics**](docs/DetectorsApi.md#get_detector_metrics) | **GET** /v1/detectors/{detector_id}/metrics |
131+
*DetectorsApi* | [**list_detector_pipelines**](docs/DetectorsApi.md#list_detector_pipelines) | **GET** /v1/detectors/{detector_id}/pipelines |
131132
*DetectorsApi* | [**list_detectors**](docs/DetectorsApi.md#list_detectors) | **GET** /v1/detectors |
132133
*DetectorsApi* | [**update_detector**](docs/DetectorsApi.md#update_detector) | **PATCH** /v1/detectors/{id} |
133134
*EdgeApi* | [**edge_report_metrics_create**](docs/EdgeApi.md#edge_report_metrics_create) | **POST** /v1/edge/report-metrics |
@@ -140,6 +141,10 @@ Class | Method | HTTP request | Description
140141
*MonthToDateAccountInfoApi* | [**month_to_date_account_info**](docs/MonthToDateAccountInfoApi.md#month_to_date_account_info) | **GET** /v1/month-to-date-account-info |
141142
*NotesApi* | [**create_note**](docs/NotesApi.md#create_note) | **POST** /v1/notes |
142143
*NotesApi* | [**get_notes**](docs/NotesApi.md#get_notes) | **GET** /v1/notes |
144+
*PrimingGroupsApi* | [**create_priming_group**](docs/PrimingGroupsApi.md#create_priming_group) | **POST** /v1/priming-groups |
145+
*PrimingGroupsApi* | [**delete_priming_group**](docs/PrimingGroupsApi.md#delete_priming_group) | **DELETE** /v1/priming-groups/{id} |
146+
*PrimingGroupsApi* | [**get_priming_group**](docs/PrimingGroupsApi.md#get_priming_group) | **GET** /v1/priming-groups/{id} |
147+
*PrimingGroupsApi* | [**list_priming_groups**](docs/PrimingGroupsApi.md#list_priming_groups) | **GET** /v1/priming-groups |
143148
*UserApi* | [**who_am_i**](docs/UserApi.md#who_am_i) | **GET** /v1/me |
144149

145150

@@ -180,17 +185,22 @@ Class | Method | HTTP request | Description
180185
- [Label](docs/Label.md)
181186
- [LabelValue](docs/LabelValue.md)
182187
- [LabelValueRequest](docs/LabelValueRequest.md)
188+
- [MLPipeline](docs/MLPipeline.md)
183189
- [ModeEnum](docs/ModeEnum.md)
184190
- [MultiClassModeConfiguration](docs/MultiClassModeConfiguration.md)
185191
- [MultiClassificationResult](docs/MultiClassificationResult.md)
186192
- [Note](docs/Note.md)
187193
- [NoteRequest](docs/NoteRequest.md)
188194
- [PaginatedDetectorList](docs/PaginatedDetectorList.md)
189195
- [PaginatedImageQueryList](docs/PaginatedImageQueryList.md)
196+
- [PaginatedMLPipelineList](docs/PaginatedMLPipelineList.md)
197+
- [PaginatedPrimingGroupList](docs/PaginatedPrimingGroupList.md)
190198
- [PaginatedRuleList](docs/PaginatedRuleList.md)
191199
- [PatchedDetectorRequest](docs/PatchedDetectorRequest.md)
192200
- [PayloadTemplate](docs/PayloadTemplate.md)
193201
- [PayloadTemplateRequest](docs/PayloadTemplateRequest.md)
202+
- [PrimingGroup](docs/PrimingGroup.md)
203+
- [PrimingGroupCreationInputRequest](docs/PrimingGroupCreationInputRequest.md)
194204
- [ROI](docs/ROI.md)
195205
- [ROIRequest](docs/ROIRequest.md)
196206
- [ResultTypeEnum](docs/ResultTypeEnum.md)

generated/docs/DetectorCreationInputRequest.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ Name | Type | Description | Notes
1111
**confidence_threshold** | **float** | If the detector's prediction is below this confidence threshold, send the image query for human review. | [optional] if omitted the server will use the default value of 0.9
1212
**patience_time** | **float** | How long Groundlight will attempt to generate a confident prediction | [optional] if omitted the server will use the default value of 30.0
1313
**pipeline_config** | **str, none_type** | (Advanced usage) Configuration needed to instantiate a prediction pipeline. | [optional]
14+
**edge_pipeline_config** | **str, none_type** | (Advanced usage) Configuration for the edge inference pipeline. If not specified, the mode's default edge pipeline is used. | [optional]
1415
**metadata** | **str** | Base64-encoded metadata for the detector. This should be a JSON object with string keys. The size after encoding should not exceed 1362 bytes, corresponding to 1KiB before encoding. | [optional]
1516
**mode** | **bool, date, datetime, dict, float, int, list, str, none_type** | Mode in which this detector will work. * `BINARY` - BINARY * `COUNT` - COUNT * `MULTI_CLASS` - MULTI_CLASS * `TEXT` - TEXT * `BOUNDING_BOX` - BOUNDING_BOX | [optional]
1617
**mode_configuration** | **bool, date, datetime, dict, float, int, list, str, none_type** | | [optional]
18+
**priming_group_id** | **str, none_type** | ID of an existing PrimingGroup to associate with this detector (optional). | [optional]
1719
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
1820

1921
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

generated/docs/DetectorsApi.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Method | HTTP request | Description
99
[**get_detector**](DetectorsApi.md#get_detector) | **GET** /v1/detectors/{id} |
1010
[**get_detector_evaluation**](DetectorsApi.md#get_detector_evaluation) | **GET** /v1/detectors/{id}/evaluation |
1111
[**get_detector_metrics**](DetectorsApi.md#get_detector_metrics) | **GET** /v1/detectors/{detector_id}/metrics |
12+
[**list_detector_pipelines**](DetectorsApi.md#list_detector_pipelines) | **GET** /v1/detectors/{detector_id}/pipelines |
1213
[**list_detectors**](DetectorsApi.md#list_detectors) | **GET** /v1/detectors |
1314
[**update_detector**](DetectorsApi.md#update_detector) | **PATCH** /v1/detectors/{id} |
1415

@@ -59,9 +60,11 @@ with groundlight_openapi_client.ApiClient(configuration) as api_client:
5960
confidence_threshold=0.9,
6061
patience_time=30.0,
6162
pipeline_config="pipeline_config_example",
63+
edge_pipeline_config="edge_pipeline_config_example",
6264
metadata="metadata_example",
6365
mode=None,
6466
mode_configuration=None,
67+
priming_group_id="priming_group_id_example",
6568
) # DetectorCreationInputRequest |
6669

6770
# example passing only required values which don't have defaults set
@@ -399,6 +402,99 @@ Name | Type | Description | Notes
399402
- **Accept**: application/json
400403

401404

405+
### HTTP response details
406+
407+
| Status code | Description | Response headers |
408+
|-------------|-------------|------------------|
409+
**200** | | - |
410+
411+
[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
412+
413+
# **list_detector_pipelines**
414+
> PaginatedMLPipelineList list_detector_pipelines(detector_id)
415+
416+
417+
418+
List all MLPipelines for a detector.
419+
420+
### Example
421+
422+
* Api Key Authentication (ApiToken):
423+
424+
```python
425+
import time
426+
import groundlight_openapi_client
427+
from groundlight_openapi_client.api import detectors_api
428+
from groundlight_openapi_client.model.paginated_ml_pipeline_list import PaginatedMLPipelineList
429+
from pprint import pprint
430+
# Defining the host is optional and defaults to https://api.groundlight.ai/device-api
431+
# See configuration.py for a list of all supported configuration parameters.
432+
configuration = groundlight_openapi_client.Configuration(
433+
host = "https://api.groundlight.ai/device-api"
434+
)
435+
436+
# The client must configure the authentication and authorization parameters
437+
# in accordance with the API server security policy.
438+
# Examples for each auth method are provided below, use the example that
439+
# satisfies your auth use case.
440+
441+
# Configure API key authorization: ApiToken
442+
configuration.api_key['ApiToken'] = 'YOUR_API_KEY'
443+
444+
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
445+
# configuration.api_key_prefix['ApiToken'] = 'Bearer'
446+
447+
# Enter a context with an instance of the API client
448+
with groundlight_openapi_client.ApiClient(configuration) as api_client:
449+
# Create an instance of the API class
450+
api_instance = detectors_api.DetectorsApi(api_client)
451+
detector_id = "detector_id_example" # str |
452+
ordering = "ordering_example" # str | Which field to use when ordering the results. (optional)
453+
page = 1 # int | A page number within the paginated result set. (optional)
454+
page_size = 1 # int | Number of results to return per page. (optional)
455+
search = "search_example" # str | A search term. (optional)
456+
457+
# example passing only required values which don't have defaults set
458+
try:
459+
api_response = api_instance.list_detector_pipelines(detector_id)
460+
pprint(api_response)
461+
except groundlight_openapi_client.ApiException as e:
462+
print("Exception when calling DetectorsApi->list_detector_pipelines: %s\n" % e)
463+
464+
# example passing only required values which don't have defaults set
465+
# and optional values
466+
try:
467+
api_response = api_instance.list_detector_pipelines(detector_id, ordering=ordering, page=page, page_size=page_size, search=search)
468+
pprint(api_response)
469+
except groundlight_openapi_client.ApiException as e:
470+
print("Exception when calling DetectorsApi->list_detector_pipelines: %s\n" % e)
471+
```
472+
473+
474+
### Parameters
475+
476+
Name | Type | Description | Notes
477+
------------- | ------------- | ------------- | -------------
478+
**detector_id** | **str**| |
479+
**ordering** | **str**| Which field to use when ordering the results. | [optional]
480+
**page** | **int**| A page number within the paginated result set. | [optional]
481+
**page_size** | **int**| Number of results to return per page. | [optional]
482+
**search** | **str**| A search term. | [optional]
483+
484+
### Return type
485+
486+
[**PaginatedMLPipelineList**](PaginatedMLPipelineList.md)
487+
488+
### Authorization
489+
490+
[ApiToken](../README.md#ApiToken)
491+
492+
### HTTP request headers
493+
494+
- **Content-Type**: Not defined
495+
- **Accept**: application/json
496+
497+
402498
### HTTP response details
403499

404500
| Status code | Description | Response headers |

generated/docs/MLPipeline.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# MLPipeline
2+
3+
A single ML pipeline attached to a detector.
4+
5+
## Properties
6+
Name | Type | Description | Notes
7+
------------ | ------------- | ------------- | -------------
8+
**id** | **str** | | [readonly]
9+
**pipeline_config** | **str, none_type** | configuration needed to instantiate a prediction pipeline. | [readonly]
10+
**is_active_pipeline** | **bool** | If True, this is the pipeline is used for inference, active learning, etc. for its parent Predictor. | [readonly]
11+
**is_edge_pipeline** | **bool** | If True, this pipeline is enabled for edge inference. | [readonly]
12+
**is_unclear_pipeline** | **bool** | If True, this pipeline is used to train classifier for human unclear label prediction. | [readonly]
13+
**is_oodd_pipeline** | **bool** | If True, this pipeline is used for OODD. | [readonly]
14+
**is_enabled** | **bool** | If False, this pipeline will not be run for any use case. | [readonly]
15+
**created_at** | **datetime** | | [readonly]
16+
**trained_at** | **datetime, none_type** | | [readonly]
17+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
18+
19+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
20+
21+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PaginatedMLPipelineList
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**count** | **int** | |
8+
**results** | [**[MLPipeline]**](MLPipeline.md) | |
9+
**next** | **str, none_type** | | [optional]
10+
**previous** | **str, none_type** | | [optional]
11+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
12+
13+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+
15+
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# PaginatedPrimingGroupList
2+
3+
4+
## Properties
5+
Name | Type | Description | Notes
6+
------------ | ------------- | ------------- | -------------
7+
**count** | **int** | |
8+
**results** | [**[PrimingGroup]**](PrimingGroup.md) | |
9+
**next** | **str, none_type** | | [optional]
10+
**previous** | **str, none_type** | | [optional]
11+
**any string name** | **bool, date, datetime, dict, float, int, list, str, none_type** | any string name can be used but the value must be the correct type | [optional]
12+
13+
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
14+
15+

0 commit comments

Comments
 (0)