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.14.1.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.14.1-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agi_web-2026.6.14.1.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.14.1.tar.gz
Algorithm Hash digest
SHA256 40514c708ecf554213844e4744e7a8e3eee8ee741f06a5763bb0ded49d641c19
MD5 7ee85f97c38cfe4a1973de1f559b5632
BLAKE2b-256 7695946da4c872cf1baf5c795f6034b9783135326d867ad70dadebd3d3c4936f

See more details on using hashes here.

Provenance

The following attestation bundles were made for agi_web-2026.6.14.1.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.14.1-py3-none-any.whl.

File metadata

  • Download URL: agi_web-2026.6.14.1-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.14.1-py3-none-any.whl
Algorithm Hash digest
SHA256 91dff1fbce5170a12447e20afba9b973c1e109f88c2b6aa6022aec52e33ac7c0
MD5 5398e0c275e10a056182723e27dc5b26
BLAKE2b-256 bad272bb92267fe99c789da0596e2e03458207c7042cd54a0421dfba6a0338cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for agi_web-2026.6.14.1-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