Metadata-Version: 2.4
Name: darksyntrix-sdk
Version: 1.0.0
Summary: Official Python SDK for DarkSyntrix — A stealth AI gateway orchestrating 24 private model pipelines through a secure Same-Origin proxy architecture.
Author: VR
License-Expression: MIT
Project-URL: Homepage, https://gitlab.com/llm_model/darksyntrix-sdk
Project-URL: Repository, https://gitlab.com/llm_model/darksyntrix-sdk
Project-URL: Bug Tracker, https://gitlab.com/llm_model/darksyntrix-sdk/-/issues
Project-URL: Documentation, https://gitlab.com/llm_model/darksyntrix-sdk#readme
Keywords: darksyntrix,ai,gateway,sdk,llm,streaming,chat,openai,proxy,machine-learning,artificial-intelligence,api-client,httpx,sse,llama-cpp,qwen,deepseek
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: httpx>=0.25.0
Provides-Extra: dev
Requires-Dist: build>=1.0; extra == "dev"
Requires-Dist: twine>=4.0; extra == "dev"
Requires-Dist: wheel>=0.40; extra == "dev"
Dynamic: license-file

# DarkSyntrix Python SDK

[![PyPI Version](https://img.shields.io/pypi/v/darksyntrix-sdk.svg)](https://pypi.org/project/darksyntrix-sdk/)
[![Python Versions](https://img.shields.io/pypi/pyversions/darksyntrix-sdk.svg)](https://pypi.org/project/darksyntrix-sdk/)
[![License](https://img.shields.io/pypi/l/darksyntrix-sdk.svg)](https://github.com/llm_model/darksyntrix-sdk/blob/main/LICENSE)
[![GitLab](https://img.shields.io/badge/GitLab-repo-orange)](https://gitlab.com/llm_model/darksyntrix-sdk)

> Official Python SDK for the **DarkSyntrix** AI Gateway — a stealth Same-Origin proxy architecture orchestrating **24 private model pipelines** (LLM + media) behind a unified OpenAI-compatible API.

## Installation

```bash
pip install darksyntrix-sdk
```

Or install directly from the repository:

```bash
pip install git+https://gitlab.com/llm_model/darksyntrix-sdk.git
```

## Quick Start

### Synchronous Client

```python
from darksyntrix_sdk import DarkSyntrixClient

client = DarkSyntrixClient(
    base_url="https://your-gateway.app",
    api_key="vr_live_..."
)

# Non-streaming chat
response = client.chat.create(
    model="pulse_conversational_1.5b",
    messages=[{"role": "user", "content": "Hello!"}],
    stream=False
)
print(response.choices[0].message.content)

# Streaming chat
stream = client.chat.create(
    model="pulse_conversational_1.5b",
    messages=[{"role": "user", "content": "Tell me a story"}],
    stream=True
)
for chunk in stream:
    for choice in chunk.choices:
        print(choice.delta.content, end="", flush=True)

client.close()
```

### Async Client

```python
import asyncio
from darksyntrix_sdk import AsyncDarkSyntrixClient

async def main():
    async with AsyncDarkSyntrixClient(
        base_url="https://your-gateway.app",
        api_key="vr_live_..."
    ) as client:
        stream = await client.chat.create(
            model="hyperion_r1_reasoning_7b",
            messages=[{"role": "user", "content": "Solve this step by step: 2+2*2"}],
            stream=True
        )
        async for chunk in stream:
            for choice in chunk.choices:
                print(choice.delta.content, end="", flush=True)

asyncio.run(main())
```

### Authentication & Key Management

```python
from darksyntrix_sdk import DarkSyntrixClient

client = DarkSyntrixClient(base_url="https://your-gateway.app")

# Register a new account
result = client.auth.register("my_user", "secure_pass123")
# Login to get a session token
client.auth.login("my_user", "secure_pass123")

# Create a new API key
new_key = client.keys.create("my_user", "My API key")
print(f"Key: {new_key}")

# List existing keys
for key in client.keys.list("my_user"):
    print(f"{key.id}: {key.description} (active: {key.is_active})")
```

### Media Processing

```python
client = DarkSyntrixClient(
    base_url="https://your-gateway.app",
    api_key="vr_live_..."
)

# Upload a video for processing
url = client.media.upload("path/to/video.mp4", "video.mp4", "video/mp4")

# Process with RIFE frame interpolation
result = client.media.process(
    model="frame_interpolation_rife",
    cloudinary_url=url,
    parameters={"interpolation_factor": 4}
)
print(result)
```

## API Namespaces

| Namespace       | Description                                          |
| --------------- | ---------------------------------------------------- |
| `client.auth`   | Register & login to obtain API keys / session tokens |
| `client.keys`   | List, create, and revoke API keys                    |
| `client.chat`   | Blocking & streaming chat completions (OpenAI-style) |
| `client.media`  | Upload files & trigger GPU media processing          |
| `client.telemetry` | Real-time host metrics & database statistics      |

## Features

- **Zero bloat** — Only depends on `httpx`. Uses native Python dataclasses instead of Pydantic.
- **Sync + Async** — Full mirror API with `DarkSyntrixClient` (sync) and `AsyncDarkSyntrixClient` (async).
- **SSE Streaming** — First-class Server-Sent Events parser for real-time token streaming.
- **Connection Pooling** — Built-in `httpx` connection pool with 120s timeout resilience for cold-start containers.
- **Full IDE Autocomplete** — Typed dataclass response models for `ChatCompletionResponse`, `ChatCompletionChunk`, `KeyInfo`, `TelemetryStats`.
- **Context Manager Support** — Use `with` / `async with` for automatic connection cleanup.

## Supported Models (24 Engines)

### Conversational / General Assistant
- `pulse_conversational_1.5b` — DarkSyntrix Pulse Conversational 1.5B
- `aurora_core_gemma_1b` — DarkSyntrix AuroraCore Gemma 1B
- `apex_conversational_llama_3b` — DarkSyntrix Apex Conversational LLaMA 3B
- `infinity_phi_instruct_4` — DarkSyntrix Infinity Phi Instruct 4
- `sentinel_pulse_qwen_0.5b` — DarkSyntrix SentinelPulse Qwen 0.5B
- `nebula_core_llama_1b` — DarkSyntrix NebulaCore LLaMA 1B
- `genesis_smollm_1.7b` — DarkSyntrix Genesis SmolLM 1.7B
- `nexus_quantum_instruct_mini` — DarkSyntrix Nexus Quantum Instruct Mini

### Reasoning / Chain-of-Thought
- `hyperion_r1_reasoning_7b` — DarkSyntrix Hyperion R1 Reasoning 7B
- `synapse_r1_reasoning_1.5b` — DarkSyntrix Synapse R1 Reasoning 1.5B

### Code Generation
- `cyber_forge_coder_1.5b` — DarkSyntrix CyberForge Coder 1.5B
- `matrix_core_coder_3b` — DarkSyntrix MatrixCore Coder 3B
- `titan_apex_coder_7b` — DarkSyntrix TitanApex Coder 7B
- `nova_starcoder_3b` — DarkSyntrix Nova StarCoder 3B
- `vector_gemma_coder_2b` — DarkSyntrix VectorGemma Coder 2B
- `synapse_coder_deepseek_1.3b` — DarkSyntrix SynapseCoder DeepSeek 1.3B
- `granite_matrix_coder_3b` — DarkSyntrix GraniteMatrix Coder 3B
- `micro_pulse_coder_0.5b` — DarkSyntrix MicroPulse Coder 0.5B

### Media Processing (GPU)
- `acoustic_suppression_deepfilter` — DarkSyntrix Acoustic Suppression DeepFilterNet
- `photographic_restoration_gfpgan` — DarkSyntrix Photographic Restoration GFPGAN
- `avatar_lipsync_hyperlips` — DarkSyntrix Avatar LipSync HyperLips
- `generative_cinematic_ltx` — DarkSyntrix Generative Cinematic LTX
- `super_resolution_esrgan` — DarkSyntrix Super Resolution ESRGAN
- `frame_interpolation_rife` — DarkSyntrix Frame Interpolation RIFE

## License

MIT
