arize 8.0.0a3__py3-none-any.whl → 8.0.0a5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
arize/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "8.0.
|
|
1
|
+
__version__ = "8.0.0a5"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: arize
|
|
3
|
-
Version: 8.0.
|
|
3
|
+
Version: 8.0.0a5
|
|
4
4
|
Summary: A helper library to interact with Arize AI APIs
|
|
5
5
|
Project-URL: Homepage, https://arize.com
|
|
6
6
|
Project-URL: Documentation, https://docs.arize.com/arize
|
|
@@ -65,7 +65,24 @@ Description-Content-Type: text/markdown
|
|
|
65
65
|
|
|
66
66
|
---
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
# Table of Contents <!-- omit in toc -->
|
|
69
|
+
|
|
70
|
+
- [Overview](#overview)
|
|
71
|
+
- [Key Features](#key-features)
|
|
72
|
+
- [Installation](#installation)
|
|
73
|
+
- [Usage](#usage)
|
|
74
|
+
- [Instrumentation](#instrumentation)
|
|
75
|
+
- [Operations on Spans](#operations-on-spans)
|
|
76
|
+
- [Logging spans](#logging-spans)
|
|
77
|
+
- [Update spans Evaluations, Annotations, and Metadata](#update-spans-evaluations-annotations-and-metadata)
|
|
78
|
+
- [Exporting spans](#exporting-spans)
|
|
79
|
+
- [Operations on ML Models](#operations-on-ml-models)
|
|
80
|
+
- [Stream log ML Data for a Classification use-case](#stream-log-ml-data-for-a-classification-use-case)
|
|
81
|
+
- [Log a batch of ML Data for a Classification use-case](#log-a-batch-of-ml-data-for-a-classification-use-case)
|
|
82
|
+
- [Exporting ML Data](#exporting-ml-data)
|
|
83
|
+
- [Community](#community)
|
|
84
|
+
|
|
85
|
+
# Overview
|
|
69
86
|
|
|
70
87
|
A helper package to interact with Arize AI APIs.
|
|
71
88
|
|
|
@@ -78,7 +95,7 @@ Arize has both Enterprise and OSS products to support this goal:
|
|
|
78
95
|
|
|
79
96
|
We log over 1 trillion inferences and spans, 10 million evaluation runs, and 2 million OSS downloads every month.
|
|
80
97
|
|
|
81
|
-
|
|
98
|
+
# Key Features
|
|
82
99
|
- [**_Tracing_**](https://docs.arize.com/arize/observe/tracing) - Trace your LLM application's runtime using OpenTelemetry-based instrumentation.
|
|
83
100
|
- [**_Evaluation_**](https://docs.arize.com/arize/evaluate/online-evals) - Leverage LLMs to benchmark your application's performance using response and retrieval evals.
|
|
84
101
|
- [**_Datasets_**](https://docs.arize.com/arize/develop/datasets) - Create versioned datasets of examples for experimentation, evaluation, and fine-tuning.
|
|
@@ -86,7 +103,7 @@ We log over 1 trillion inferences and spans, 10 million evaluation runs, and 2 m
|
|
|
86
103
|
- [**_Playground_**](https://docs.arize.com/arize/develop/prompt-playground)- Optimize prompts, compare models, adjust parameters, and replay traced LLM calls.
|
|
87
104
|
- [**_Prompt Management_**](https://docs.arize.com/arize/develop/prompt-hub)- Manage and test prompt changes systematically using version control, tagging, and experimentation.
|
|
88
105
|
|
|
89
|
-
|
|
106
|
+
# Installation
|
|
90
107
|
|
|
91
108
|
Install Arize (version 8 is currently under alpha release) via `pip` or `conda`:
|
|
92
109
|
|
|
@@ -99,9 +116,9 @@ where `x` denotes the specific alpha release. Install the `arize-otel` package f
|
|
|
99
116
|
pip install arize-otel
|
|
100
117
|
```
|
|
101
118
|
|
|
102
|
-
|
|
119
|
+
# Usage
|
|
103
120
|
|
|
104
|
-
|
|
121
|
+
## Instrumentation
|
|
105
122
|
|
|
106
123
|
See [arize-otel in PyPI](https://pypi.org/project/arize-otel/):
|
|
107
124
|
|
|
@@ -120,13 +137,14 @@ tracer_provider = register(
|
|
|
120
137
|
OpenAIInstrumentor().instrument(tracer_provider=tracer_provider)
|
|
121
138
|
```
|
|
122
139
|
|
|
123
|
-
|
|
124
|
-
### Logging Spans, Evaluations, and Annotations
|
|
140
|
+
## Operations on Spans
|
|
125
141
|
|
|
126
142
|
Use `arize.spans` to interact with spans: log spans into Arize, update the span's evaluations, annotations and metadata in bulk.
|
|
127
143
|
|
|
128
144
|
> **WARNING**: This is currently under an alpha release. Install with `pip install arize==8.0.0ax` where the `x` denotes the specific alpha version. Check the [pre-releases](https://pypi.org/project/arize/#history) page in PyPI.
|
|
129
145
|
|
|
146
|
+
### Logging spans
|
|
147
|
+
|
|
130
148
|
```python
|
|
131
149
|
from arize import ArizeClient
|
|
132
150
|
|
|
@@ -138,26 +156,173 @@ client.spans.log(
|
|
|
138
156
|
space_id=SPACE_ID,
|
|
139
157
|
project_name=PROJECT_NAME,
|
|
140
158
|
dataframe=spans_df,
|
|
141
|
-
evals_df=evals_df, # Optionally pass the evaluations together with the spans
|
|
159
|
+
# evals_df=evals_df, # Optionally pass the evaluations together with the spans
|
|
142
160
|
)
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
### Update spans Evaluations, Annotations, and Metadata
|
|
164
|
+
|
|
165
|
+
```python
|
|
166
|
+
from arize import ArizeClient
|
|
167
|
+
|
|
168
|
+
client = ArizeClient(api_key=API_KEY)
|
|
169
|
+
SPACE_ID = "<your-space-id>"
|
|
170
|
+
PROJECT_NAME = "<your-project-name>"
|
|
143
171
|
|
|
144
172
|
client.spans.update_evaluations(
|
|
173
|
+
space_id=SPACE_ID,
|
|
174
|
+
project_name=PROJECT_NAME,
|
|
145
175
|
dataframe=evals_df,
|
|
146
|
-
|
|
176
|
+
# force_http=... # Optionally pass force_http to update evaluations via HTTP instead of gRPC, defaults to False
|
|
147
177
|
)
|
|
148
178
|
|
|
149
179
|
client.spans.update_annotations(
|
|
180
|
+
space_id=SPACE_ID,
|
|
181
|
+
project_name=PROJECT_NAME,
|
|
150
182
|
dataframe=annotations_df,
|
|
151
|
-
project_name="your-llm-project",
|
|
152
183
|
)
|
|
153
184
|
|
|
154
185
|
client.spans.update_metadata(
|
|
155
|
-
|
|
156
|
-
project_name=
|
|
186
|
+
space_id=SPACE_ID,
|
|
187
|
+
project_name=PROJECT_NAME,
|
|
188
|
+
dataframe=metadata_df,
|
|
189
|
+
)
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
### Exporting spans
|
|
193
|
+
|
|
194
|
+
Use the `export_to_df` or `export_to_parquet` to export large amounts of spans from Arize.
|
|
195
|
+
|
|
196
|
+
```python
|
|
197
|
+
from arize import ArizeClient
|
|
198
|
+
from datetime import datetime
|
|
199
|
+
|
|
200
|
+
FMT = "%Y-%m-%d"
|
|
201
|
+
start_time = datetime.strptime("2024-01-01",FMT)
|
|
202
|
+
end_time = datetime.strptime("2026-01-01",FMT)
|
|
203
|
+
|
|
204
|
+
client = ArizeClient(api_key=API_KEY)
|
|
205
|
+
SPACE_ID = "<your-space-id>"
|
|
206
|
+
PROJECT_NAME = "<your-project-name>"
|
|
207
|
+
|
|
208
|
+
df = client.spans.export_to_df(
|
|
209
|
+
space_id=SPACE_ID,
|
|
210
|
+
project_name=PROJECT_NAME,
|
|
211
|
+
start_time=start_time,
|
|
212
|
+
end_time=end_time,
|
|
213
|
+
)
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
## Operations on ML Models
|
|
217
|
+
|
|
218
|
+
Use `arize.models` to interact with ML models: log ML data (traininv, validation, production) into Arize, either streaming or in batches.
|
|
219
|
+
|
|
220
|
+
> **WARNING**: This is currently under an alpha release. Install with `pip install arize==8.0.0ax` where the `x` denotes the specific alpha version. Check the [pre-releases](https://pypi.org/project/arize/#history) page in PyPI.
|
|
221
|
+
|
|
222
|
+
### Stream log ML Data for a Classification use-case
|
|
223
|
+
|
|
224
|
+
```python
|
|
225
|
+
from arize import ArizeClient
|
|
226
|
+
from arize.types import ModelTypes, Environments
|
|
227
|
+
|
|
228
|
+
client = ArizeClient(api_key=API_KEY)
|
|
229
|
+
SPACE_ID = "<your-space-id>"
|
|
230
|
+
MODEL_NAME = "<your-model-name>"
|
|
231
|
+
|
|
232
|
+
features=...
|
|
233
|
+
embedding_features=...
|
|
234
|
+
|
|
235
|
+
response = client.models.log_stream(
|
|
236
|
+
space_id=SPACE_ID,
|
|
237
|
+
model_name=MODEL_NAME,
|
|
238
|
+
model_type=ModelTypes.SCORE_CATEGORICAL,
|
|
239
|
+
environment=Environments.PRODUCTION,
|
|
240
|
+
prediction_label=("not fraud",0.3),
|
|
241
|
+
actual_label=("fraud",1.0),
|
|
242
|
+
features=features,
|
|
243
|
+
embedding_features=embedding_features,
|
|
244
|
+
)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Log a batch of ML Data for a Classification use-case
|
|
248
|
+
|
|
249
|
+
```python
|
|
250
|
+
from arize import ArizeClient
|
|
251
|
+
from arize.types import ModelTypes, Environments
|
|
252
|
+
|
|
253
|
+
client = ArizeClient(api_key=API_KEY)
|
|
254
|
+
SPACE_ID = "<your-space-id>"
|
|
255
|
+
MODEL_NAME = "<your-model-name>"
|
|
256
|
+
MODEL_VERSION = "1.0"
|
|
257
|
+
|
|
258
|
+
from arize.types import Schema, EmbeddingColumnNames, ObjectDetectionColumnNames, ModelTypes, Environments
|
|
259
|
+
|
|
260
|
+
tags = ["drift_type"]
|
|
261
|
+
embedding_feature_column_names = {
|
|
262
|
+
"image_embedding": EmbeddingColumnNames(
|
|
263
|
+
vector_column_name="image_vector", link_to_data_column_name="url"
|
|
264
|
+
)
|
|
265
|
+
}
|
|
266
|
+
object_detection_prediction_column_names = ObjectDetectionColumnNames(
|
|
267
|
+
bounding_boxes_coordinates_column_name="prediction_bboxes",
|
|
268
|
+
categories_column_name="prediction_categories",
|
|
269
|
+
scores_column_name="prediction_scores",
|
|
270
|
+
)
|
|
271
|
+
object_detection_actual_column_names = ObjectDetectionColumnNames(
|
|
272
|
+
bounding_boxes_coordinates_column_name="actual_bboxes",
|
|
273
|
+
categories_column_name="actual_categories",
|
|
274
|
+
)
|
|
275
|
+
|
|
276
|
+
# Define a Schema() object for Arize to pick up data from the correct columns for logging
|
|
277
|
+
schema = Schema(
|
|
278
|
+
prediction_id_column_name="prediction_id",
|
|
279
|
+
timestamp_column_name="prediction_ts",
|
|
280
|
+
tag_column_names=tags,
|
|
281
|
+
embedding_feature_column_names=embedding_feature_column_names,
|
|
282
|
+
object_detection_prediction_column_names=object_detection_prediction_column_names,
|
|
283
|
+
object_detection_actual_column_names=object_detection_actual_column_names,
|
|
284
|
+
)
|
|
285
|
+
|
|
286
|
+
# Logging Production DataFrame
|
|
287
|
+
response = client.models.log_batch(
|
|
288
|
+
space_id=SPACE_ID,
|
|
289
|
+
model_name=MODEL_NAME,
|
|
290
|
+
model_type=ModelTypes.OBJECT_DETECTION,
|
|
291
|
+
dataframe=prod_df,
|
|
292
|
+
schema=schema,
|
|
293
|
+
environment=Environments.PRODUCTION,
|
|
294
|
+
model_version = MODEL_VERSION, # Optionally pass a model version
|
|
295
|
+
)
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Exporting ML Data
|
|
299
|
+
|
|
300
|
+
Use the `export_to_df` or `export_to_parquet` to export large amounts of spans from Arize.
|
|
301
|
+
|
|
302
|
+
```python
|
|
303
|
+
from arize import ArizeClient
|
|
304
|
+
from datetime import datetime
|
|
305
|
+
|
|
306
|
+
FMT = "%Y-%m-%d"
|
|
307
|
+
start_time = datetime.strptime("2024-01-01",FMT)
|
|
308
|
+
end_time = datetime.strptime("2026-01-01",FMT)
|
|
309
|
+
|
|
310
|
+
client = ArizeClient(api_key=API_KEY)
|
|
311
|
+
SPACE_ID = "<your-space-id>"
|
|
312
|
+
MODEL_NAME = "<your-model-name>"
|
|
313
|
+
MODEL_VERSION = "1.0"
|
|
314
|
+
|
|
315
|
+
df = client.models.export_to_df(
|
|
316
|
+
space_id=SPACE_ID,
|
|
317
|
+
model_name=MODEL_NAME,
|
|
318
|
+
environment=Environments.TRAINING,
|
|
319
|
+
model_version=MODEL_VERSION,
|
|
320
|
+
start_time=start_time,
|
|
321
|
+
end_time=end_time,
|
|
157
322
|
)
|
|
158
323
|
```
|
|
159
324
|
|
|
160
|
-
|
|
325
|
+
# Community
|
|
161
326
|
|
|
162
327
|
Join our community to connect with thousands of AI builders.
|
|
163
328
|
|
|
@@ -4,7 +4,7 @@ arize/client.py,sha256=ntSYQSzM6MrvcYDxV-lFF-yoxoPjjCvBHKoN-2k1BGg,5688
|
|
|
4
4
|
arize/config.py,sha256=iynVEZhrOPdTNJTQ_KQmwKOPiwL0LfEP8AUIDYW86Xw,5801
|
|
5
5
|
arize/logging.py,sha256=2vwdta2-kR78GeBFGK2vpk51rQ2d06HoKzuARI9qFQk,7317
|
|
6
6
|
arize/types.py,sha256=z1yg5-brmTD4kVHDmmTVkYke53JpusXXeOOpdQw7rYg,69508
|
|
7
|
-
arize/version.py,sha256
|
|
7
|
+
arize/version.py,sha256=qxyqjOLj-plDoT3np3cRvJ4d0Xj2nOzy7psQNZw-WhY,24
|
|
8
8
|
arize/_exporter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
9
|
arize/_exporter/client.py,sha256=eAxJX1sUfdpLrtaQ0ynMTd5jI37JOp9fbl3NWp4WFEA,15216
|
|
10
10
|
arize/_exporter/validation.py,sha256=6ROu5p7uaolxQ93lO_Eiwv9NVw_uyi3E5T--C5Klo5Q,1021
|
|
@@ -107,7 +107,7 @@ arize/utils/arrow.py,sha256=J7uwMsVR9K85myWcnKHb_pUz2H8Timk56U9gV2t5XnA,5477
|
|
|
107
107
|
arize/utils/casting.py,sha256=KUrPUQN6qJEVe39nxbr0T-0GjAJLHjf4xWuzV71QezI,12468
|
|
108
108
|
arize/utils/dataframe.py,sha256=I0FloPgNiqlKga32tMOvTE70598QA8Hhrgf-6zjYMAM,1120
|
|
109
109
|
arize/utils/proto.py,sha256=9vLo53INYjdF78ffjm3E48jFwK6LbPD2FfKei7VaDy8,35477
|
|
110
|
-
arize-8.0.
|
|
111
|
-
arize-8.0.
|
|
112
|
-
arize-8.0.
|
|
113
|
-
arize-8.0.
|
|
110
|
+
arize-8.0.0a5.dist-info/METADATA,sha256=cGIq0eDVu97TMF8WSYyes9iGO4QoQtZkYIOKb3y-aF0,12340
|
|
111
|
+
arize-8.0.0a5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
112
|
+
arize-8.0.0a5.dist-info/licenses/LICENSE.md,sha256=8vLN8Gms62NCBorxIv9MUvuK7myueb6_-dhXHPmm4H0,1479
|
|
113
|
+
arize-8.0.0a5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|