Skip to main content

AGILAB portable web component contract with static Canvas2D/WebGL adapters for Streamlit and HTML

Project description

AGI Web

PyPI version Python versions License: BSD 3-Clause

agi-web defines a portable component contract for AGILAB app-owned UI islands. It lets an app describe a rich browser component once, attach deterministic evidence hashes, and render it in Streamlit or static HTML today while keeping a stable payload for richer adapters. The bundled static adapter can render a WebGL decision-surface heatmap with a Canvas2D overlay/fallback for local replay/scrub controls, clickable timelines, keyboard scrubbing, confidence badges, uncertainty-contour glow, and hover readouts when the payload includes boundary snapshots.

Quick Install

pip install agi-web

Most users get it through the AGILAB UI profile:

pip install "agilab[ui]"

Component Contract

from agi_web import AgiWebComponent, AgiWebRendererSpec, render_streamlit

component = AgiWebComponent(
    component_id="playground-boundary",
    title="Decision boundary",
    renderer=AgiWebRendererSpec(
        renderer_id="pytorch-boundary-webgl",
        technology="webgl",
        capabilities=("decision-boundary", "learning-replay", "gpu-heatmap"),
    ),
    payload={
        "samples": [{"x1": -0.4, "x2": 0.2, "target": 1}],
        "grid": [{"x1": -0.5, "x2": 0.0, "probability": 0.72}],
        "snapshots": [
            {"epoch": 0, "x1": -0.5, "x2": 0.0, "probability": 0.51},
            {"epoch": 8, "x1": -0.5, "x2": 0.0, "probability": 0.72},
        ],
    },
)

render_streamlit(component)

The contract is intentionally framework-neutral:

  • The payload is normalized JSON, so Canvas2D, WebGL, Streamlit, notebook, static-report, and future React renderers can consume the same data.
  • The evidence block records the renderer, payload hash, action hash, and asset hash, so visual proof artifacts can be compared deterministically.
  • The package has no JavaScript build dependency. The current static renderer ships Canvas2D/WebGL paths; framework-specific adapters can be added beside the contract without forcing Node tooling into every AGILAB install.

Visual Guard

The repository ships a deterministic browser fixture for this adapter:

uv --preview-features extra-build-dependencies run --with playwright --with pillow \
  python tools/agi_web_visual_regression.py --browser chromium --max-render-ms 2500 --json

The agi-web-visual workflow parity profile compares Chromium output against the committed docs/source/_static/agi-web-visual-baseline screenshot baseline and records per-browser render timing. Pass repeated --browser options for manual Firefox/WebKit smoke checks.

Repository

Project details


Download files

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

Source Distribution

agi_web-2026.6.23.tar.gz (23.4 kB view details)

Uploaded Source

Built Distribution

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

agi_web-2026.6.23-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

Details for the file agi_web-2026.6.23.tar.gz.

File metadata

  • Download URL: agi_web-2026.6.23.tar.gz
  • Upload date:
  • Size: 23.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for agi_web-2026.6.23.tar.gz
Algorithm Hash digest
SHA256 27d818962e9fb23e0d40865d240c1335dd1a9b4b639c201fc09cc1030f0071ec
MD5 adb191546a9f0aa55a8572a464260832
BLAKE2b-256 f81ac45e31ddb48cac97f2962737204e8ffd064ae2d8376737137c4fad9e8ea4

See more details on using hashes here.

Provenance

The following attestation bundles were made for agi_web-2026.6.23.tar.gz:

Publisher: pypi-publish.yaml on ThalesGroup/agilab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file agi_web-2026.6.23-py3-none-any.whl.

File metadata

  • Download URL: agi_web-2026.6.23-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for agi_web-2026.6.23-py3-none-any.whl
Algorithm Hash digest
SHA256 eff6a7609729ded3607e23501040a6978411c338ae72d2889cba76be87aefbe6
MD5 ac3e948da95f34619ef34b24d64503e2
BLAKE2b-256 2c4eab5235ee5396878a43ba5e262a1e793363e01485501272238a34c69f340a

See more details on using hashes here.

Provenance

The following attestation bundles were made for agi_web-2026.6.23-py3-none-any.whl:

Publisher: pypi-publish.yaml on ThalesGroup/agilab

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page