Skip to main content

Render any input as a portico – a three-layer ASCII visualization.

Project description

portico

PyPI Python HF Space

Try it locallyTry it onlineExampleHow it works


About

portico renders input as a three-layered visual abstraction.

portico renders an arbitrary input (text, code, URL, repo) as a portico: a three-layer ASCII visualization with a roof (the unifying idea), pillars (the load-bearing components), and a base (the foundation everything rests on). An LLM decides what each layer means for the specific input; the renderer is a pure function from JSON to ASCII.

  1. The LLM reads your input, classifies it, and decomposes it into three layers _ii^: roof, pillars, base.
  2. The renderer, a pure function from JSON to ASCII, turns those layers into a portico.
  3. The output is a tiny monument of abstraction that helps clarify concepts.
Glyph Layer Meaning
^ Roof The unifying idea
ii Pillars The load-bearing components
_ Base The foundation everything rests on

Try it locally

Install

uv tool install portico-cli
portico README.md
portico https://example.com/article
portico ./src --no-legend
echo "your text here" | portico -

Try it online

Run portico in your browser, no install required:

▶ Try demo on Hugging Face

The space uses 🦙 Llama 3.3 70B via Groq. Paste input and render.

Example

portico "https://en.wikipedia.org/wiki/Transformer_(deep_learning_architecture)"
── encyclopedia article: Transformer ─────────────────────────────────────

                                   ◆ ◆
                               ^^^  ▲  ^^^
     ╔══════════════════════════════════════════════════════════════╗
     ║                  Attention Is All You Need                   ║
     ╚══════════════════════════════════════════════════════════════╝
  ////º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~\\\\
   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
       ▀██▀          ▀██▀          ▀██▀          ▀██▀          ▀██▀
        ██            ██            ██            ██            ██
        ██            ██            ██            ██            ██
      RNN to         Core        Training    Variants and     Broad
   Transformer   Architecture    Paradigm     Efficiency   Applications
        ██            ██            ██            ██            ██
        ██            ██            ██            ██            ██
       ▄██▄          ▄██▄          ▄██▄          ▄██▄          ▄██▄
   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╔════════════════════════════════════════════════════════════════════════╗
║                          Multi-head Attention                          ║
╚════════════════════════════════════════════════════════════════════════╝

legend:
  ^  Attention Is All You Need: Replacing recurrence with multi-head self-
     attention enables parallel, scalable sequence modelling.
  ii RNN to Transformer: Sequential limitations of RNNs and seq2seq models
     motivated the shift to parallel attention.
  ii Core Architecture: Tokenization, positional encoding, encoder and decoder
     layers form the transformer's structure.
  ii Training Paradigm: Large-scale self-supervised pretraining followed by
     task-specific fine-tuning drives performance.
  ii Variants and Efficiency: Encoder-only, decoder-only, and encoder-decoder
     designs, plus optimizations like FlashAttention and KV caching, adapt the
     architecture to diverse needs.
  ii Broad Applications: Transformers have expanded from NLP to vision, audio,
     robotics, and multimodal generation.
  _  Multi-head Attention: Scaled dot-product multi-head attention is the
     mathematical substrate every transformer component rests on.

─────────────────────────────────────────────────────── built with _ii^ ──

Run with claude-sonnet-4-6.

Pipeline

Five stages run in strict order. Each owns one responsibility and hands a typed value to the next. The CLI (cli.py) is the only place that wires them together and translates exceptions into exit codes.

                           ┌──────────────────────────────┐
                           │         LLM provider         │
                           │   claude / openai / gemini   │
                           └──────────────────────────────┘
                              ▲                          ▲
                              │ (if oversized)           │ (analyze + retry)
  input   ┌────────┐   ┌──────┴─────┐   ┌────────┐   ┌───┴────┐   ┌──────────┐   ASCII
  ─────▶  │ loader │──▶│ summarizer │──▶│  cache │──▶│analyzer│──▶│ renderer │ ──────▶
          └────────┘   └────────────┘   └────────┘   └────────┘   └──────────┘
          loaders/     summarize.py     cache.py     analyzer.py  render/
  • loader – reads the input (text, file, directory, URL, or repo) into a normalized LoadedInput.
  • summarizer – chunks oversized inputs and recursively summarizes them via the LLM.
  • cache – hashes (text, provider, model) to JSON on disk; on hit, skips the analyzer.
  • analyzer – prompts the LLM for a three-layer decomposition; validates and retries on bad JSON.
  • renderer – turns the analyzer's JSON into ASCII; pure function, never calls the LLM.

Inputs

  • Raw text or stdin
  • Local files and directories
  • URLs (page content is extracted)
  • Git repositories

When an input doesn't fit a three-layer shape – poems, flat lists, gibberish – portico refuses honestly rather than fake one.

Customization

Flag What it does
--no-legend Hide the per-layer summary (legend renders by default)
--reapex=N Pin the apex to seed N (random by default; pool of 600+ variants)
--json Emit the analyzer's JSON instead of rendering
--diagnose Print a pipeline report (input type, model, fit quality) and exit

Run portico --help for the full list.

Apex

The apex is the ornament crowning the portico -- picked at render time from a pool of 600+ variants.
🎲 --reapex=SEED pins a specific composition to reproduce.

portico https://0trm.blog/data-science-at-camp-nou/ --reapex=0
── essay: Data Science at Camp Nou ─────────────────

                       ▲ * ▲
                    ~~~  ▲  ~~~
     ╔════════════════════════════════════════╗
     ║         Data-Driven Ticketing          ║
     ╚════════════════════════════════════════╝
  ////º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~\\\\
   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
        ▀██▀            ▀██▀            ▀██▀
         ██              ██              ██
         ██              ██              ██
     Analytics    Experimentation    Predictive
         ██              ██           Modeling
         ██              ██              ██
         ██              ██              ██
        ▄██▄            ▄██▄            ▄██▄
   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╔══════════════════════════════════════════════════╗
║                   Fan Behavior                   ║
╚══════════════════════════════════════════════════╝
portico https://0trm.blog/data-science-at-camp-nou/ --reapex=1
── essay: Data Science at Camp Nou ─────────────────

                        ◆ ◆
                    ═══  ◆  ═══
     ╔════════════════════════════════════════╗
     ║         Data-Driven Ticketing          ║
     ╚════════════════════════════════════════╝
  ////º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~\\\\
   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
        ▀██▀            ▀██▀            ▀██▀
         ██              ██              ██
         ██              ██              ██
     Analytics    Experimentation    Predictive
         ██              ██           Modeling
         ██              ██              ██
         ██              ██              ██
        ▄██▄            ▄██▄            ▄██▄
   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╔══════════════════════════════════════════════════╗
║                   Fan Behavior                   ║
╚══════════════════════════════════════════════════╝
portico https://0trm.blog/data-science-at-camp-nou/ --reapex=7
── essay: Data Science at Camp Nou ─────────────────

                       · · ·
                    ░░░  ▲  ░░░
     ╔════════════════════════════════════════╗
     ║         Data-Driven Ticketing          ║
     ╚════════════════════════════════════════╝
  ////º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~~º~\\\\
   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
        ▀██▀            ▀██▀            ▀██▀
         ██              ██              ██
         ██              ██              ██
     Analytics    Experimentation    Predictive
         ██              ██           Modeling
         ██              ██              ██
         ██              ██              ██
        ▄██▄            ▄██▄            ▄██▄
   ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
╔══════════════════════════════════════════════════╗
║                   Fan Behavior                   ║
╚══════════════════════════════════════════════════╝

License

MIT


Built by with AI.
© trm

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

portico_cli-0.1.7.tar.gz (25.2 kB view details)

Uploaded Source

Built Distribution

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

portico_cli-0.1.7-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

Details for the file portico_cli-0.1.7.tar.gz.

File metadata

  • Download URL: portico_cli-0.1.7.tar.gz
  • Upload date:
  • Size: 25.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for portico_cli-0.1.7.tar.gz
Algorithm Hash digest
SHA256 1280df7ef6166bd37625169f96b3619ff3ae8d5ef2e240f86f3910b5c1bbf94b
MD5 c118641a089e412f0763e363902d82e6
BLAKE2b-256 6ed94b1c1cc059758a3e88574cfd1159ca294f3bc720573528628f2bbcae3427

See more details on using hashes here.

File details

Details for the file portico_cli-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: portico_cli-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 32.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for portico_cli-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 08803522ed06595071fee6f223f98c7455b19b8bd9c9f2c412bceee7f0b0367e
MD5 5d7f8ed301789bc8f0a9fd52c974079d
BLAKE2b-256 8b56fddb2207d1dd9988406c21a6ed535bd4a83ece528723af14f34d3a30a87d

See more details on using hashes here.

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