kalibr 1.1.3a0__py3-none-any.whl → 1.2.1__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.
- kalibr/__init__.py +39 -3
- kalibr/cli/capsule_cmd.py +1 -1
- kalibr/cli/main.py +3 -3
- kalibr/cli/run.py +1 -1
- kalibr/context.py +42 -0
- kalibr/intelligence.py +650 -0
- kalibr-1.2.1.dist-info/METADATA +385 -0
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.1.dist-info}/RECORD +18 -17
- kalibr-1.2.1.dist-info/licenses/LICENSE +190 -0
- kalibr_crewai/__init__.py +1 -1
- kalibr_crewai/callbacks.py +122 -14
- kalibr_crewai/instrumentor.py +96 -14
- kalibr_langchain/__init__.py +1 -1
- kalibr_langchain/callback.py +26 -0
- kalibr_openai_agents/__init__.py +1 -1
- kalibr-1.1.3a0.dist-info/METADATA +0 -236
- kalibr-1.1.3a0.dist-info/licenses/LICENSE +0 -21
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.1.dist-info}/WHEEL +0 -0
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.1.dist-info}/entry_points.txt +0 -0
- {kalibr-1.1.3a0.dist-info → kalibr-1.2.1.dist-info}/top_level.txt +0 -0
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: kalibr
|
|
3
|
-
Version: 1.1.3a0
|
|
4
|
-
Summary: Unified LLM Observability & Multi-Model AI Integration Framework - Deploy to GPT, Claude, Gemini, Copilot with full telemetry.
|
|
5
|
-
Author-email: Kalibr Team <team@kalibr.dev>
|
|
6
|
-
License: MIT
|
|
7
|
-
Project-URL: Homepage, https://github.com/kalibr-ai/kalibr-sdk-python
|
|
8
|
-
Project-URL: Documentation, https://docs.kalibr.systems
|
|
9
|
-
Project-URL: Repository, https://github.com/kalibr-ai/kalibr-sdk-python
|
|
10
|
-
Project-URL: Issues, https://github.com/kalibr-ai/kalibr-sdk-python/issues
|
|
11
|
-
Keywords: ai,mcp,gpt,claude,gemini,copilot,openai,anthropic,google,microsoft,observability,telemetry,tracing,llm,schema-generation,api,multi-model,langchain,crewai
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
-
Classifier: Programming Language :: Python :: 3
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
-
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
23
|
-
Requires-Python: >=3.8
|
|
24
|
-
Description-Content-Type: text/markdown
|
|
25
|
-
License-File: LICENSE
|
|
26
|
-
Requires-Dist: httpx>=0.27.0
|
|
27
|
-
Requires-Dist: tiktoken>=0.8.0
|
|
28
|
-
Requires-Dist: fastapi>=0.110.1
|
|
29
|
-
Requires-Dist: uvicorn>=0.25.0
|
|
30
|
-
Requires-Dist: pydantic>=2.6.4
|
|
31
|
-
Requires-Dist: typer>=0.9.0
|
|
32
|
-
Requires-Dist: python-multipart>=0.0.9
|
|
33
|
-
Requires-Dist: rich>=10.0.0
|
|
34
|
-
Requires-Dist: requests>=2.31.0
|
|
35
|
-
Requires-Dist: opentelemetry-api>=1.20.0
|
|
36
|
-
Requires-Dist: opentelemetry-sdk>=1.20.0
|
|
37
|
-
Requires-Dist: opentelemetry-exporter-otlp>=1.20.0
|
|
38
|
-
Provides-Extra: langchain
|
|
39
|
-
Requires-Dist: langchain-core>=0.1.0; extra == "langchain"
|
|
40
|
-
Provides-Extra: langchain-openai
|
|
41
|
-
Requires-Dist: langchain-core>=0.1.0; extra == "langchain-openai"
|
|
42
|
-
Requires-Dist: langchain-openai>=0.1.0; extra == "langchain-openai"
|
|
43
|
-
Provides-Extra: langchain-anthropic
|
|
44
|
-
Requires-Dist: langchain-core>=0.1.0; extra == "langchain-anthropic"
|
|
45
|
-
Requires-Dist: langchain-anthropic>=0.1.0; extra == "langchain-anthropic"
|
|
46
|
-
Provides-Extra: langchain-google
|
|
47
|
-
Requires-Dist: langchain-core>=0.1.0; extra == "langchain-google"
|
|
48
|
-
Requires-Dist: langchain-google-genai>=0.0.10; extra == "langchain-google"
|
|
49
|
-
Provides-Extra: langchain-all
|
|
50
|
-
Requires-Dist: langchain-core>=0.1.0; extra == "langchain-all"
|
|
51
|
-
Requires-Dist: langchain-openai>=0.1.0; extra == "langchain-all"
|
|
52
|
-
Requires-Dist: langchain-anthropic>=0.1.0; extra == "langchain-all"
|
|
53
|
-
Requires-Dist: langchain-google-genai>=0.0.10; extra == "langchain-all"
|
|
54
|
-
Provides-Extra: crewai
|
|
55
|
-
Requires-Dist: crewai>=0.28.0; extra == "crewai"
|
|
56
|
-
Provides-Extra: openai-agents
|
|
57
|
-
Requires-Dist: openai-agents>=0.0.3; extra == "openai-agents"
|
|
58
|
-
Provides-Extra: integrations
|
|
59
|
-
Requires-Dist: langchain-core>=0.1.0; extra == "integrations"
|
|
60
|
-
Requires-Dist: crewai>=0.28.0; extra == "integrations"
|
|
61
|
-
Requires-Dist: openai-agents>=0.0.3; extra == "integrations"
|
|
62
|
-
Provides-Extra: dev
|
|
63
|
-
Requires-Dist: pytest>=7.4.0; extra == "dev"
|
|
64
|
-
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
65
|
-
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
66
|
-
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
67
|
-
Dynamic: license-file
|
|
68
|
-
|
|
69
|
-
# Kalibr Python SDK
|
|
70
|
-
|
|
71
|
-
Production-grade observability for LLM applications. Automatically instrument OpenAI, Anthropic, and Google AI SDKs with zero code changes.
|
|
72
|
-
|
|
73
|
-
## Features
|
|
74
|
-
|
|
75
|
-
- **Zero-code instrumentation** - Automatic tracing for OpenAI, Anthropic, and Google AI
|
|
76
|
-
- **Cost tracking** - Real-time cost calculation for all LLM calls
|
|
77
|
-
- **Token monitoring** - Track input/output tokens across providers
|
|
78
|
-
- **Parent-child traces** - Automatic trace relationship management
|
|
79
|
-
- **Multi-provider support** - Works with GPT-4, Claude, Gemini, and more
|
|
80
|
-
|
|
81
|
-
## Installation
|
|
82
|
-
|
|
83
|
-
```bash
|
|
84
|
-
pip install kalibr
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Quick Start
|
|
88
|
-
|
|
89
|
-
### Auto-instrumentation (Recommended)
|
|
90
|
-
|
|
91
|
-
Simply import `kalibr` at the start of your application - all LLM calls are automatically traced:
|
|
92
|
-
|
|
93
|
-
```python
|
|
94
|
-
import kalibr # Enable auto-instrumentation
|
|
95
|
-
import openai
|
|
96
|
-
|
|
97
|
-
# Set your Kalibr API key
|
|
98
|
-
import os
|
|
99
|
-
os.environ["KALIBR_API_KEY"] = "your-kalibr-api-key"
|
|
100
|
-
|
|
101
|
-
# All OpenAI calls are now automatically traced
|
|
102
|
-
client = openai.OpenAI()
|
|
103
|
-
response = client.chat.completions.create(
|
|
104
|
-
model="gpt-4o",
|
|
105
|
-
messages=[{"role": "user", "content": "Hello!"}]
|
|
106
|
-
)
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Manual Tracing with Decorator
|
|
110
|
-
|
|
111
|
-
For more control, use the `@trace` decorator:
|
|
112
|
-
|
|
113
|
-
```python
|
|
114
|
-
from kalibr import trace
|
|
115
|
-
import openai
|
|
116
|
-
|
|
117
|
-
@trace(operation="summarize", provider="openai", model="gpt-4o")
|
|
118
|
-
def summarize_text(text: str) -> str:
|
|
119
|
-
client = openai.OpenAI()
|
|
120
|
-
response = client.chat.completions.create(
|
|
121
|
-
model="gpt-4o",
|
|
122
|
-
messages=[
|
|
123
|
-
{"role": "system", "content": "Summarize the following text."},
|
|
124
|
-
{"role": "user", "content": text}
|
|
125
|
-
]
|
|
126
|
-
)
|
|
127
|
-
return response.choices[0].message.content
|
|
128
|
-
|
|
129
|
-
result = summarize_text("Your long text here...")
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
### Multi-Provider Example
|
|
133
|
-
|
|
134
|
-
```python
|
|
135
|
-
import kalibr
|
|
136
|
-
import openai
|
|
137
|
-
import anthropic
|
|
138
|
-
|
|
139
|
-
# OpenAI call - automatically traced
|
|
140
|
-
openai_client = openai.OpenAI()
|
|
141
|
-
gpt_response = openai_client.chat.completions.create(
|
|
142
|
-
model="gpt-4o",
|
|
143
|
-
messages=[{"role": "user", "content": "Explain quantum computing"}]
|
|
144
|
-
)
|
|
145
|
-
|
|
146
|
-
# Anthropic call - automatically traced
|
|
147
|
-
anthropic_client = anthropic.Anthropic()
|
|
148
|
-
claude_response = anthropic_client.messages.create(
|
|
149
|
-
model="claude-sonnet-4-20250514",
|
|
150
|
-
max_tokens=1024,
|
|
151
|
-
messages=[{"role": "user", "content": "Explain machine learning"}]
|
|
152
|
-
)
|
|
153
|
-
```
|
|
154
|
-
|
|
155
|
-
## Configuration
|
|
156
|
-
|
|
157
|
-
Configure the SDK using environment variables:
|
|
158
|
-
|
|
159
|
-
| Variable | Description | Default |
|
|
160
|
-
|----------|-------------|---------|
|
|
161
|
-
| `KALIBR_API_KEY` | API key for authentication | *Required* |
|
|
162
|
-
| `KALIBR_COLLECTOR_URL` | Collector endpoint URL | `http://localhost:8001/api/ingest` |
|
|
163
|
-
| `KALIBR_TENANT_ID` | Tenant identifier for multi-tenant setups | `default` |
|
|
164
|
-
| `KALIBR_WORKFLOW_ID` | Workflow identifier for grouping traces | `default` |
|
|
165
|
-
| `KALIBR_SERVICE_NAME` | Service name for OpenTelemetry spans | `kalibr-app` |
|
|
166
|
-
| `KALIBR_ENVIRONMENT` | Environment (prod, staging, dev) | `prod` |
|
|
167
|
-
| `KALIBR_AUTO_INSTRUMENT` | Enable/disable auto-instrumentation | `true` |
|
|
168
|
-
| `KALIBR_CONSOLE_EXPORT` | Enable console span export for debugging | `false` |
|
|
169
|
-
|
|
170
|
-
## CLI Tools
|
|
171
|
-
|
|
172
|
-
The SDK includes command-line tools for running and deploying applications:
|
|
173
|
-
|
|
174
|
-
```bash
|
|
175
|
-
# Run your app locally with tracing
|
|
176
|
-
kalibr serve myapp.py
|
|
177
|
-
|
|
178
|
-
# Run with managed runtime lifecycle
|
|
179
|
-
kalibr run myapp.py --port 8000
|
|
180
|
-
|
|
181
|
-
# Deploy to cloud platforms
|
|
182
|
-
kalibr deploy myapp.py --runtime fly.io
|
|
183
|
-
|
|
184
|
-
# Fetch trace data by ID
|
|
185
|
-
kalibr capsule <trace-id>
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
## Supported Providers
|
|
189
|
-
|
|
190
|
-
| Provider | Models | Auto-Instrumentation |
|
|
191
|
-
|----------|--------|---------------------|
|
|
192
|
-
| OpenAI | GPT-4, GPT-4o, GPT-3.5 | Yes |
|
|
193
|
-
| Anthropic | Claude 3 Opus, Sonnet, Haiku | Yes |
|
|
194
|
-
| Google | Gemini Pro, Gemini Flash | Yes |
|
|
195
|
-
|
|
196
|
-
## Examples
|
|
197
|
-
|
|
198
|
-
See the [`examples/`](./examples) directory for complete examples:
|
|
199
|
-
|
|
200
|
-
- `basic_example.py` - Simple tracing example
|
|
201
|
-
- `basic_agent.py` - Agent with auto-instrumentation
|
|
202
|
-
- `advanced_example.py` - Advanced tracing patterns
|
|
203
|
-
- `cross_vendor.py` - Multi-provider workflows
|
|
204
|
-
- `test_mas.py` - Multi-agent system demonstration
|
|
205
|
-
|
|
206
|
-
## Development
|
|
207
|
-
|
|
208
|
-
```bash
|
|
209
|
-
# Clone the repository
|
|
210
|
-
git clone https://github.com/kalibr-ai/kalibr-sdk-python.git
|
|
211
|
-
cd kalibr-sdk-python
|
|
212
|
-
|
|
213
|
-
# Install in development mode
|
|
214
|
-
pip install -e ".[dev]"
|
|
215
|
-
|
|
216
|
-
# Run tests
|
|
217
|
-
pytest
|
|
218
|
-
|
|
219
|
-
# Format code
|
|
220
|
-
black kalibr/
|
|
221
|
-
ruff check kalibr/
|
|
222
|
-
```
|
|
223
|
-
|
|
224
|
-
## Contributing
|
|
225
|
-
|
|
226
|
-
We welcome contributions! Please see [CONTRIBUTING.md](./CONTRIBUTING.md) for guidelines.
|
|
227
|
-
|
|
228
|
-
## License
|
|
229
|
-
|
|
230
|
-
MIT License - see [LICENSE](./LICENSE) for details.
|
|
231
|
-
|
|
232
|
-
## Links
|
|
233
|
-
|
|
234
|
-
- [Documentation](https://docs.kalibr.systems)
|
|
235
|
-
- [GitHub Issues](https://github.com/kalibr-ai/kalibr-sdk-python/issues)
|
|
236
|
-
- [PyPI Package](https://pypi.org/project/kalibr/)
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Kalibr
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|