matlab-deploy-ai-model
Generate C/C++ or CUDA code from an AI model (PyTorch, LiteRT) using MATLAB Coder or GPU Coder. Use when the user wants to integrate an AI model into an application with code generation as the end goal — generating MEX, CUDA MEX, static library, dynamic library, or executable — or using the model in Simulink for simulation and code generation. This skill currently documents the PyTorch ExportedProgram (.pt2) workflow via loadPyTorchExportedProgram; LiteRT is already supported by the product (loadLiteRTModel, R2026a+) but detailed guidance has not yet been added to this skill. invoke, codegen,
npx skills add matlab/matlab-agentic-toolkit --skill matlab-deploy-ai-model --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Generate C/C++/CUDA Code from an AI Model Generate deployable C/C++ or CUDA code from an AI model using MATLAB Coder or GPU Coder. The workflow follows a common pattern regardless of model framework: load, inspect, write entry-point, generate MEX, verify, then generate production code. ## When to Use - User wants to generate C/C++/CUDA code from an AI model (PyTorch, LiteRT) - User has a model file (.pt2, .tflite) and wants to load it into MATLAB - User wants MEX acceleration for an AI model - User wants to generate CUDA code or GPU-accelerated MEX from an AI model - User wants to deploy an AI model to hardware - User wants to use a PyTorch or LiteRT model in Simulink (simulation or code generation) - User wants to verify AI model numerics between the source framework and MATLAB ## When NOT to Use - **General MATLAB Coder usage** (codegen syntax, config tuning, writing codegen-ready code) - **Editable dlnetwork for Deep Learning Toolbox workflows** (quantization, compression, transfer learning) — use `importNetworkFromPyTorch` which returns a `dlnetwork` for PyTorch models. For deployment of an editable `dlnetwork` with model compression (INT8 quantization via `dlquantizer`, prun
- When to Use
- When NOT to Use
- Supported Frameworks
- Generic Workflow
- 1. Load and Inspect
- 2. Write Entry-Point Function
- 3. Verify Numerics
- 4. Generate MEX (First!)
- 5. Verify MEX Output
- 6. Generate Library/Executable
- 7. Use in Simulink
- 8. Deploy to Hardware (Optional — requires Embedded Coder)
- Key Functions
- Conventions
What does the matlab-deploy-ai-model skill do?
Generate C/C++ or CUDA code from an AI model (PyTorch, LiteRT) using MATLAB Coder or GPU Coder. Use when the user wants to integrate an AI model into an application with code generation as the end goal — generating MEX, CUDA MEX, static library, dynamic library, or executable — or using the model in Simulink for simulation and code generation. This skill currently documents the PyTorch ExportedProgram (.pt2) workflow via loadPyTorchExportedProgram; LiteRT is already supported by the product (loadLiteRTModel, R2026a+) but detailed guidance has not yet been added to this skill. invoke, codegen,
How do I install it?
Run `npx skills add matlab/matlab-agentic-toolkit --skill matlab-deploy-ai-model --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From matlab/matlab-agentic-toolkit, a repository with 868 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
