MathModelAgent
Turns a math-modeling problem into a submission-ready Typst PDF by chaining analysis, modeling, coding, figures and verification skills.
- Source repo
- jihe520/MathModelAgent
- Stars
- ★ 6.4k
- Last updated
- 23d ago
- FARS reviewed
- Nov 25, 2026
- Primary language
- TeX
- FA score
- 37/100 · Major gaps
At a glance
- How it runs
- Works with
- Universal · cross-platformCodex · Claude Code · OpenAI API · Claude API
- Cost
- Free software; you pay for model usage
- Setup effort
- Low · running in minutes
- You'll need
- Typical use
- Contest teams in the national contest, MCM/ICM, Huashu Cup or Huawei Cup who need a structurally complete, typeset draft inside a three-day window.
- Not a fit if
- Teams that need commercial use: the licence is personal-use only
- Teams that need production reliability: the project calls itself an experimental demo
- Users who need vision-model input: vision model support is still on the roadmap
- Website
- mathmodel.top/home ↗ set on GitHub
- Maintenance
- Commits in the last 30 dayslast commit 2026-11-02
- Source review
- 37/100 · Major gaps 4 safety controls not found
What does this agent do, and when should you use it?
MathModelAgent is an automation pipeline for mathematical-modeling contests: hand it the problem statement and data, and it runs analysis, model design, code execution, figure drawing, paper typesetting and verification, ending with a Typst PDF meant to be submitted as-is. The project has moved to a skills-only design — the workflow is chained from stage skills such as 1start-mathmodel, 2analysis-modeling, 3coding-visual, 4drawio, 5writing and 6verity, each callable on its own, plus mathmodel-to-ei (rewrite a finished paper as an IEEE conference paper), doctor (environment check) and typst-author (Typst editing). There are two delivery paths: a desktop build bundling Claude Code and the whole skill set (macOS arm64/x64, Windows x64) that only needs one model API key, or npx skills add jihe520/MathModelAgent --all to load the skills into Claude Code / Codex-style harnesses. The Web stack is still in the repo — FastAPI backend, frontend and Redis, runnable with docker-compose, frontend on http://localhost:5173 and API on http://localhost:8000 — and writes notebook.ipynb and res.md under backend/project/work_dir/. Models are reached through litellm so each agent can use a different provider, and code runs in a local Jupyter interpreter or a cloud interpreter (E2B, daytona). Licensing is free for personal use with commercial use requiring the author's permission, and the project describes itself as an experimental demo.
Once a problem statement and data are supplied, /1start-mathmodel kicks off the full run and produces a modeling plan and task list; 2analysis-modeling reads the problem and data and returns a modeling report, assumptions, formulas and constraints; 3coding-visual writes and executes the solving code, producing reproducible code, a result report and figure PDFs — the local interpreter is Jupyter-based and stores code as notebook.ipynb, and E2B or daytona cloud interpreters can be swapped in; 4drawio draws technical-route, solving-flow and model-structure diagrams as editable DrawIO files plus PDFs; 5writing matches one of 17 Chinese/English competition Typst templates (national contest, Huashu Cup, Huawei Cup, MCM/ICM and others) and compiles a PDF; 6verity runs a 9-step acceptance pass covering text-leak detection, numeric consistency checks, Typst compilation and PDF visual inspection. mathmodel-to-ei reorganizes a finished modeling paper into an IEEE conference LaTeX paper and delivers source, compiled PDF and a revision note; doctor checks workflow dependencies and gives install guidance; typst-author handles Typst authoring and layout debugging; mathmodel-figure-templates supplies plotting scripts; _references holds the shared modeling, writing and figure conventions read by other skills. The Web backend is FastAPI, prompts can be tailored per subtask through prompt inject in backend/app/config/md_template.toml, and run artifacts land in backend/project/work_dir/<project>/ as notebook.ipynb and res.md.
- Contest teams in the national contest, MCM/ICM, Huashu Cup or Huawei Cup who need a structurally complete, typeset draft inside a three-day window.
- Researchers holding a finished modeling-contest paper who want it rewritten as an English IEEE conference paper with compilable LaTeX source and a PDF via mathmodel-to-ei.
- Instructors and students who want a worked example of the whole path from problem analysis and model selection to Typst typesetting and acceptance checking.
- Developers already working inside Claude Code or Codex who want modeling capability as installable skills they can call stage by stage.
- Lab groups that need the solving process kept as notebook.ipynb and figures kept as PDFs for reproduction and later editing.
- Individual developers who want to plug in their own model API keys and assign different models per agent to control cost.
Key setup facts
Pulled from the install and usage notes below. The project README has the current values.
- Install / run
npx skills add jihe520/MathModelAgent --allpip install uvnpm install -g pnpm
- Ports
6379·8000- Environment variables
REDIS_URL- Config files
backend/.env.examplebackend/.env.dev- Install notes cover
- Windows · macOS · Linux · Docker
How do you install or deploy this agent?
The recommended path is the desktop build from the Releases page: use mathmodel-<version>-arm64.dmg on Apple-silicon Macs, -x64.dmg on Intel Macs and -x64.exe on 64-bit Windows. It ships Claude Code plus the full MathModelAgent skill set, so no Python, Node.js or Redis installation is needed — one model API key is enough to start.
For Claude Code and Codex harnesses, install every skill with one command:
npx skills add jihe520/MathModelAgent --allThe simplest route to the Web version is Docker (a Docker runtime is required):
git clone https://github.com/jihe520/MathModelAgent.git
cd MathModelAgent
docker-compose upLocal deployment needs Python, Node.js and Redis. Install the backend dependencies first:
cd backend
pip install uv
uv syncThen the frontend dependencies:
cd frontend
npm install -g pnpm
pnpm iStart Redis and export the environment variables (macOS / Linux shown; Windows can use win_start.bat or the PowerShell commands from the README):
export ENV=DEV
export REDIS_URL=redis://localhost:6379/0
redis-serverRun the backend:
source .venv/bin/activate
uvicorn app.main:app --host 0.0.0.0 --port 8000 --ws-ping-interval 60 --ws-ping-timeout 120 --reloadRun the frontend:
cd frontend
pnpm run devHow do you use this agent?
Desktop build: install it, enter a model API key and start modeling in the chat.
Skill route in Claude Code — start a session:
claude --dangerously-skip-permissionsThen invoke the full pipeline inside the session:
/1start-mathmodel 完成这个数学建模任务Codex route:
codex --yolo$start-mathmodel 完成这个数学建模任务Helper commands include /doctor (environment check) and /typst-author (Typst knowledge).
Web / Docker route: once the stack is up, open the frontend at http://localhost:5173 with the API at http://localhost:8000 and set the key under sidebar → avatar → API Key; alternatively copy backend/.env.example to backend/.env.dev and fill in the per-agent API settings. Run artifacts are written to backend/project/work_dir/<project>/, where notebook.ipynb keeps the generated code and res.md keeps the final result.
Safety boundaries, hardening & integrations
Operational blast radius, source-verified safety controls, and first-run hardening steps before connecting this agent to real workspaces.
Declared capability surface (blast radius)
Can run terminal commands; pair with approval gates or container/OS sandboxing.
Modifies local files; work on a clean Git branch or dedicated worktree.
Makes outbound requests; verify telemetry settings and model data routing on private repos.
FARS trust-control audit
- least-privilege scoping — Grant only what the task needs: a dedicated account or read-only token, scoped to specific directories and repos.
- confirmation before acting — Turn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- sensitive-data handling — Use dedicated, low-privilege, revocable API keys — never production credentials — and keep secrets out of logs.
- rollback or recovery path — Back up first, or work on a git branch or snapshot, so its changes can be undone.
What are this agent's strengths and limitations?
- Ships 17 Chinese/English Typst competition templates plus a built-in modeling knowledge base (model-selection decision tree covering AHP, TOPSIS, ARIMA, GA and MCM/ICM scoring criteria), so the deliverable is a typeset PDF rather than plain text.
- Every stage is a separate skill: one /1start-mathmodel chain runs end to end, or you can run only analysis or only writing, and call them directly from Claude Code / Codex.
- Models are reached through litellm, so the modeling, coding and writing agents can each use a different provider, and the workflow is agentless with no extra agent framework.
- Code executes in a local Jupyter interpreter and is stored as notebook.ipynb for reproduction and re-editing, with E2B and daytona cloud interpreters as alternatives.
- 6verity runs a 9-step acceptance pass covering text-leak detection, numeric consistency checks, Typst compilation and PDF visual inspection.
- The desktop build bundles Claude Code and all skills, removing Python / Node.js / Redis setup and manual skill configuration.
- The licence is free for personal use only; commercial use requires contacting the author, and GitHub metadata lists the licence as unknown.
- The author describes the project as an experimental demo with many bugs and frequent changes, so it is not a stable production dependency.
- Several advertised capabilities are still roadmap items: the README notes RAG retrieval core logic, complete HIL workflow integration and Evaluator/Feedback are unimplemented, and the planned Tavily search was replaced by OpenAlex.
- Self-hosting needs Python, Node.js and Redis plus uv and pnpm, or a docker-compose stack; Windows also requires adjusting the PowerShell execution policy.
- The Windows installer is unsigned and may trigger Microsoft Defender SmartScreen, and Windows auto-update awaits code-signing setup.
- No benchmark or test-coverage evidence is published, so output quality depends on the chosen model and black-box harness tuning.
How does this agent compare with similar options?
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| MathModelAgent This agent | 37 · Major gaps | Desktop appFree + model costs | ★ 6.4k | 23d ago | TeX | Codex · Claude Code · OpenAI API · Claude API |
| Principia | 66 · Some gaps | CLIFree + model costs | ★ 1.1k | 1mo ago | Rich Text Format | — |
| Meta ARE | 57 · Major gaps | CLIFree + model costs | ★ 582 | 1mo ago | Python | — |
| Gamma-World: Multi-Agent World Model | 38 · Major gaps | — | ★ 578 | 5mo ago | Python | — |
How does FollowAgents rate this agent?
Why each dimension lost points
least_privilege 0: SKILLs allow Bash(*), Write, Edit, Agent, WebSearch/WebFetch, and README recommends claude --dangerously-skip-permissions and codex --yolo; main.py sets CORS allow_origins=['*'] with allow_credentials=True. user_confirmation 0: HIL remains an unfinished TODO in README, and the recommended usage bypasses permission prompts. data_flow_transparency 1: README mentions E2B/Daytona/Tavily/OpenAlex and API key configuration, but gives no data-flow, retention, or transfer details. sensitive_data_handling 0: API keys are configured via .env/WebUI, with no evidence of secret protection, redaction, or access control. dependency_security 1: uv/pnpm/Docker install instructions exist, but the sample has no lockfile or audit evidence. external_effects 1: the agent writes files, runs code, and can use web/cloud interpreters, but there is no pre-execution confirmation or impact control. rollback 0: no rollback or undo mechanism. source_attribution 1: README credits several projects and LaTeX templates, but lacks per-file provenance and license-compatibility notes. Deductions are driven by overbroad permissions, missing confirmation, and weak sensitive-data handling.
self_consistency 0: README's feature list claims HIL, four-layer fault tolerance, Tavily, and RAG, while the later plan/TODO states these are unimplemented or configuration-only, creating direct contradictions. dependency_availability 1: install commands and dependency lists exist, but there is no pinned-version or availability verification. failure_messages 1: the doctor skill and export-failure instructions provide some failure guidance, but no concrete error taxonomy or recovery path. Deductions come from contradictory capability claims and limited verifiable dependency/error-handling evidence.
audience_and_scenarios 2: clearly targets math-modeling competition users and offers desktop/developer deployment. capability_boundaries 2: each SKILL defines stage boundaries and README marks the project as experimental, but product-level capability claims conflict with TODO status. trigger_precision 2: SKILL frontmatter provides name/description and commands such as /1start-mathmodel are explicit, though triggering depends on the harness. environment_fit 2: Docker/local/desktop environments and a doctor check are documented, but Redis is required and the Windows build is unsigned. Deductions reflect some product-level ambiguity and environment friction.
information_architecture 2: README is well structured and skills are staged. install_notes 2: Docker/local/script/desktop instructions are fairly complete, though commands and dependencies are complex. naming_stability 1: numbered skills and commands show naming conventions, but there is no stability or deprecation policy. examples_and_faq 1: example images, tutorial links, and a demo exist, but no FAQ. known_limitations 2: README clearly states experimental status, that direct award-winning is unrealistic, and that the Windows build is unsigned. license 1: a custom 'free for personal use, contact author for commercial use' license points to License.md, but metadata is unknown. versioning_changelog 0: no changelog, only a releases link. maintenance_responsibility 1: the author says they are busy and update when possible, with no explicit maintenance commitment. Deductions are mainly for versioning, FAQ, and license clarity.
output_usability 1: README claims a submission-ready PDF paper and 17 templates, but the packet contains no actual paper/PDF output to verify. marginal_value 2: end-to-end skill orchestration, templates, and staged artifacts provide clear incremental value, though the space is crowded. cost_benefit 1: low-cost, agentless, multi-model claims are asserted without cost or effectiveness benchmarks. Deductions are because output quality and cost-benefit remain assertion-level.
claim_traceability 1: some claims trace to SKILL/README links, but '9-step acceptance', '17 templates', and 'four-layer fault tolerance' lack corresponding evidence. cross_source_corroboration 1: README, CLAUDE.md, and SKILLs partially corroborate the workflow structure, but feature claims conflict with TODO status. fact_inference_separation 1: WARNING/CAUTION/TODO notes separate some limitations, but marketing-style feature lists are mixed with facts. Deductions are due to key capability claims lacking verifiable evidence.
- Not found in source: least-privilege scopingGrant only what the task needs: a dedicated account or read-only token, scoped to specific directories and repos.
- Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- Not found in source: sensitive-data handlingUse dedicated, low-privilege, revocable API keys — never production credentials — and keep secrets out of logs.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- Do not run untrusted inputs with the README-recommended --dangerously-skip-permissions/--yolo; HIL is unfinished and pre-execution confirmation is missing.
- main.py uses CORS allow_origins=['*'] with allow_credentials=True; restrict origins and review authentication before public deployment.
- API keys are configured via .env/WebUI, but there is no evidence of encryption, redaction, access control, or log sanitization.
- README lists HIL, four-layer fault tolerance, Tavily, and RAG as features, while the later plan/TODO says they are unimplemented or configuration-only; validate actual capability.
- The license is a custom non-commercial term with unknown metadata; confirm authorization before commercial use or redistribution.
- No rollback/undo mechanism is evident; code execution and file writes may overwrite or damage the working directory.
FAQ
Does it cost anything to use?
Do I have to install Python and Redis?
Can the generated paper be submitted or win a prize?
Which models can I use?
Are RAG, human-in-the-loop and fallback usable today?
Is MathModelAgent open source?
Is MathModelAgent safe to use?
Is MathModelAgent still maintained?
Who makes MathModelAgent?
What is MathModelAgent's official website?
Thanks — we use this to improve the page.
Subscribe to the FollowAgents RSS feed, or save this agent to your browser shortlist to compare on your next visit.