Repository navigation
Draw ideas as animated diagrams, and read whole papers with long-context APIs - #1
Merged
Merged
Conversation
…ext APIs Papers were coming out as their equations re-typeset and animated line by line. Two causes, fixed together: 1. The deployed default (client render mode) offered only three fixed shapes, and the one that could hold an idea was a formula chain. Add `concept_diagram`: the model draws the mechanism on a grid (tokens, vector stacks, matrices whose cells light up, distributions, operators, blocks, containers), connects the parts, and scripts 3-7 steps (reveal, flow a pulse along a path, mark cells, relabel, focus). It renders in the browser (ConceptDiagramScene) and in Manim, on one timeline: browser and Python durations match exactly, and a real Manim 0.18.1 render passes Gates 1-3 with estimate_duration within 0.4%. 2. Groq's free tier meters 8,000 tokens/minute, so ANALYZE saw ~5,000 chars of a ~78,000-char paper and proposed visuals for whichever equations it was shown. Add a long-context provider with presets (openrouter, gemini, mistral, deepseek, cerebras, custom) whose prompt budget comes from the 100K-260K context window: one pass over the whole paper, and codegen gets the full section. Strict json_schema where supported, falling back to prompted JSON when a host refuses or ignores the schema. Auto-selected after Anthropic. Prompts now tell the analyzer to draw the mechanism, not the notation, with concept_diagram described first. Triage keeps at most 2 transform_chain scenes per paper (ARCVISUAL_MAX_FORMULA_SCENES) and re-casts the rest as diagrams of the same claim. The landing hero shows attention drawn as a mechanism. PIPELINE_VERSION -> 0.3.0-diagrams so cached articles are rebuilt. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BgiEmhLGtyG2FWJkiiwD1M
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6b052eadf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A grid's `cells` label its rows and columns, and the browser renderer draws them, but the Manim branch built only the squares, so video renders of an attention matrix lost their axis labels. Draw each label above its column and left of its row. Verified with a real render: Gates 1-3 pass and the runtime estimate is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BgiEmhLGtyG2FWJkiiwD1M
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Explained papers came out as their equations re-typeset and animated line by line, instead of diagrams that explain the idea. There were two causes:
gpt-oss-120bitself has a 131K context window; the per-minute meter was the bottleneck.Changes
New
concept_diagramarchetype (client-renderable)tokens,stack(vectors),grid(a matrix whose cells light up),bars(a distribution)op(an operator such as ×, softmax, concat),block,container, and a shorttextannotationreader/components/scenes/ConceptDiagramScene.tsx) and in Manim (arcvisual/templates/concept_diagram.py).Long-context provider (
arcvisual/providers/longcontext_provider.py)openrouter,gemini,mistral,deepseek,cerebras,custom. Each preset has a model fallback chain, and every value can be overridden withLLM_*env vars.json_schemais used where the host supports it. If a host refuses the schema (a 400) or silently ignores it, that call falls back to prompted JSON instead of failing. OpenRouter requests sendrequire_parametersso they only reach hosts that honour the schema.autopicks the long-context provider after Anthropic and before Groq.settings().offlinenow agrees with the registry for Groq and every preset.Steering
concept_diagramis described first, andtransform_chainis described as rare.ARCVISUAL_MAX_FORMULA_SCENES(default 2) formula chains per paper. Further formula proposals become diagrams of the same claim instead of being dropped.PIPELINE_VERSIONis now0.3.0-diagrams, so cached articles are rebuilt.Verification
pytest: 364 passed, 1 skipped (the same skip as before). 38 of the tests are new:tests/test_concept_diagram.pyandtests/test_longcontext.py.ruff checkandruff format --checkare clean.tsc --noEmitandnext buildboth pass.tests/test_render.py -m slow) were run against real Manim 0.18.1 in a Python 3.12 venv, withconcept_diagramadded. Gate 2 and the trace check pass, andestimate_durationis within 0.4% of the measured runtime.plans.tsand running it in Node).Not verified: no live model call has been made through the new provider. The provider hosts weren't reachable from the build environment and there were no keys. Model ids and free-tier terms are a snapshot from October 2026 and should be confirmed in each provider's console.
Deploying
The production API is set to
ARCVISUAL_PROVIDER=groqin Vercel. To use the new provider, set it toopenrouter(orgemini/mistralfor a free tier), add the matching key, and redeploy.🤖 Generated with Claude Code
https://claude.ai/code/session_01BgiEmhLGtyG2FWJkiiwD1M
Generated by Claude Code