fiddler-client 3.9.2__tar.gz → 3.11.0__tar.gz

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.
Files changed (149) hide show
  1. fiddler_client-3.11.0/PKG-INFO +119 -0
  2. fiddler_client-3.11.0/PUBLIC.md +86 -0
  3. fiddler_client-3.11.0/fiddler/VERSION +1 -0
  4. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/__init__.py +2 -0
  5. fiddler_client-3.11.0/fiddler/connection.py +432 -0
  6. fiddler_client-3.11.0/fiddler/constants/alert_rule.py +209 -0
  7. fiddler_client-3.11.0/fiddler/constants/baseline.py +186 -0
  8. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/constants/common.py +1 -0
  9. fiddler_client-3.11.0/fiddler/constants/dataset.py +145 -0
  10. fiddler_client-3.11.0/fiddler/constants/events.py +22 -0
  11. fiddler_client-3.11.0/fiddler/constants/job.py +250 -0
  12. fiddler_client-3.11.0/fiddler/constants/model.py +1046 -0
  13. fiddler_client-3.11.0/fiddler/constants/model_deployment.py +30 -0
  14. fiddler_client-3.11.0/fiddler/constants/xai.py +314 -0
  15. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/decorators.py +2 -3
  16. fiddler_client-3.11.0/fiddler/entities/alert_record.py +277 -0
  17. fiddler_client-3.11.0/fiddler/entities/alert_rule.py +593 -0
  18. fiddler_client-3.11.0/fiddler/entities/baseline.py +454 -0
  19. fiddler_client-3.11.0/fiddler/entities/custom_expression.py +505 -0
  20. fiddler_client-3.11.0/fiddler/entities/dataset.py +455 -0
  21. fiddler_client-3.11.0/fiddler/entities/job.py +436 -0
  22. fiddler_client-3.11.0/fiddler/entities/model.py +1319 -0
  23. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/model_artifact.py +41 -4
  24. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/model_deployment.py +41 -3
  25. fiddler_client-3.11.0/fiddler/entities/project.py +590 -0
  26. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/surrogate.py +37 -4
  27. fiddler_client-3.11.0/fiddler/entities/webhook.py +299 -0
  28. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/xai.py +43 -2
  29. fiddler_client-3.11.0/fiddler/exceptions.py +377 -0
  30. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/alert_rule.py +1 -1
  31. fiddler_client-3.11.0/fiddler/schemas/custom_features.py +382 -0
  32. fiddler_client-3.11.0/fiddler/schemas/model_deployment.py +82 -0
  33. fiddler_client-3.11.0/fiddler/schemas/model_schema.py +143 -0
  34. fiddler_client-3.11.0/fiddler/schemas/model_spec.py +117 -0
  35. fiddler_client-3.11.0/fiddler/schemas/model_task_params.py +74 -0
  36. fiddler_client-3.11.0/fiddler/schemas/xai.py +136 -0
  37. fiddler_client-3.11.0/fiddler/schemas/xai_params.py +55 -0
  38. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_model.py +473 -0
  39. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/test_connection.py +44 -1
  40. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/test_utils.py +2 -2
  41. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/utils/column_generator.py +3 -1
  42. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/utils/helpers.py +14 -8
  43. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/utils/logger.py +24 -4
  44. fiddler_client-3.11.0/fiddler_client.egg-info/PKG-INFO +119 -0
  45. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/setup.py +6 -4
  46. fiddler-client-3.9.2/PKG-INFO +0 -39
  47. fiddler-client-3.9.2/PUBLIC.md +0 -22
  48. fiddler-client-3.9.2/fiddler/VERSION +0 -1
  49. fiddler-client-3.9.2/fiddler/connection.py +0 -263
  50. fiddler-client-3.9.2/fiddler/constants/alert_rule.py +0 -39
  51. fiddler-client-3.9.2/fiddler/constants/baseline.py +0 -15
  52. fiddler-client-3.9.2/fiddler/constants/dataset.py +0 -7
  53. fiddler-client-3.9.2/fiddler/constants/events.py +0 -7
  54. fiddler-client-3.9.2/fiddler/constants/job.py +0 -13
  55. fiddler-client-3.9.2/fiddler/constants/model.py +0 -73
  56. fiddler-client-3.9.2/fiddler/constants/model_deployment.py +0 -15
  57. fiddler-client-3.9.2/fiddler/constants/xai.py +0 -20
  58. fiddler-client-3.9.2/fiddler/entities/alert_record.py +0 -113
  59. fiddler-client-3.9.2/fiddler/entities/alert_rule.py +0 -351
  60. fiddler-client-3.9.2/fiddler/entities/baseline.py +0 -256
  61. fiddler-client-3.9.2/fiddler/entities/custom_expression.py +0 -232
  62. fiddler-client-3.9.2/fiddler/entities/dataset.py +0 -144
  63. fiddler-client-3.9.2/fiddler/entities/job.py +0 -203
  64. fiddler-client-3.9.2/fiddler/entities/model.py +0 -613
  65. fiddler-client-3.9.2/fiddler/entities/project.py +0 -174
  66. fiddler-client-3.9.2/fiddler/entities/webhook.py +0 -151
  67. fiddler-client-3.9.2/fiddler/exceptions.py +0 -102
  68. fiddler-client-3.9.2/fiddler/schemas/custom_features.py +0 -148
  69. fiddler-client-3.9.2/fiddler/schemas/model_deployment.py +0 -37
  70. fiddler-client-3.9.2/fiddler/schemas/model_schema.py +0 -69
  71. fiddler-client-3.9.2/fiddler/schemas/model_spec.py +0 -53
  72. fiddler-client-3.9.2/fiddler/schemas/model_task_params.py +0 -23
  73. fiddler-client-3.9.2/fiddler/schemas/xai.py +0 -26
  74. fiddler-client-3.9.2/fiddler/schemas/xai_params.py +0 -11
  75. fiddler-client-3.9.2/fiddler_client.egg-info/PKG-INFO +0 -39
  76. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/LICENSE.txt +0 -0
  77. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/MANIFEST.in +0 -0
  78. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/README.md +0 -0
  79. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/configs.py +0 -0
  80. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/constants/__init__.py +0 -0
  81. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/__init__.py +0 -0
  82. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/base.py +0 -0
  83. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/events.py +1 -1
  84. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/file.py +0 -0
  85. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/organization.py +0 -0
  86. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/entities/user.py +0 -0
  87. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/libs/__init__.py +0 -0
  88. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/libs/aws.py +1 -1
  89. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/libs/http_client.py +0 -0
  90. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/libs/json_encoder.py +0 -0
  91. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/libs/semver.py +0 -0
  92. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/packtools/__init__.py +0 -0
  93. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/packtools/gem.py +0 -0
  94. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/packtools/keras_ig_helpers.py +0 -0
  95. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/packtools/project_attributions_helpers.py +0 -0
  96. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/packtools/template_model.py +0 -0
  97. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/__init__.py +0 -0
  98. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/alert_record.py +0 -0
  99. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/base.py +0 -0
  100. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/baseline.py +0 -0
  101. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/custom_expression.py +0 -0
  102. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/dataset.py +0 -0
  103. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/events.py +0 -0
  104. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/file.py +0 -0
  105. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/filter_query.py +0 -0
  106. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/job.py +0 -0
  107. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/model.py +0 -0
  108. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/organization.py +0 -0
  109. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/project.py +0 -0
  110. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/response.py +0 -0
  111. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/server_info.py +0 -0
  112. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/user.py +0 -0
  113. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/schemas/webhook.py +0 -0
  114. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/__init__.py +0 -0
  115. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/__init__.py +0 -0
  116. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_alert_record.py +0 -0
  117. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_alert_rule.py +0 -0
  118. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_baseline.py +0 -0
  119. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_custom_metric.py +0 -0
  120. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_dataset.py +0 -0
  121. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_events.py +0 -0
  122. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_files.py +0 -0
  123. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_generate_model.py +0 -0
  124. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_job.py +0 -0
  125. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_mixin.py +0 -0
  126. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_model_artifact.py +0 -0
  127. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_model_deployment.py +0 -0
  128. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_model_surrogate.py +0 -0
  129. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_project.py +0 -0
  130. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_segment.py +0 -0
  131. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_webhook.py +0 -0
  132. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/apis/test_xai.py +0 -0
  133. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/conftest.py +0 -0
  134. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/constants.py +0 -0
  135. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/test_json_encoder.py +0 -0
  136. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/test_logger.py +0 -0
  137. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/test_sagemaker_auth.py +0 -0
  138. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/tests/utils.py +0 -0
  139. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/utils/__init__.py +0 -0
  140. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/utils/decorators.py +0 -0
  141. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/utils/model_generator.py +0 -0
  142. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/utils/validations.py +0 -0
  143. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/utils/version.py +0 -0
  144. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler/version.py +0 -0
  145. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler_client.egg-info/SOURCES.txt +0 -0
  146. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler_client.egg-info/dependency_links.txt +0 -0
  147. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler_client.egg-info/requires.txt +7 -7
  148. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/fiddler_client.egg-info/top_level.txt +0 -0
  149. {fiddler-client-3.9.2 → fiddler_client-3.11.0}/setup.cfg +0 -0
@@ -0,0 +1,119 @@
1
+ Metadata-Version: 2.4
2
+ Name: fiddler-client
3
+ Version: 3.11.0
4
+ Summary: Python client for Fiddler Platform
5
+ Home-page: https://fiddler.ai
6
+ Author: Fiddler Labs
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: License :: OSI Approved :: Apache Software License
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.10.0
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE.txt
13
+ Requires-Dist: pip>=21.0
14
+ Requires-Dist: requests<3
15
+ Requires-Dist: requests-toolbelt
16
+ Requires-Dist: pydantic>=1.10.17
17
+ Requires-Dist: deprecated==1.2.18
18
+ Requires-Dist: tqdm
19
+ Requires-Dist: simplejson>=3.17.0
20
+ Requires-Dist: pyyaml
21
+ Requires-Dist: typing-extensions<5,>=4.6.0
22
+ Requires-Dist: pandas>=1.2.5
23
+ Requires-Dist: pyarrow>=15.0.0
24
+ Dynamic: author
25
+ Dynamic: classifier
26
+ Dynamic: description
27
+ Dynamic: description-content-type
28
+ Dynamic: home-page
29
+ Dynamic: license-file
30
+ Dynamic: requires-dist
31
+ Dynamic: requires-python
32
+ Dynamic: summary
33
+
34
+ # fiddler-client
35
+
36
+ [![Python Version](https://img.shields.io/pypi/pyversions/fiddler-client.svg)](https://pypi.org/project/fiddler-client/)
37
+ [![PyPI Version](https://img.shields.io/pypi/v/fiddler-client.svg)](https://pypi.org/project/fiddler-client/)
38
+ [![License](https://img.shields.io/pypi/l/fiddler-client.svg)](https://pypi.org/project/fiddler-client/)
39
+
40
+ The official Python client for [Fiddler](https://www.fiddler.ai), the enterprise-grade AI Observability platform. Monitor, analyze, and protect your ML models, LLMs, GenAI applications, and AI Agents in production.
41
+
42
+ ## Platform Features
43
+
44
+ - 🚀 **Easy Integration** - Simple Python API for model and GenAI application onboarding
45
+ - 📊 **Real-time Monitoring** - Stream production events for drift detection, performance tracking, and anomaly detection
46
+ - 🎯 **Data Drift & Integrity** - Detect distribution changes, data quality issues, and schema violations
47
+ - 📈 **Custom Metrics** - Define and track business KPIs, custom performance metrics, and model-specific measurements
48
+ - 🔍 **Data Segments** - Analyze model behavior across cohorts with custom segments and slices
49
+ - 🤖 **GenAI & LLM Monitoring** - Track hallucinations, toxicity, PII leakage, prompt injection, and response quality
50
+ - 🛡️ **Guardrails** - Real-time protection against unsafe outputs and policy violations in LLM applications
51
+ - 📊 **Enrichments** - Add embeddings, sentiment, topics, and other ML-derived features to your data
52
+ - 🔄 **Model Comparison** - Compare performance across model versions, champion/challenger analysis
53
+ - 🎨 **Custom Dashboards** - Build tailored monitoring views with charts, alerts, and analytics
54
+ - 🔔 **Smart Alerts** - Multi-channel notifications (Slack, Email, PagerDuty) with customizable thresholds
55
+ - 🤝 **MLOps Integrations** - Native support for MLflow, SageMaker, Vertex AI, and other platforms
56
+
57
+ ## Installation
58
+
59
+ ```bash
60
+ pip install fiddler-client
61
+ ```
62
+
63
+ ## Requirements
64
+
65
+ - Python 3.9 or higher
66
+ - pip 19.0 or higher (latest release preferred)
67
+
68
+ ## Quick Start
69
+
70
+ ```python
71
+ import fiddler as fdl
72
+
73
+ # Initialize the client
74
+ fdl.init(
75
+ url='https://your-company.fiddler.ai',
76
+ token='your-api-token'
77
+ )
78
+
79
+ # List the existing projects
80
+ for project in fdl.Project.list():
81
+ print(project.name)
82
+ ```
83
+
84
+ ## Documentation
85
+
86
+ * 📚 [Complete Documentation](https://docs.fiddler.ai/)
87
+ * 🚀 [Getting Started with LLMs](https://docs.fiddler.ai/first-steps/getting-started-with-llm-monitoring)
88
+ * [LLM Quick Start Guide](https://docs.fiddler.ai/tutorials-and-quick-starts/llm-and-genai/simple-llm-monitoring)
89
+ * 🚀 [Getting Started with ML](https://docs.fiddler.ai/first-steps/getting-started-with-ml-model-observability)
90
+ * [ML Quick Start Guide](https://docs.fiddler.ai/tutorials-and-quick-starts/ml-observability/quick-start)
91
+ * 📖 [API Reference](https://docs.fiddler.ai/reference/about-the-fiddler-client)
92
+ * 💡 [Example Notebooks](https://github.com/fiddler-labs/fiddler-examples)
93
+
94
+ ## Example Notebooks
95
+
96
+ Check out our [GitHub repository](https://github.com/fiddler-labs/fiddler-examples) for Jupyter notebooks demonstrating:
97
+
98
+ - Model onboarding and monitoring setup
99
+ - Drift detection and root cause analysis
100
+ - Custom metrics and alerting
101
+ - LLM and GenAI monitoring
102
+ - Integration with popular ML frameworks
103
+
104
+ ## Version History
105
+
106
+ See our [release notes](https://docs.fiddler.ai/history/python-client-history) for detailed version history.
107
+
108
+ ## Support
109
+
110
+ - 📧 Email: [support@fiddler.ai](support@fiddler.ai)
111
+ - 💬 Community: [Join our Slack](https://www.fiddler.ai/slack)
112
+
113
+ ## License
114
+
115
+ This package is proprietary software. Please refer to your Fiddler license agreement for terms of use.
116
+
117
+ ---
118
+
119
+ **Want to see Fiddler in action?** [Request a demo](https://www.fiddler.ai/demo)
@@ -0,0 +1,86 @@
1
+ # fiddler-client
2
+
3
+ [![Python Version](https://img.shields.io/pypi/pyversions/fiddler-client.svg)](https://pypi.org/project/fiddler-client/)
4
+ [![PyPI Version](https://img.shields.io/pypi/v/fiddler-client.svg)](https://pypi.org/project/fiddler-client/)
5
+ [![License](https://img.shields.io/pypi/l/fiddler-client.svg)](https://pypi.org/project/fiddler-client/)
6
+
7
+ The official Python client for [Fiddler](https://www.fiddler.ai), the enterprise-grade AI Observability platform. Monitor, analyze, and protect your ML models, LLMs, GenAI applications, and AI Agents in production.
8
+
9
+ ## Platform Features
10
+
11
+ - 🚀 **Easy Integration** - Simple Python API for model and GenAI application onboarding
12
+ - 📊 **Real-time Monitoring** - Stream production events for drift detection, performance tracking, and anomaly detection
13
+ - 🎯 **Data Drift & Integrity** - Detect distribution changes, data quality issues, and schema violations
14
+ - 📈 **Custom Metrics** - Define and track business KPIs, custom performance metrics, and model-specific measurements
15
+ - 🔍 **Data Segments** - Analyze model behavior across cohorts with custom segments and slices
16
+ - 🤖 **GenAI & LLM Monitoring** - Track hallucinations, toxicity, PII leakage, prompt injection, and response quality
17
+ - 🛡️ **Guardrails** - Real-time protection against unsafe outputs and policy violations in LLM applications
18
+ - 📊 **Enrichments** - Add embeddings, sentiment, topics, and other ML-derived features to your data
19
+ - 🔄 **Model Comparison** - Compare performance across model versions, champion/challenger analysis
20
+ - 🎨 **Custom Dashboards** - Build tailored monitoring views with charts, alerts, and analytics
21
+ - 🔔 **Smart Alerts** - Multi-channel notifications (Slack, Email, PagerDuty) with customizable thresholds
22
+ - 🤝 **MLOps Integrations** - Native support for MLflow, SageMaker, Vertex AI, and other platforms
23
+
24
+ ## Installation
25
+
26
+ ```bash
27
+ pip install fiddler-client
28
+ ```
29
+
30
+ ## Requirements
31
+
32
+ - Python 3.9 or higher
33
+ - pip 19.0 or higher (latest release preferred)
34
+
35
+ ## Quick Start
36
+
37
+ ```python
38
+ import fiddler as fdl
39
+
40
+ # Initialize the client
41
+ fdl.init(
42
+ url='https://your-company.fiddler.ai',
43
+ token='your-api-token'
44
+ )
45
+
46
+ # List the existing projects
47
+ for project in fdl.Project.list():
48
+ print(project.name)
49
+ ```
50
+
51
+ ## Documentation
52
+
53
+ * 📚 [Complete Documentation](https://docs.fiddler.ai/)
54
+ * 🚀 [Getting Started with LLMs](https://docs.fiddler.ai/first-steps/getting-started-with-llm-monitoring)
55
+ * [LLM Quick Start Guide](https://docs.fiddler.ai/tutorials-and-quick-starts/llm-and-genai/simple-llm-monitoring)
56
+ * 🚀 [Getting Started with ML](https://docs.fiddler.ai/first-steps/getting-started-with-ml-model-observability)
57
+ * [ML Quick Start Guide](https://docs.fiddler.ai/tutorials-and-quick-starts/ml-observability/quick-start)
58
+ * 📖 [API Reference](https://docs.fiddler.ai/reference/about-the-fiddler-client)
59
+ * 💡 [Example Notebooks](https://github.com/fiddler-labs/fiddler-examples)
60
+
61
+ ## Example Notebooks
62
+
63
+ Check out our [GitHub repository](https://github.com/fiddler-labs/fiddler-examples) for Jupyter notebooks demonstrating:
64
+
65
+ - Model onboarding and monitoring setup
66
+ - Drift detection and root cause analysis
67
+ - Custom metrics and alerting
68
+ - LLM and GenAI monitoring
69
+ - Integration with popular ML frameworks
70
+
71
+ ## Version History
72
+
73
+ See our [release notes](https://docs.fiddler.ai/history/python-client-history) for detailed version history.
74
+
75
+ ## Support
76
+
77
+ - 📧 Email: [support@fiddler.ai](support@fiddler.ai)
78
+ - 💬 Community: [Join our Slack](https://www.fiddler.ai/slack)
79
+
80
+ ## License
81
+
82
+ This package is proprietary software. Please refer to your Fiddler license agreement for terms of use.
83
+
84
+ ---
85
+
86
+ **Want to see Fiddler in action?** [Request a demo](https://www.fiddler.ai/demo)
@@ -0,0 +1 @@
1
+ 3.11.0
@@ -60,6 +60,7 @@ from fiddler.schemas.xai import ( # noqa
60
60
  RowDataSource,
61
61
  )
62
62
  from fiddler.schemas.xai_params import XaiParams # noqa
63
+ from fiddler.utils.column_generator import create_columns_from_df # noqa
63
64
  from fiddler.utils.helpers import group_by # noqa
64
65
  from fiddler.utils.logger import set_logging # noqa
65
66
  from fiddler.version import __version__ # noqa
@@ -144,4 +145,5 @@ __all__ = [
144
145
  # Utilities
145
146
  'set_logging',
146
147
  'group_by',
148
+ 'create_columns_from_df',
147
149
  ]
@@ -0,0 +1,432 @@
1
+ from __future__ import annotations
2
+
3
+ import logging
4
+ import sys
5
+ from functools import cached_property
6
+ from uuid import UUID
7
+
8
+ import fiddler.utils.logger
9
+ from fiddler.configs import MIN_SERVER_VERSION
10
+ from fiddler.constants.common import (
11
+ CLIENT_NAME,
12
+ FIDDLER_CLIENT_NAME_HEADER,
13
+ FIDDLER_CLIENT_VERSION_HEADER,
14
+ FIDDLER_PYTHON_VERSION_HEADER,
15
+ )
16
+ from fiddler.decorators import handle_api_error
17
+ from fiddler.exceptions import IncompatibleClient
18
+ from fiddler.libs.http_client import RequestClient
19
+ from fiddler.schemas.server_info import ServerInfo, Version
20
+ from fiddler.utils.version import match_semver
21
+ from fiddler.version import __version__
22
+
23
+ log = logging.getLogger(__name__)
24
+
25
+
26
+ class Connection:
27
+ """Manages authenticated connections to the Fiddler platform.
28
+
29
+ The Connection class handles all aspects of connecting to and communicating
30
+ with the Fiddler platform, including authentication, HTTP client management,
31
+ server version compatibility checking, and organization context management.
32
+
33
+ This class provides the foundation for all API interactions with Fiddler,
34
+ managing connection parameters, authentication tokens, and ensuring proper
35
+ communication protocols are established.
36
+
37
+ Attributes:
38
+ url: Base URL of the Fiddler platform instance
39
+ token: Authentication token for API access
40
+ proxies: Optional proxy configuration for HTTP requests
41
+ timeout: HTTP request timeout settings
42
+ verify: Whether to verify SSL/TLS certificates
43
+ request_headers: HTTP headers including authentication and client info
44
+ client: Cached HTTP client instance for making requests
45
+ server_info: Cached server information and metadata
46
+ server_version: Version of the connected Fiddler server
47
+ organization_name: Name of the connected organization
48
+ organization_id: UUID of the connected organization
49
+
50
+ Examples:
51
+ Creating a basic connection:
52
+
53
+ connection = Connection(
54
+ url="https://your-fiddler-instance.com",
55
+ token="your-auth-token"
56
+ )
57
+
58
+ Creating a connection with custom timeout and proxy:
59
+
60
+ connection = Connection(
61
+ url="https://your-fiddler-instance.com",
62
+ token="your-auth-token",
63
+ timeout=(5.0, 30.0), # (connect_timeout, read_timeout)
64
+ proxies={"https": "https://proxy.company.com:8080"}
65
+ )
66
+
67
+ Creating a connection without SSL verification:
68
+
69
+ connection = Connection(
70
+ url="https://your-fiddler-instance.com",
71
+ token="your-auth-token",
72
+ verify=False, # Not recommended for production
73
+ validate=False # Skip version compatibility check
74
+ )
75
+ """
76
+
77
+ def __init__( # pylint: disable=too-many-arguments
78
+ self,
79
+ url: str,
80
+ token: str,
81
+ proxies: dict | None = None,
82
+ timeout: float | tuple[float, float] | None = None,
83
+ verify: bool = True,
84
+ validate: bool = True,
85
+ ) -> None:
86
+ """Initialize a connection to the Fiddler platform.
87
+
88
+ Args:
89
+ url: The base URL to your Fiddler platform instance
90
+ token: Authentication token obtained from the Fiddler UI
91
+ proxies: Dictionary mapping protocol to proxy URL for HTTP requests
92
+ timeout: HTTP request timeout settings (float or tuple of connect/read timeouts)
93
+ verify: Whether to verify server's TLS certificate (default: True)
94
+ validate: Whether to validate server/client version compatibility (default: True)
95
+
96
+ Raises:
97
+ ValueError: If url or token parameters are empty
98
+ IncompatibleClient: If server version is incompatible with client version
99
+ """
100
+
101
+ self.url = url
102
+ self.token = token
103
+ self.proxies = proxies
104
+ self.timeout = timeout
105
+ self.verify = verify
106
+
107
+ if not url:
108
+ raise ValueError('`url` is empty')
109
+
110
+ if not token:
111
+ raise ValueError('`token` is empty')
112
+
113
+ python_version = f'{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}'
114
+ self.request_headers = {
115
+ 'Authorization': f'Bearer {token}',
116
+ FIDDLER_CLIENT_NAME_HEADER: CLIENT_NAME,
117
+ FIDDLER_CLIENT_VERSION_HEADER: __version__,
118
+ FIDDLER_PYTHON_VERSION_HEADER: python_version,
119
+ }
120
+
121
+ if validate:
122
+ self._check_server_version()
123
+ self._check_version_compatibility()
124
+
125
+ @cached_property
126
+ def client(self) -> RequestClient:
127
+ """Get the HTTP request client instance for API communication.
128
+
129
+ Returns:
130
+ RequestClient: Configured HTTP client with authentication headers,
131
+ proxy settings, and timeout configurations.
132
+ """
133
+ return RequestClient(
134
+ base_url=self.url,
135
+ headers=self.request_headers,
136
+ proxies=self.proxies,
137
+ verify=self.verify,
138
+ timeout_override=self.timeout,
139
+ )
140
+
141
+ @cached_property
142
+ def server_info(self) -> ServerInfo:
143
+ """Get server information and metadata from the Fiddler platform.
144
+
145
+ Returns:
146
+ ServerInfo: Server information including version, organization details,
147
+ and platform configuration.
148
+ """
149
+ return self._get_server_info()
150
+
151
+ @cached_property
152
+ def server_version(self) -> Version:
153
+ """Get the semantic version of the connected Fiddler server.
154
+
155
+ Returns:
156
+ Version: Semantic version object representing the server version.
157
+ """
158
+ return self.server_info.server_version
159
+
160
+ @cached_property
161
+ def organization_name(self) -> str:
162
+ """Get the name of the connected organization.
163
+
164
+ Returns:
165
+ str: Name of the organization associated with this connection.
166
+ """
167
+ return self.server_info.organization.name
168
+
169
+ @cached_property
170
+ def organization_id(self) -> UUID:
171
+ """Get the UUID of the connected organization.
172
+
173
+ Returns:
174
+ UUID: Unique identifier of the organization associated with this connection.
175
+ """
176
+ return self.server_info.organization.id
177
+
178
+ @handle_api_error
179
+ def _get_server_info(self) -> ServerInfo:
180
+ """Retrieve server information from the Fiddler platform.
181
+
182
+ Returns:
183
+ ServerInfo: Server information including version and organization details.
184
+
185
+ Raises:
186
+ ApiError: If the server info request fails.
187
+ """
188
+
189
+ # Tight-ish timeout.
190
+ response = self.client.get(url='/v3/server-info', timeout=(5, 15))
191
+
192
+ return ServerInfo(**response.json().get('data'))
193
+
194
+ @handle_api_error
195
+ def _check_version_compatibility(self) -> None:
196
+ """Check whether the client version is compatible with the Fiddler platform version.
197
+
198
+ Raises:
199
+ ApiError: If the version compatibility check fails.
200
+ IncompatibleClient: If the client version is not compatible with the server.
201
+ """
202
+
203
+ self.client.get(
204
+ url='/v3/version-compatibility',
205
+ params={
206
+ 'client_version': __version__,
207
+ 'client_name': CLIENT_NAME,
208
+ },
209
+ timeout=(5, 15),
210
+ )
211
+
212
+ def _check_server_version(self) -> None:
213
+ """Check whether the Fiddler platform version is compatible with the client version.
214
+
215
+ Raises:
216
+ IncompatibleClient: If the server version is below the minimum required version.
217
+ """
218
+ if match_semver(self.server_version, f'>={MIN_SERVER_VERSION}'):
219
+ return
220
+
221
+ raise IncompatibleClient(server_version=str(self.server_version))
222
+
223
+
224
+ class ConnectionMixin:
225
+ """Mixin class providing connection-related functionality to other classes.
226
+
227
+ ConnectionMixin provides a standardized way for other classes to access
228
+ the global Fiddler connection instance and its associated properties.
229
+ This mixin enables classes throughout the Fiddler client to access
230
+ connection details, HTTP client functionality, and organization context
231
+ without directly managing connection state.
232
+
233
+ This pattern ensures consistent access to connection resources across
234
+ all client components while maintaining a clean separation of concerns.
235
+
236
+ Methods:
237
+ _conn: Access to the global Connection instance
238
+ _client: Access to the HTTP client for API requests
239
+ organization_name: Property access to organization name
240
+ organization_id: Property access to organization UUID
241
+ get_organization_name: Class method to retrieve organization name
242
+ get_organization_id: Class method to retrieve organization UUID
243
+
244
+ Examples:
245
+ Using ConnectionMixin in a custom class:
246
+
247
+ class CustomModel(ConnectionMixin):
248
+ def fetch_data(self):
249
+ # Access HTTP client through mixin
250
+ response = self._client().get('/api/data')
251
+ return response.json()
252
+
253
+ def get_org_info(self):
254
+ # Access organization info through mixin
255
+ return {
256
+ 'name': self.organization_name,
257
+ 'id': str(self.organization_id)
258
+ }
259
+
260
+ Using class methods without instantiation:
261
+
262
+ org_name = SomeEntityClass.get_organization_name()
263
+ org_id = SomeEntityClass.get_organization_id()
264
+ """
265
+
266
+ @classmethod
267
+ def _conn(cls) -> Connection:
268
+ """Get the global Fiddler connection instance.
269
+
270
+ Returns:
271
+ Connection: The singleton Connection instance used throughout the client.
272
+
273
+ Raises:
274
+ AssertionError: If no connection has been initialized via fiddler.init().
275
+ """
276
+ from fiddler import conn # pylint: disable=import-outside-toplevel
277
+
278
+ assert conn is not None
279
+ return conn
280
+
281
+ @classmethod
282
+ def _client(cls) -> RequestClient:
283
+ """Get the HTTP request client from the global connection.
284
+
285
+ Returns:
286
+ RequestClient: HTTP client instance for making API requests.
287
+ """
288
+ return cls._conn().client
289
+
290
+ @property
291
+ def organization_name(self) -> str:
292
+ """Get the organization name from the connection.
293
+
294
+ Returns:
295
+ str: Name of the organization associated with the current connection.
296
+ """
297
+ return self._conn().server_info.organization.name
298
+
299
+ @property
300
+ def organization_id(self) -> UUID:
301
+ """Get the organization UUID from the connection.
302
+
303
+ Returns:
304
+ UUID: Unique identifier of the organization associated with the current connection.
305
+ """
306
+ return self._conn().server_info.organization.id
307
+
308
+ @classmethod
309
+ def get_organization_name(cls) -> str:
310
+ """Get the organization name from the global connection.
311
+
312
+ Returns:
313
+ str: Name of the organization associated with the current connection.
314
+ """
315
+ return cls._conn().server_info.organization.name
316
+
317
+ @classmethod
318
+ def get_organization_id(cls) -> UUID:
319
+ """Get the organization UUID from the global connection.
320
+
321
+ Returns:
322
+ UUID: Unique identifier of the organization associated with the current connection.
323
+ """
324
+ return cls._conn().server_info.organization.id
325
+
326
+
327
+ def init( # pylint: disable=too-many-arguments
328
+ url: str,
329
+ token: str,
330
+ proxies: dict | None = None,
331
+ timeout: float | tuple[float, float] | None = None,
332
+ verify: bool = True,
333
+ validate: bool = True,
334
+ auto_attach_log_handler: bool = True,
335
+ ) -> None:
336
+ """Initialize the Fiddler client with connection parameters and global configuration.
337
+
338
+ This function establishes a connection to the Fiddler platform and configures
339
+ the global client state. It handles authentication, server compatibility
340
+ validation, logging setup, and creates the singleton connection instance
341
+ used throughout the client library.
342
+
343
+ The function also configures automatic retry strategies for HTTP requests,
344
+ sets up logging handlers if needed, and supports AWS SageMaker partner
345
+ application authentication.
346
+
347
+ Args:
348
+ url: The base URL to your Fiddler platform instance
349
+ token: Authentication token obtained from the Fiddler UI Credentials tab
350
+ proxies: Dictionary mapping protocol to proxy URL for HTTP requests
351
+ timeout: HTTP request timeout settings (float or tuple of connect/read timeouts)
352
+ verify: Whether to verify server's TLS certificate (default: True)
353
+ validate: Whether to validate server/client version compatibility (default: True)
354
+ auto_attach_log_handler: Whether to automatically attach log handler to stderr (default: True)
355
+
356
+ Raises:
357
+ ValueError: If url or token parameters are empty
358
+ IncompatibleClient: If server version is incompatible with client version
359
+ ConnectionError: If unable to connect to the Fiddler platform
360
+
361
+ Examples:
362
+ Basic initialization:
363
+
364
+ import fiddler as fdl
365
+
366
+ fdl.init(
367
+ url="https://your-fiddler-instance.com",
368
+ token="your-auth-token"
369
+ )
370
+
371
+ Initialization with custom timeout and proxy:
372
+
373
+ fdl.init(
374
+ url="https://your-fiddler-instance.com",
375
+ token="your-auth-token",
376
+ timeout=(10.0, 60.0), # 10s connect, 60s read timeout
377
+ proxies={"https": "https://proxy.company.com:8080"}
378
+ )
379
+
380
+ Initialization for development with relaxed settings:
381
+
382
+ fdl.init(
383
+ url="https://dev-fiddler-instance.com",
384
+ token="dev-token",
385
+ verify=False, # Skip SSL verification
386
+ validate=False, # Skip version compatibility check
387
+ auto_attach_log_handler=False # Custom logging setup
388
+ )
389
+
390
+ AWS SageMaker partner app initialization:
391
+
392
+ import os
393
+ os.environ["AWS_PARTNER_APP_AUTH"] = "true"
394
+ os.environ["AWS_PARTNER_APP_ARN"] = "your-partner-app-arn"
395
+ os.environ["AWS_PARTNER_APP_URL"] = "your-partner-app-url"
396
+
397
+ fdl.init(
398
+ url="https://your-fiddler-instance.com",
399
+ token="sagemaker-token"
400
+ )
401
+
402
+ Note:
403
+ The client implements automatic retry strategies for transient failures.
404
+ Configure retry duration via FIDDLER_CLIENT_RETRY_MAX_DURATION_SECONDS
405
+ environment variable (default: 300 seconds).
406
+
407
+ Logging is performed under the 'fiddler' namespace at INFO level.
408
+ If no root logger is configured, a stderr handler is automatically
409
+ attached unless auto_attach_log_handler=False.
410
+ """
411
+ from fiddler import _set_conn # pylint: disable=import-outside-toplevel
412
+
413
+ # If this library is imported into an interpreter that has a root logger
414
+ # configured (with handler(s) attached) then just propagate log messages
415
+ # into that hierarchy, and do not attach a handler to the 'fiddler' logger.
416
+ if not logging.getLogger().handlers and auto_attach_log_handler:
417
+ fiddler.utils.logger._attach_handler()
418
+ log.info(
419
+ 'attached stderr handler to logger: auto_attach_log_handler=True, and root logger not configured'
420
+ )
421
+
422
+ # Singleton object in Python interpreter.
423
+ conn = Connection(
424
+ url=url,
425
+ token=token,
426
+ proxies=proxies,
427
+ timeout=timeout,
428
+ verify=verify,
429
+ validate=validate,
430
+ )
431
+
432
+ _set_conn(conn_=conn)