Views
No views yet
1# 1. Clone from HuggingFace
2git clone https://huggingface.co/niko3x/kicadrouterai
3cd kicadrouterai
4
5# 2. Run setup (installs KiCad, PyTorch, everything)
6chmod +x setup_vastai.sh
7./setup_vastai.sh
8
9# 3. Train
10source .venv/bin/activate
11python train.py --timesteps 10000001# Clone
2git clone https://huggingface.co/niko3x/kicadrouterai
3cd kicadrouterai
4
5# Create venv and install
6python3 -m venv .venv
7source .venv/bin/activate
8pip install -e .
9
10# Install PyTorch (with CUDA)
11pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121
12pip install torch-geometric stable-baselines3 gymnasium
13
14# Run tests
15pytest tests/ -vkicadrouterai/
├── src/
│ ├── tags/ # 19 tag types with Pydantic schemas
│ │ ├── base.py # Tag/TagType/TagPriority
│ │ ├── schemas.py # All tag definitions
│ │ └── loader.py # JSON loading, templates
│ ├── core/ # Constraint engine
│ │ ├── action_space.py # Action encoding
│ │ ├── constraint_engine.py # Action masking
│ │ └── board_graph.py # GNN graph representation
│ ├── router/ # AI model
│ │ ├── model.py # GNN with GAT layers
│ │ ├── environment.py # Gym wrapper
│ │ ├── trainer.py # FP8 PPO trainer
│ │ └── inference.py # Production router
│ └── gui/ # KiCad plugin (TODO)
├── tests/ # Unit tests
├── examples/ # Example tag configs
├── train.py # Training script
├── setup_vastai.sh # Vast.ai setup
├── push_to_hf.sh # Push to HuggingFace
└── clone_from_hf.sh # Clone from HuggingFace| Category | Tags |
|---|---|
| Impedance | IMPEDANCE_SINGLE, IMPEDANCE_DIFF (differential pairs) |
| Topology | TOPOLOGY (FLY_BY for DDR, STAR, T_BRANCH) |
| Length | LENGTH_MATCH (serpentine tuning) |
| EMI/EMC | GROUND_RETURN, EDGE_CONTROL, CROSSTALK_CONTROL |
| Via | VIA_ADVANCED (layer pairs, stubs, back-drill) |
| Power | POWER_TRACK, DECOUPLING_HIERARCHY, SWITCHING_NODE |
| Thermal | THERMAL_MANAGEMENT (pad arrays, copper pour) |
| Special | CRYSTAL, ANTENNA_ZONE |
| Layout | PLACEMENT_LOCK, ROUTING_ZONE, FANOUT_PATTERN |
| Phase | Complexity | VRAM | GPU |
|---|---|---|---|
| 1 | Simple (5-20 nets) | 2 GB | RTX 3050 |
| 2 | Medium (50-150 nets) | 4 GB | RTX 4060 |
| 3 | Complex (150-500 nets) | 6 GB | RTX 4060 Ti |
| 4 | BGA/High-Speed (500+) | 12-20 GB | RTX 4090 |
1# Basic training
2python train.py --timesteps 100000
3
4# With custom tags
5python train.py --tags examples/example_tags.json --timesteps 500000
6
7# Resume from checkpoint
8python train.py --resume checkpoints/checkpoint_50000.pt
9
10# Monitor with TensorBoard
11tensorboard --logdir logs1# Push changes
2./push_to_hf.sh
3
4# Clone on new machine
5./clone_from_hf.sh