Paper2Project converts a machine learning research paper PDF into a structured, editable, reproducible starter project with PyTorch code and a Google Colab notebook.
It is built for the real paper-to-implementation workflow:
upload paper -> inspect extracted pipeline -> edit decisions -> generate code -> run notebook
The app now includes a simple workflow UI for uploads, progress tracking, agent trace inspection, decision editing, and artifact downloads.
Given a research paper PDF, Paper2Project can:
- Parse and clean the paper
- Extract a structured ML understanding
- Build an executable pipeline plan
- Expose a human-editable decision layer
- Generate modular project files
- Generate a Colab notebook
- Package the artifacts for download
Generated artifacts include:
model.pydata_loader.pytrain.pyconfig.yamlrequirements.txtpaper2project_notebook.ipynb
Research papers are rarely implementation-ready. They often leave gaps around preprocessing, hyperparameters, dataset availability, evaluation details, or engineering structure.
Paper2Project is designed to bridge that gap by making every stage explicit:
- what the parser extracted
- what the analyst inferred
- what the planner assumed
- what the user changed
- what the generator produced
- Multi-agent instead of one giant LLM call
- JSON contracts between stages
- Human-in-the-loop before generation
- Reproducibility over magic
- Graceful degradation when inputs are messy
- Baseline code that runs and can be extended
flowchart TD
A["Upload Paper PDF"] --> B["PDF Parsing + Cleaning"]
B --> C["Paper Analyst Agent"]
C --> D["Analysis JSON"]
D --> E["Planner Agent"]
E --> F["Pipeline Plan JSON"]
F --> G["Decision Agent"]
G --> H["Editable Decision Config"]
H --> I["User Approval"]
I --> J["Code Generator Agent"]
J --> K["Project Files"]
K --> L["Notebook Builder Agent"]
L --> M["Colab Notebook + Artifact Bundle"]
The built-in UI lets a user:
- upload a PDF directly from the browser
- see recent jobs and live status changes
- inspect parsed summaries, analysis, and pipeline plans
- review agent prompts, payloads, and responses
- edit training and model decisions
- approve generation
- download the final artifact bundle
The UI is served directly by FastAPI at /.
Extracts:
- task
- domain
- input/output format
- model family
- components
- loss
- metrics
- training details
Converts analysis into:
- execution steps
- dataset requirements
- model structure
- hyperparameters
- assumptions
- open questions
Exposes user-editable controls such as:
- dataset
- model
- optimizer
- scheduler
- loss
- epochs
- batch size
- learning rate
- seed
Builds a runnable baseline project from the approved config.
Builds a Colab notebook that reconstructs the generated files and runs training.
- PDF parsing with PyMuPDF
- Section chunking for downstream LLM calls
- Heuristic equation extraction
- Optional Grobid TEI ingestion
- Optional arXiv source download and LaTeX text enrichment
- Multi-provider LLM client
- Shared agent memory across stages
- Configurable provider roster
- Configurable provider strategy:
fallback_chainfirst_successensemble
- Retry and backoff support
- Heuristic fallback when LLM output is unavailable or invalid
- FastAPI backend
- Background job execution with
ThreadPoolExecutor - Persistent JSON job store
- Artifact metadata and zip download endpoint
- API key protection
- CORS support
- Config-driven training entrypoint
- Multi-domain baseline generation for:
- NLP classification
- NLP generation
- CV classification
- CV segmentation
- tabular classification/regression
- RL with a DQN baseline
- TensorBoard and optional W&B hooks
The current provider layer supports:
- OpenAI
- Anthropic
- Google Gemini
- OpenRouter
- DeepSeek
- Groq
- Together
- xAI
- Ollama
Configuration is environment-driven with P2P_-prefixed settings, and .env loading is supported.
pro4/
|-- app/
| |-- agents/
| |-- api/
| |-- core/
| |-- models/
| |-- orchestration/
| |-- prompts/
| |-- services/
| `-- web/
|-- docs/
| `-- images/
|-- examples/
|-- tests/
|-- pyproject.toml
`-- README.md
- app/main.py
- app/orchestration/workflow.py
- app/models/schemas.py
- app/services/llm_client.py
- app/services/pdf_parser.py
- app/services/code_generator.py
- app/services/notebook_builder.py
- app/web/index.html
- tests
Upload a PDF and create a background job.
List recent jobs for the UI.
Fetch job state and outputs.
Fetch the agent trace shown in the UI.
Fetch the editable decision config.
Update the decision config before generation.
Start project and notebook generation.
Fetch the artifact manifest.
Download the generated zip bundle.
python -m venv .venv
.venv\Scripts\activate
pip install -e .
uvicorn app.main:app --reloadOpen:
Health check:
curl http://127.0.0.1:8000/healthExamples:
P2P_OPENAI_API_KEY=...
P2P_ANTHROPIC_API_KEY=...
P2P_GOOGLE_API_KEY=...
P2P_LLM_ROSTER=openai:gpt-4.1-mini,anthropic:claude-3-5-sonnet-latest,google:gemini-2.5-flash
P2P_LLM_STRATEGY=fallback_chain
P2P_REQUIRE_API_KEY=false- fixed seed in generated configs
- explicit assumptions
- config-driven training
- modular output files
- editable decision layer
- artifact packaging
- notebook reconstruction from generated files
Paper2Project is now beyond a pure scaffold. The repository includes:
- provider-backed LLM orchestration
- persistence for job state
- background execution
- config-driven code generation
- notebook generation
- download endpoints
- authentication and CORS
- a workflow UI
- tests for core utilities
It is still a baseline-oriented system, not a perfect paper reproduction engine. That tradeoff is intentional.
The repository includes a real starter test suite in tests covering:
- job store persistence
- PDF parsing basics
- nested heading handling
- dataset mapper behavior
- generated config structure
- memory filtering and truncation
Paper2Project is authored and directed by Antony Joseph.
AI-assisted contribution and development support:
- OpenAI Codex
- Claude
- Architecture
- Implementation Plan
- Example Parsed Paper
- Example Analysis
- Example Pipeline Plan
- Example Decision Config
The target workflow is straightforward:
Upload a paper -> inspect the extracted pipeline -> edit decisions -> generate code -> run the notebook.
That is the workflow this repository is built around.


