kalibr 1.2.4__py3-none-any.whl → 1.2.6__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.
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: kalibr
3
- Version: 1.2.4
4
- Summary: Unified LLM Observability & Multi-Model AI Integration Framework - Deploy to GPT, Claude, Gemini, Copilot with full telemetry.
3
+ Version: 1.2.6
4
+ Summary: Adaptive routing for AI agents. Learns which models work best and routes automatically.
5
5
  Author-email: Kalibr Team <support@kalibr.systems>
6
6
  License: Apache-2.0
7
7
  Project-URL: Homepage, https://github.com/kalibr-ai/kalibr-sdk-python
@@ -65,17 +65,18 @@ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
65
65
  Requires-Dist: black>=23.0.0; extra == "dev"
66
66
  Requires-Dist: ruff>=0.1.0; extra == "dev"
67
67
 
68
- # Kalibr SDK
68
+ # Kalibr
69
69
 
70
- **Intelligent routing for AI agents.** Kalibr picks the best model for each request, learns from outcomes, and shifts traffic to what works.
70
+ Adaptive routing for AI agents. Kalibr learns which models, tools, and configs work best for each task and routes automatically.
71
+
72
+ [![PyPI](https://img.shields.io/pypi/v/kalibr)](https://pypi.org/project/kalibr/)
73
+ [![Python](https://img.shields.io/pypi/pyversions/kalibr)](https://pypi.org/project/kalibr/)
74
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
71
75
 
72
76
  ## Installation
73
77
  ```bash
74
78
  pip install kalibr
75
79
  ```
76
- ```bash
77
- export KALIBR_API_KEY=kal_xxx # Get from dashboard.kalibr.dev
78
- ```
79
80
 
80
81
  ## Quick Start
81
82
  ```python
@@ -83,42 +84,28 @@ from kalibr import Router
83
84
 
84
85
  router = Router(
85
86
  goal="book_meeting",
86
- paths=["gpt-4o", "claude-3-sonnet", "gpt-4o-mini"],
87
+ paths=["gpt-4o", "claude-sonnet-4-20250514", "gpt-4o-mini"],
87
88
  success_when=lambda output: "confirmed" in output.lower()
88
89
  )
89
90
 
90
91
  response = router.completion(
91
92
  messages=[{"role": "user", "content": "Book a meeting with John tomorrow"}]
92
93
  )
93
-
94
- print(response.choices[0].message.content)
95
94
  ```
96
95
 
97
- That's it. Kalibr handles:
98
- - ✅ Picking the best model (Thompson Sampling)
99
- - ✅ Making the API call
100
- - ✅ Checking success
101
- - ✅ Learning for next time
102
- - ✅ Tracing everything
103
-
104
- ## How It Works
105
-
106
- 1. **Define a goal** - What is your agent trying to do?
107
- 2. **Register paths** - Which models/tools can achieve it?
108
- 3. **Report outcomes** - Did it work?
109
- 4. **Kalibr routes** - Traffic shifts to winners
96
+ Kalibr picks the best model, makes the call, checks success, and learns for next time.
110
97
 
111
98
  ## Paths
112
99
 
113
100
  A path is a model + optional tools + optional params:
114
101
  ```python
115
- # Simple: just models
116
- paths = ["gpt-4o", "claude-3-sonnet"]
102
+ # Just models
103
+ paths = ["gpt-4o", "claude-sonnet-4-20250514"]
117
104
 
118
105
  # With tools
119
106
  paths = [
120
107
  {"model": "gpt-4o", "tools": ["web_search"]},
121
- {"model": "claude-3-sonnet", "tools": ["web_search", "browser"]},
108
+ {"model": "claude-sonnet-4-20250514", "tools": ["web_search", "browser"]},
122
109
  ]
123
110
 
124
111
  # With params
@@ -128,106 +115,73 @@ paths = [
128
115
  ]
129
116
  ```
130
117
 
131
- ## Success Criteria
132
-
133
- ### Auto-detect from output
134
- ```python
135
- router = Router(
136
- goal="summarize",
137
- paths=["gpt-4o", "claude-3-sonnet"],
138
- success_when=lambda output: len(output) > 100
139
- )
140
- ```
141
-
142
- ### Manual reporting
118
+ ## Manual Outcome Reporting
143
119
  ```python
144
- router = Router(goal="book_meeting", paths=["gpt-4o", "claude-3-sonnet"])
145
-
120
+ router = Router(goal="book_meeting", paths=["gpt-4o", "claude-sonnet-4-20250514"])
146
121
  response = router.completion(messages=[...])
147
122
 
148
- # Your verification logic
149
123
  meeting_created = check_calendar_api()
150
-
151
124
  router.report(success=meeting_created)
152
125
  ```
153
126
 
154
- ## Framework Integration
155
-
156
- ### LangChain
127
+ ## LangChain Integration
128
+ ```bash
129
+ pip install kalibr[langchain]
130
+ ```
157
131
  ```python
158
132
  from kalibr import Router
159
133
 
160
- router = Router(goal="summarize", paths=["gpt-4o", "claude-3-sonnet"])
134
+ router = Router(goal="summarize", paths=["gpt-4o", "claude-sonnet-4-20250514"])
161
135
  llm = router.as_langchain()
162
136
 
163
137
  chain = prompt | llm | parser
164
- result = chain.invoke({"text": "..."})
165
138
  ```
166
139
 
167
- ### CrewAI
168
- ```python
169
- from kalibr import Router
140
+ ## Auto-Instrumentation
170
141
 
171
- router = Router(goal="research", paths=["gpt-4o", "claude-3-sonnet"])
142
+ Kalibr auto-instruments OpenAI, Anthropic, and Google SDKs when imported:
143
+ ```python
144
+ import kalibr # Must be first import
145
+ from openai import OpenAI
172
146
 
173
- agent = Agent(
174
- role="Researcher",
175
- llm=router.as_langchain(),
176
- ...
177
- )
147
+ client = OpenAI()
148
+ response = client.chat.completions.create(model="gpt-4o", messages=[...])
149
+ # Traced automatically
178
150
  ```
179
151
 
180
- ## Observability (Included)
152
+ Disable with `KALIBR_AUTO_INSTRUMENT=false`.
181
153
 
182
- Every call is automatically traced:
154
+ ## Other Integrations
155
+ ```bash
156
+ pip install kalibr[crewai] # CrewAI
157
+ pip install kalibr[openai-agents] # OpenAI Agents SDK
158
+ ```
183
159
 
184
- - Token counts and costs
185
- - Latency (p50, p95, p99)
186
- - Tool usage
187
- - Errors with stack traces
160
+ ## Configuration
188
161
 
189
- View in the [dashboard](https://dashboard.kalibr.dev) or use callback handlers directly:
190
- ```python
191
- from kalibr_langchain import KalibrCallbackHandler
162
+ | Variable | Description | Default |
163
+ |----------|-------------|---------|
164
+ | `KALIBR_API_KEY` | API key | Required |
165
+ | `KALIBR_TENANT_ID` | Tenant ID | `default` |
166
+ | `KALIBR_AUTO_INSTRUMENT` | Auto-instrument SDKs | `true` |
192
167
 
193
- handler = KalibrCallbackHandler()
194
- chain.invoke({"input": "..."}, config={"callbacks": [handler]})
168
+ ## Development
169
+ ```bash
170
+ git clone https://github.com/kalibr-ai/kalibr-sdk-python.git
171
+ cd kalibr-sdk-python
172
+ pip install -e ".[dev]"
173
+ pytest
195
174
  ```
196
175
 
197
- ## Pricing
176
+ ## Contributing
198
177
 
199
- | Tier | Routing Decisions | Price |
200
- |------|-------------------|-------|
201
- | Free | 1,000/month | $0 |
202
- | Pro | 50,000/month | $49/month |
203
- | Enterprise | Unlimited | Custom |
178
+ See [CONTRIBUTING.md](CONTRIBUTING.md).
204
179
 
205
- ## API Reference
206
-
207
- ### Router
208
- ```python
209
- Router(
210
- goal: str, # Required: name of the goal
211
- paths: List[str | dict], # Models/tools to route between
212
- success_when: Callable, # Optional: auto-evaluate success
213
- exploration_rate: float, # Optional: 0.0-1.0, default 0.1
214
- )
215
- ```
180
+ ## License
216
181
 
217
- ### Methods
218
- ```python
219
- router.completion(messages, **kwargs) # Make routed request
220
- router.report(success, reason=None) # Report outcome manually
221
- router.add_path(model, tools=None) # Add path dynamically
222
- router.as_langchain() # Get LangChain-compatible LLM
223
- ```
182
+ Apache-2.0
224
183
 
225
184
  ## Links
226
185
 
227
- - [Documentation](https://docs.kalibr.dev)
228
- - [Dashboard](https://dashboard.kalibr.dev)
229
- - [GitHub](https://github.com/kalibr-ai/kalibr-sdk-python)
230
-
231
- ## License
232
-
233
- MIT
186
+ - [Docs](https://kalibr.systems/docs)
187
+ - [Dashboard](https://dashboard.kalibr.systems)
@@ -43,9 +43,9 @@ kalibr_langchain/callback.py,sha256=SNM1aHOXdG55grHmGyTwbXOeM6hjZTub2REiZD2H-d8,
43
43
  kalibr_langchain/chat_model.py,sha256=Y4xsZGx9gZpDUF8NP-edJuYam4k0NBySdA6B5484MKk,3190
44
44
  kalibr_openai_agents/__init__.py,sha256=wL59LzGstptKigfQDrKKt_7hcMO1JGVQtVAsE0lz-Zw,1367
45
45
  kalibr_openai_agents/processor.py,sha256=F550sdRf3rpguP1yOlgAUQWDLPBy4hSACV3-zOyCpOU,18257
46
- kalibr-1.2.4.dist-info/LICENSE,sha256=5mwAnB38l3_PjmOQn6_L6cZnJvus143DUjMBPIH1yso,10768
47
- kalibr-1.2.4.dist-info/METADATA,sha256=aXtgLOmzI6z7R1Zb0pFYU2jy2V4PUcUJKVFm0nciSL8,7037
48
- kalibr-1.2.4.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
49
- kalibr-1.2.4.dist-info/entry_points.txt,sha256=Kojlc6WRX8V1qS9lOMdDPZpTUVHCtzGtHqXusErgmLY,47
50
- kalibr-1.2.4.dist-info/top_level.txt,sha256=dIfBOWUnnHGFDwgz5zfIx5_0bU3wOUgAbYr4JcFHZmo,59
51
- kalibr-1.2.4.dist-info/RECORD,,
46
+ kalibr-1.2.6.dist-info/LICENSE,sha256=5mwAnB38l3_PjmOQn6_L6cZnJvus143DUjMBPIH1yso,10768
47
+ kalibr-1.2.6.dist-info/METADATA,sha256=PCOvSw7-xPDTz4tRIGjbs4-5WG60Mnw-cVfUl-JY_q4,6074
48
+ kalibr-1.2.6.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
49
+ kalibr-1.2.6.dist-info/entry_points.txt,sha256=Kojlc6WRX8V1qS9lOMdDPZpTUVHCtzGtHqXusErgmLY,47
50
+ kalibr-1.2.6.dist-info/top_level.txt,sha256=dIfBOWUnnHGFDwgz5zfIx5_0bU3wOUgAbYr4JcFHZmo,59
51
+ kalibr-1.2.6.dist-info/RECORD,,
File without changes