Skip to main content

SENTINEL Python SDK (sentinel-mlops v3.0.0)

Python Version GitHub SDK GitLab

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


🚀 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

  1. 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.
  2. 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.
  3. Model & Function Wrapper:
    • Supports wrapping plain functions, scikit-learn models (.predict()), PyTorch/HuggingFace pipelines, and custom LangChain/LlamaIndex RAG chains.
  4. 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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sentinel_eval_sdk-3.0.0.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sentinel_eval_sdk-3.0.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

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

Hashes for sentinel_eval_sdk-3.0.0.tar.gz
Algorithm Hash digest
SHA256 58b3e533a3357e286a11816e2ff4dcefe84b5619bf20455c1a1fa112b7549d80
MD5 1f60fb4f4a6254ad9848243dee268a11
BLAKE2b-256 3b6a0b9808b8381688119e3a984280af0067e8df4a1f3edb89b013f2b5ee3f8b

See more details on using hashes here.

File details

Details for the file sentinel_eval_sdk-3.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sentinel_eval_sdk-3.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 45956451463cf9aa3df373e582df44f83f1d586b90c94e2993209421fde32b84
MD5 88aa45818966664bd52eacf0dd4533b6
BLAKE2b-256 b12f50e5f93b238dfadb5769fc9dcab8dd8b0c540febe42a8fbccf2931b80f0c

See more details on using hashes here.

Release history Release notifications | RSS feed

3.0.2

2 files

3.0.1

2 files

This release

3.0.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page