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.1.tar.gz (21.8 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.1-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agi_web-2026.6.1.tar.gz
  • Upload date:
  • Size: 21.8 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.1.tar.gz
Algorithm Hash digest
SHA256 bec5f3a471e5f2bab4b5d4d47cd45e72a9d2ce7cf105130ba33fe44e3c16262a
MD5 4c42934e3341c32e81865b34f23e2ce6
BLAKE2b-256 fcbcbf9a80b8bcbf902664925bac044ade787fbbde58e3ec78b9065f9ddac2f6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: agi_web-2026.6.1-py3-none-any.whl
  • Upload date:
  • Size: 17.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 610c7b0486c56dddf399586fc96f569a1d4a844691eefdcf20433f3ac781128e
MD5 bbfaa33b79d61d16c74edd2a33f8c242
BLAKE2b-256 e060f4033c8f83c451ec66661ea651413fd43e1643ea6663537dcd21cfb7a51c

See more details on using hashes here.

Provenance

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