Skip to main content

gnosys

Python client for Gnosys Labs — the autonomous experimentation platform that proposes ML pipelines, runs them, statistically validates the results against selection bias, and only promotes what survives.

Install

pip install gnosyslabs

Installed as gnosyslabs, imported as gnosys (like scikit-learn → sklearn). The bare PyPI name gnosys is an unrelated project.

Quickstart

from gnosys import GnosysClient

# API key from the dashboard at https://gnosyslabs.com/dashboard/api-keys.
# Or set $GNOSYS_API_KEY in your environment.
client = GnosysClient(api_key="gn_live_...")

# Kick off a hyperparameter sweep on a tabular classification problem.
run = client.runs.create(
    domain="tabular",
    strategist={
        "kind": "hp_sweep",
        "key": "C",
        "values": [0.001, 0.01, 0.1, 1.0, 10.0],
    },
    spec_template={
        "spec_id": "_t",
        "name": "LR sweep",
        "hypothesis": "regularisation strength",
        "task": "classification",
        "dataset_id": "synthetic_binary",
        "model_family": "logistic",
        "hyperparameters": {"C": 1.0},
    },
    max_iterations=4,
    no_progress_window=2,
)

# Block until the run finishes (or hit timeout).
run = client.runs.wait(run.run_id, timeout=600)
print(f"final tier: {run.status}, error: {run.error}")

# Pull the validation findings — same data shape `stigmera diagnose
# findings` shows in the internal CLI.
for finding in client.findings.list(run_id=run.run_id, severity="blocker"):
    print(f"[{finding.severity}] {finding.validator}: {finding.detail}")

What the platform does

You hand Gnosys a spec template (dataset + model family + hyperparameters) and it runs a closed propose-execute-validate-promote loop:

  1. Propose — a strategist (rule-based HP sweep, or LLM-driven) emits the next batch of pipeline variants.
  2. Execute — the platform fits and scores each one.
  3. Validate — the bidirectional validation layer catches generators that fool their own evaluator: multi-calibrated ensembles, distribution-shift decomposition, four honest-eval verifiers (shuffled-label, randomized-feature, secondary-holdout, permutation-FWER) plus an opt-in pre-execute LLM critic.
  4. Promote — surviving pipelines get tier-classified (library / candidate / paper).

Round-by-round validation findings flow back to the strategist as structured prose so the next round's proposals adapt.

API surface

The client wraps the public REST API at https://gnosyslabs.com/v1/*. Every method is available on both GnosysClient (sync) and AsyncGnosysClient.

Runs

run = client.runs.create(domain=..., strategist=..., ...)
run = client.runs.get(run_id)
run = client.runs.wait(run_id, timeout=600, poll_interval=2.0)
runs = client.runs.list(status="completed", limit=50)
iterations = client.runs.iterations(run_id)

Findings

findings = client.findings.list(
    run_id="...",                          # or pipeline_run_id
    validator="honest_eval.shuffled_label",
    severity="blocker",                    # info|low|medium|high|blocker
    spec_id="...",
    limit=100,
)

Correlations (cross-validator)

matches = client.findings.correlations(
    validators=["llm_critic", "honest_eval.shuffled_label"],
    severity="blocker",
    mode="and",   # specs flagged by ALL of them
)

API keys

keys = client.api_keys.list()
client.api_keys.revoke(key_id)

Errors

from gnosys import (
    GnosysError,            # base class
    AuthenticationError,    # 401 — missing / revoked key
    ForbiddenError,         # 403 — tenant suspended
    NotFoundError,          # 404 — wrong run id, or another tenant's
    RateLimitError,         # 429 — see error.retry_after
    ValidationError,        # 400 — bad request payload
    ServerError,            # 5xx — caught after retry exhaustion
)

try:
    run = client.runs.create(domain="tabular", ...)
except RateLimitError as exc:
    time.sleep(exc.retry_after or 60)

Async

from gnosys import AsyncGnosysClient

async def main():
    async with AsyncGnosysClient(api_key="gn_live_...") as client:
        run = await client.runs.create(...)
        run = await client.runs.wait(run.run_id)
        async for finding in client.findings.iter(run_id=run.run_id):
            ...

Configuration

Setting Default Override
API key (required) GnosysClient(api_key=...) or $GNOSYS_API_KEY
Base URL https://gnosyslabs.com GnosysClient(base_url=...) or $GNOSYS_BASE_URL
Request timeout 30s GnosysClient(timeout=...)
Max retries 3 (on 429 / 5xx) GnosysClient(max_retries=...)

Documentation

Full docs at docs.gnosyslabs.com, including quickstart guides for tabular classification, HP sweeps, LLM-driven discovery, and the validation-layer concepts (the deception test, the four honest-eval verifiers, and the explanations registry).

License

Proprietary. See LICENSE. Free to use against gnosyslabs.com; redistribution restricted.

Metadata

Release files for gnosyslabs 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gnosyslabs 1.0.0
File Size Uploaded
gnosyslabs-1.0.0.tar.gz 36.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gnosyslabs 1.0.0
File Interpreter ABI Platform
gnosyslabs-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 82.4 kB

Release files / gnosyslabs-1.0.0.tar.gz

Download URL gnosyslabs-1.0.0.tar.gz
Size 36.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a384e84120f3214c75433df1377973ce9c19c028ac3ee181a1a0504f873c9454
BLAKE2b-256 checksum
How to use checksums
7b5b8b9490064a15f78bd870ea4f854daa1423335c296f86498064a833fac6c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / gnosyslabs-1.0.0-py3-none-any.whl

Download URL gnosyslabs-1.0.0-py3-none-any.whl
Size 46.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
65e3ef2564ca05c0a8a162c1b29525c53bd9697cc2b206fa962fab8c883831d3
BLAKE2b-256 checksum
How to use checksums
17a255c27869572a38da093871ba21dd89936837a18b765bb434d6665e1f6def
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release 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