krypton-sdk 0.1.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.
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: krypton-sdk
3
+ Version: 0.1.0
4
+ Summary: A lightweight SDK to connect to a Krypton AI Gateway over the internet.
5
+ Home-page: https://github.com/saaj376/Krypton
6
+ Author: Saajan
7
+ Author-email: your.email@example.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.7
11
+ Requires-Dist: httpx>=0.28.0
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: classifier
15
+ Dynamic: home-page
16
+ Dynamic: requires-dist
17
+ Dynamic: requires-python
18
+ Dynamic: summary
@@ -0,0 +1,33 @@
1
+ # Krypton SDK
2
+
3
+ A super lightweight pip package allowing clients to connect to a remotely hosted Krypton Gateway over the internet.
4
+
5
+ **Zero VRAM required on the client side! You do not need to download the Llama model.**
6
+
7
+ All inference happens on the remote host's GPU.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ pip install krypton-sdk
13
+ ```
14
+
15
+ ## Usage
16
+
17
+ You must provide the public URL of the Krypton gateway (usually an ngrok or localtunnel link provided by the host).
18
+
19
+ ```python
20
+ from krypton_sdk import KryptonClient
21
+
22
+ # 1. Connect to the remote server over the internet
23
+ client = KryptonClient(base_url="https://YOUR-PUBLIC-URL.ngrok-free.app")
24
+
25
+ # 2. Generate text! The heavy lifting happens remotely.
26
+ response = client.generate(
27
+ prompt="Explain quantum computing in one sentence.",
28
+ model="llama3",
29
+ max_tokens=200
30
+ )
31
+
32
+ print(response)
33
+ ```
@@ -0,0 +1,31 @@
1
+ import httpx
2
+ from typing import Optional, Dict, Any
3
+
4
+ class KryptonClient:
5
+ def __init__(self, base_url: str):
6
+ if not base_url:
7
+ raise ValueError("You must provide a base_url pointing to the Krypton server.")
8
+ self.base_url = base_url.rstrip("/")
9
+
10
+ def generate(self, prompt: str, model: str = "llama3", max_tokens: int = 100, temperature: float = 0.7) -> str:
11
+ payload = {
12
+ "prompt": prompt,
13
+ "model": model,
14
+ "max_tokens": max_tokens,
15
+ "temperature": temperature
16
+ }
17
+
18
+ try:
19
+ response = httpx.post(
20
+ f"{self.base_url}/generate",
21
+ json=payload,
22
+ timeout=120.0
23
+ )
24
+ response.raise_for_status()
25
+
26
+ return response.json().get("response", "")
27
+
28
+ except httpx.HTTPStatusError as e:
29
+ raise Exception(f"Krypton Server returned an error: {e.response.status_code} - {e.response.text}")
30
+ except httpx.RequestError as e:
31
+ raise Exception(f"Failed to connect to Krypton Server at {self.base_url}. Is the server running? Error: {str(e)}")
@@ -0,0 +1,18 @@
1
+ Metadata-Version: 2.4
2
+ Name: krypton-sdk
3
+ Version: 0.1.0
4
+ Summary: A lightweight SDK to connect to a Krypton AI Gateway over the internet.
5
+ Home-page: https://github.com/saaj376/Krypton
6
+ Author: Saajan
7
+ Author-email: your.email@example.com
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: Operating System :: OS Independent
10
+ Requires-Python: >=3.7
11
+ Requires-Dist: httpx>=0.28.0
12
+ Dynamic: author
13
+ Dynamic: author-email
14
+ Dynamic: classifier
15
+ Dynamic: home-page
16
+ Dynamic: requires-dist
17
+ Dynamic: requires-python
18
+ Dynamic: summary
@@ -0,0 +1,8 @@
1
+ README.md
2
+ setup.py
3
+ krypton_sdk/__init__.py
4
+ krypton_sdk.egg-info/PKG-INFO
5
+ krypton_sdk.egg-info/SOURCES.txt
6
+ krypton_sdk.egg-info/dependency_links.txt
7
+ krypton_sdk.egg-info/requires.txt
8
+ krypton_sdk.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ httpx>=0.28.0
@@ -0,0 +1 @@
1
+ krypton_sdk
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,19 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="krypton-sdk", # Name of the package
5
+ version="0.1.0",
6
+ description="A lightweight SDK to connect to a Krypton AI Gateway over the internet.",
7
+ author="Saajan",
8
+ author_email="your.email@example.com",
9
+ url="https://github.com/saaj376/Krypton",
10
+ packages=find_packages(), # Automatically find 'krypton_sdk' folder
11
+ install_requires=[
12
+ "httpx>=0.28.0", # The only dependency needed to make HTTP requests
13
+ ],
14
+ classifiers=[
15
+ "Programming Language :: Python :: 3",
16
+ "Operating System :: OS Independent",
17
+ ],
18
+ python_requires=">=3.7",
19
+ )