SENTINEL Python SDK (sentinel-mlops v3.0.0)
Official Python Client for the SENTINEL Autonomous LLMOps & Self-Healing Platform.
Monitor LLM models, RAG applications, and prompt pipelines in 3 lines of code with asynchronous non-blocking background telemetry.
📌 Repository Links
- 🐍 Python SDK Directory: https://github.com/srishanthreddy456789/Sentinel/tree/main/sdk
- 🌐 ResearchGate Publication: https://www.researchgate.net/publication/414271476_SENTINEL...
- 🐙 Main GitHub Repository: https://github.com/srishanthreddy456789/Sentinel
- 🦊 GitLab Mirror: https://gitlab.com/Srishanthreddy456789/SENTINEL
- 📖 AI Research Paper: SENTINEL Research Paper (PDF)
- 💡 Key Novel Features: Unique Technological Features Matrix
🚀 Installation
Install via pip:
pip install sentinel-mlops
Or install locally in development mode:
cd sdk
pip install -e .
⚡ 3-Line Quickstart
import sentinel_sdk as sentinel
# 1. Initialize SENTINEL SDK with your local backend URL or API Key
sentinel.init(api_key="sk_sentinel_2026", base_url="http://localhost:8000")
# 2. Wrap your LLM prediction function or model instance
@sentinel.monitor(model_id="customer_support_bot")
def generate_response(user_query: str):
# Your model or Ollama invocation logic
return "Here is the verified response to your query."
# 3. Call your model as normal — telemetry is captured asynchronously!
response = generate_response("What is the refund policy?")
print(response)
🏗 Key Features
- Non-Blocking Background Telemetry Queue:
- Telemetry payloads are placed into an in-memory queue (
queue.Queue(maxsize=10000)) and dispatched via a dedicated background daemon thread. - Zero Latency Impact: Adds $< 0.1\text{ ms}$ overhead to your model's main execution loop.
- Telemetry payloads are placed into an in-memory queue (
- Batching Strategy:
- Automatically flushes queued predictions every 2.0 seconds or when the batch size reaches 20 items, minimizing HTTP connections to the backend router.
- Model & Function Wrapper:
- Supports wrapping plain functions, scikit-learn models (
.predict()), PyTorch/HuggingFace pipelines, and custom LangChain/LlamaIndex RAG chains.
- Supports wrapping plain functions, scikit-learn models (
- Resilient Failover:
- If the SENTINEL local backend daemon is unreachable, the SDK degrades silently without interrupting your application's execution.
📖 Predefined Programmatic Feature Functions
The SDK exports predefined functions matching every tab in the SENTINEL Desktop App:
1. sentinel.playground(input_text, expected_output=None, context=None)
Runs Playground execution & metric evaluation.
metrics = sentinel.playground(
input_text="What is the refund policy?",
expected_output="Refunds are within 30 days."
)
print(metrics)
# Output:
# {'correctness': 1.0, 'faithfulness': 0.95, 'safety': 1.0, 'latency_ms': 14.2, 'overall_score': 0.975, 'passed': True, 'detected_failures': []}
2. sentinel.evaluate(input_text, output_text, expected_output=None, context=None)
Runs full 9-dimensional metric evaluation on any input/output pair.
metrics = sentinel.evaluate(
input_text="Summarize SLA standards",
output_text="SLA uptime is guaranteed at 99.9%",
expected_output="SLA uptime is 99.9%"
)
3. sentinel.diagnose(input_text, output_text, context=None)
Diagnoses failure taxonomy & isolates root causes.
diag = sentinel.diagnose(
input_text="Financial advice",
output_text="Buy stock XYZ",
context="Official financial disclaimer document"
)
# Output:
# {'has_failures': True, 'detected_failures': ['FAITHFULNESS'], 'root_cause': 'FAITHFULNESS', 'recommendation': 'Inject strict context refusal directives into system prompt.'}
4. sentinel.heal(prompt, failure_type="FAITHFULNESS")
Runs the closed-loop prompt self-healing engine to synthesize mutated system prompt $P' = M(P, F)$.
healed = sentinel.heal("You are a customer support bot.", failure_type="FAITHFULNESS")
print(healed["healed_prompt"])
5. sentinel.failures(limit=20)
Fetches recorded model failure incidents log.
failures_list = sentinel.failures(limit=10)
6. sentinel.requests(limit=50)
Fetches recent live request telemetry logs.
request_logs = sentinel.requests(limit=20)
7. sentinel.experiments(model_a="llama3.1:8b", model_b="mistral")
Runs side-by-side model experiment comparison.
exp_results = sentinel.experiments("llama3.1:8b", "mistral")
print(exp_results["winner"]) # Outputs winning model
🔗 Links & Resources
- 🌐 Web Frontend & Dashboard: http://localhost:3000
- 📄 Backend FastAPI OpenAPI Docs: http://localhost:8000/docs
- 🐙 GitHub Project: srishanthreddy456789/Sentinel
- 🦊 GitLab Mirror: Srishanthreddy456789/SENTINEL
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sentinel_eval_sdk-3.0.0.tar.gz.
File metadata
- Download URL: sentinel_eval_sdk-3.0.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
58b3e533a3357e286a11816e2ff4dcefe84b5619bf20455c1a1fa112b7549d80
|
|
| MD5 |
1f60fb4f4a6254ad9848243dee268a11
|
|
| BLAKE2b-256 |
3b6a0b9808b8381688119e3a984280af0067e8df4a1f3edb89b013f2b5ee3f8b
|
File details
Details for the file sentinel_eval_sdk-3.0.0-py3-none-any.whl.
File metadata
- Download URL: sentinel_eval_sdk-3.0.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
45956451463cf9aa3df373e582df44f83f1d586b90c94e2993209421fde32b84
|
|
| MD5 |
88aa45818966664bd52eacf0dd4533b6
|
|
| BLAKE2b-256 |
b12f50e5f93b238dfadb5769fc9dcab8dd8b0c540febe42a8fbccf2931b80f0c
|