Skip to content

0trm/portico

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

145 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

portico

PyPI Python HF Space

Try it locally β€’ Try it online β€’ Example β€’ How it works


About

portico renders input as a three-layered visual abstraction.

  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 clarifies 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

About

πŸ›οΈ Render input as portico: a three-layered visual abstraction.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages