kalibr 1.0.8__py3-none-any.whl → 1.0.10__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/__main__.py CHANGED
@@ -1,28 +1,47 @@
1
1
  import typer
2
+ import os
3
+ import sys
2
4
  import subprocess
3
5
 
4
- app = typer.Typer(help="Kalibr Connect - integrate your app with any AI model instantly.")
6
+ app = typer.Typer(help="Kalibr Connect CLI")
5
7
 
6
- @app.command("serve")
7
- def serve_app(file: str):
8
- """Run a Kalibr app locally."""
9
- typer.echo(f"🚀 Serving {file} locally...")
10
- subprocess.run(["uvicorn", f"{file.replace('.py','')}:app", "--reload"])
8
+ def banner():
9
+ print("\n🚀 Kalibr SDK (Demo Mode)")
10
+ print("⚠️ Running in local evaluation mode.")
11
+ print("💡 To enable production or hosted runtime, visit https://kalibr.systems\n")
11
12
 
12
- @app.command("deploy")
13
- def deploy_app(file: str):
14
- """Deploy your Kalibr app (placeholder for future)."""
15
- typer.echo(f"🚀 Deploying {file} (not yet implemented).")
13
+ @app.command(help="Run a Kalibr app locally.")
14
+ def serve(file: str):
15
+ """
16
+ Run a Kalibr app locally.
17
+ Example: kalibr-connect serve demo_app.py
18
+ """
19
+ banner()
20
+ print(f"🚀 Serving {file} locally...")
21
+ subprocess.run(["uvicorn", f"{file.replace('.py', '')}:app", "--reload"])
16
22
 
17
- @app.command("usage")
23
+ @app.command(help="Deploy a Kalibr app (stubbed demo).")
24
+ def deploy(file: str):
25
+ """
26
+ Stubbed deploy command for demo/testing.
27
+ """
28
+ banner()
29
+ print(f"⚙️ Deployment is only available for licensed users.")
30
+ print(f" Visit https://kalibr.systems for API access.\n")
31
+
32
+ @app.command(help="Show this usage guide.")
18
33
  def usage():
19
- """Show Kalibr Connect usage info."""
20
- typer.echo("\nKalibr Connect Commands:")
21
- typer.echo(" kalibr-connect serve <file> Run a Kalibr app locally.")
22
- typer.echo(" kalibr-connect deploy <file> Deploy your Kalibr app.")
23
- typer.echo(" kalibr-connect usage Show this usage guide.\n")
34
+ print("""
35
+ Kalibr Connect Commands:
36
+ kalibr-connect serve <file> Run a Kalibr app locally.
37
+ kalibr-connect deploy <file> Deploy your Kalibr app (stubbed demo).
38
+ kalibr-connect usage Show this usage guide.
39
+ """)
24
40
 
25
41
  def main():
42
+ api_key = os.getenv("KALIBR_API_KEY")
43
+ if not api_key:
44
+ print("⚠️ No API key detected. Running in local demo mode.")
26
45
  app()
27
46
 
28
47
  if __name__ == "__main__":
kalibr/kalibr_app.py CHANGED
@@ -1,24 +1,27 @@
1
1
  from fastapi import FastAPI
2
- from typing import Callable, Dict
2
+ from typing import Callable
3
3
 
4
4
  class KalibrApp:
5
- def __init__(self, title: str = "Kalibr App"):
6
- self.title = title
7
- self.app = FastAPI(title=title)
8
- self.actions: Dict[str, Callable] = {}
5
+ def __init__(self):
6
+ self.app = FastAPI(title="Kalibr SDK App")
7
+ self._routes = []
9
8
 
10
- def action(self, name: str, description: str):
11
- def decorator(func):
12
- self.actions[name] = func
13
-
14
- async def route(**kwargs):
15
- return func(**kwargs)
16
-
17
- self.app.post(f"/{name}")(route)
9
+ def register(self):
10
+ """
11
+ Decorator to register a Python function as a Kalibr tool endpoint.
12
+ Exposes the function automatically with JSON schema inference.
13
+ """
14
+ def decorator(func: Callable):
15
+ route_path = f"/{func.__name__}"
16
+ self.app.post(route_path)(func)
17
+ self._routes.append(func.__name__)
18
18
  return func
19
19
  return decorator
20
20
 
21
- def get_fastapi_app(self):
21
+ def get_app(self):
22
+ """Return the FastAPI instance."""
22
23
  return self.app
23
24
 
24
- app = None
25
+
26
+ # Default export for uvicorn (if someone runs `kalibr-connect serve demo_app.py`)
27
+ app = KalibrApp().get_app()
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.4
2
+ Name: kalibr
3
+ Version: 1.0.10
4
+ Summary: Kalibr SDK — Integrate your SaaS with every major AI model using a single SDK.
5
+ Home-page: https://github.com/devon/kalibr-sdk
6
+ Author: Devon
7
+ Author-email: hello@kalibr.systems
8
+ License: MIT
9
+ Requires-Python: >=3.9
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE.txt
12
+ Requires-Dist: fastapi>=0.95.0
13
+ Requires-Dist: uvicorn>=0.22.0
14
+ Requires-Dist: typer>=0.9.0
15
+ Requires-Dist: pydantic>=2.0
16
+ Dynamic: author-email
17
+ Dynamic: home-page
18
+ Dynamic: license-file
19
+ Dynamic: requires-python
20
+
21
+ # Kalibr SDK
22
+
23
+ **Multi-Model AI Integration Framework**
24
+
25
+ Write once. Deploy anywhere. Connect to any AI model.
26
+
27
+ Kalibr lets developers expose any Python function as a model-compatible API — instantly usable by GPT, Claude, Gemini, and beyond.
28
+
29
+ ---
30
+
31
+ ## 🚀 Quick Start
32
+
33
+ ### Install
34
+ ```bash
35
+ pip install kalibr
36
+ ```
37
+
38
+ ### Run the included demo
39
+ ```bash
40
+ kalibr-connect serve examples/demo_app.py
41
+ ```
42
+
43
+ Then open your browser to:
44
+ ```
45
+ http://127.0.0.1:8000/docs
46
+ ```
47
+ You’ll see automatically generated endpoints for your demo functions — all schema-normalized and model-ready.
48
+
49
+ ---
50
+
51
+ ## ⚙️ Core Features
52
+
53
+ ✅ **Multi-Model Support** — Works with GPT Actions, Claude MCP, Gemini, and Copilot
54
+ ✅ **Automatic Schema Generation** — Define once, serve everywhere
55
+ ✅ **Fast Local Development** — Instantly test endpoints with `kalibr-connect serve`
56
+ ✅ **Lightweight Runtime** — No dependencies beyond FastAPI + Uvicorn
57
+
58
+ 🚧 *Coming Soon:*
59
+ • Auth & JWT user sessions
60
+ • Analytics & observability
61
+ • One-click deployment (Fly.io, AWS Lambda)
62
+
63
+ ---
64
+
65
+ ## 🧠 How It Works
66
+
67
+ Decorate your Python functions with `@app.register()`:
68
+
69
+ ```python
70
+ from kalibr.kalibr_app import KalibrApp
71
+
72
+ app = KalibrApp()
73
+
74
+ @app.register()
75
+ def summarize(text: str) -> str:
76
+ """Summarize text input."""
77
+ return text[:100] + "..."
78
+
79
+ @app.register()
80
+ def sentiment(text: str) -> dict:
81
+ """Return a basic sentiment classification."""
82
+ return {"sentiment": "positive" if "love" in text.lower() else "neutral"}
83
+
84
+ kalibr_app = app.get_app()
85
+ ```
86
+
87
+ Then run:
88
+ ```bash
89
+ kalibr-connect serve demo_app.py
90
+ ```
91
+
92
+ Your endpoints appear instantly at:
93
+ ```
94
+ http://127.0.0.1:8000/docs
95
+ ```
96
+
97
+ ---
98
+
99
+ ## 📁 Project Structure
100
+
101
+ ```
102
+ kalibr/
103
+ ├── __init__.py
104
+ ├── __main__.py
105
+ ├── kalibr_app.py
106
+ ├── schema_generators.py
107
+ examples/
108
+ ├── demo_app.py
109
+ └── enhanced_kalibr_example.py
110
+ ```
111
+
112
+ ---
113
+
114
+ ## 📘 Documentation
115
+
116
+ See [KALIBR_SDK_COMPLETE.md](KALIBR_SDK_COMPLETE.md) for full developer documentation.
117
+
118
+ ---
119
+
120
+ **Kalibr — Transform how you build AI-integrated applications.**
@@ -0,0 +1,10 @@
1
+ kalibr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
+ kalibr/__main__.py,sha256=ficQHOHEWM9h65ewQWYwkigIqLZeddLSRd9Foxz3CQ4,1377
3
+ kalibr/kalibr_app.py,sha256=EgWz_c2k7-02_pH29vT_lgbk_FIVRNTb87gUU8EyiJU,797
4
+ kalibr/schema_generators.py,sha256=1CFc0mCI0KVM48gEeGKK91I42WYyPYfEk2Yx2uZh478,286
5
+ kalibr-1.0.10.dist-info/licenses/LICENSE.txt,sha256=1WLJDkrueNpHCROy9zANrK2Ar2weqZ_z88hw90UKDoc,451
6
+ kalibr-1.0.10.dist-info/METADATA,sha256=-QzmVQXsFFj6Q2kYyPzOe3xjhszx3bNAVa8wXZR0P_Y,2632
7
+ kalibr-1.0.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
+ kalibr-1.0.10.dist-info/entry_points.txt,sha256=T-DOrFEZb0fZxA9H8sSCh-2zKxdjnmpzIRmm5TY_f6s,56
9
+ kalibr-1.0.10.dist-info/top_level.txt,sha256=OkloC5_IfpE4-QwI30aLIYbFZk_-ChABWF7aBGddy28,7
10
+ kalibr-1.0.10.dist-info/RECORD,,
@@ -0,0 +1,11 @@
1
+ Kalibr Source-Available License
2
+
3
+ Copyright (c) 2025 Kalibr Systems.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software
6
+ for the purpose of internal evaluation, testing, or demonstration only.
7
+
8
+ Commercial, production, or revenue-generating use of this software requires a valid commercial
9
+ license from Kalibr Systems (https://kalibr.systems).
10
+
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
@@ -1,61 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: kalibr
3
- Version: 1.0.8
4
- Summary: Kalibr SDK — Integrate your SaaS with every major AI model using a single SDK.
5
- Home-page: https://github.com/devon/kalibr-sdk
6
- Author: Devon
7
- Author-email: hello@kalibr.systems
8
- License: MIT
9
- Requires-Python: >=3.9
10
- Description-Content-Type: text/markdown
11
- License-File: LICENSE.txt
12
- Requires-Dist: fastapi>=0.95.0
13
- Requires-Dist: uvicorn>=0.22.0
14
- Requires-Dist: typer>=0.9.0
15
- Requires-Dist: pydantic>=2.0
16
- Dynamic: author-email
17
- Dynamic: home-page
18
- Dynamic: license-file
19
- Dynamic: requires-python
20
-
21
- # Kalibr SDK
22
-
23
- **Multi-Model AI Integration Framework**
24
-
25
- Write once, deploy anywhere, connect to any AI model.
26
-
27
- ## Quick Start
28
-
29
- ```bash
30
- # Install
31
- pip install kalibr
32
-
33
- # Create app
34
- kalibr init --template enhanced --name "My API"
35
-
36
- # Test locally
37
- kalibr serve enhanced_app.py
38
-
39
- # Deploy to production
40
- kalibr deploy enhanced_app.py --platform fly --name my-api
41
- ```
42
-
43
- ## Features
44
-
45
- - ✅ **Multi-Model Support**: GPT Actions, Claude MCP, Gemini, Copilot
46
- - ✅ **Enhanced Framework**: File uploads, sessions, streaming, workflows
47
- - ✅ **Built-in Auth**: JWT, user management, protected routes
48
- - ✅ **Easy Deployment**: Fly.io, AWS Lambda with one command
49
- - ✅ **Analytics**: Automatic tracking, custom events, metrics
50
-
51
- ## Documentation
52
-
53
- See [KALIBR_SDK_COMPLETE.md](KALIBR_SDK_COMPLETE.md) for full documentation.
54
-
55
- ## Examples
56
-
57
- Check the [examples/](examples/) directory for sample applications.
58
-
59
- ---
60
-
61
- **Transform how you build AI-integrated applications! 🚀**
@@ -1,10 +0,0 @@
1
- kalibr/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- kalibr/__main__.py,sha256=LTpWdkBM63HIkAb0xv_so-mA4HkBQQm7ISSUJDpyUqU,919
3
- kalibr/kalibr_app.py,sha256=cunLck36eM__vP4ZYbzJZWi_Ee13GIpL04J6p1JWVkM,605
4
- kalibr/schema_generators.py,sha256=1CFc0mCI0KVM48gEeGKK91I42WYyPYfEk2Yx2uZh478,286
5
- kalibr-1.0.8.dist-info/licenses/LICENSE.txt,sha256=RytDpOd_NXKaI-4VBHW7P-OTQdh26-Cr1LEMdH9O4rc,1066
6
- kalibr-1.0.8.dist-info/METADATA,sha256=uxDyc7L0e72jLLkE8dDwltBSRqvP96Ci7Q83A5K955U,1505
7
- kalibr-1.0.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- kalibr-1.0.8.dist-info/entry_points.txt,sha256=T-DOrFEZb0fZxA9H8sSCh-2zKxdjnmpzIRmm5TY_f6s,56
9
- kalibr-1.0.8.dist-info/top_level.txt,sha256=OkloC5_IfpE4-QwI30aLIYbFZk_-ChABWF7aBGddy28,7
10
- kalibr-1.0.8.dist-info/RECORD,,
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2024 Kalibr SDK
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.