AI Blocks

Putting the blocks together

This is taking longer than expected.

Try againBrowse the library
AI Blocks · All skills by job · Minds · Mini tools · How it works · From a source · Apps

AI Blocks › Build and ship software

AI model code generator

Give it a PyTorch or LiteRT model. Get C, C++ or CUDA code that runs it inside your app.

AI model code generator is a free AI skill for the job "Build and ship software". Give the instructions to an AI assistant that supports the required files and tools, then review its output.

Free · No account · BSD 2 Clause licence · Made by MathWorks · Level: expert · Thinking: high

Made by MathWorks. See the original on GitHub; we copied it as it is, with its licence.

What it does

Turn a trained AI model into C, C++ or CUDA code that runs inside your own product or on hardware. The model stays the same. You just stop needing the original framework to run it. You start with a PyTorch .pt2 file or a LiteRT .tflite file. The steps: load the model into MATLAB and inspect its inputs and outputs, write an entry function, build a MEX file, check that its results match the original framework, then generate the production code. It can also place the model in Simulink. This needs MATLAB with Coder tools, which is paid software, and it covers running models only, not training them.

You give it

You get

Use it when

How to use it

  1. Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
  2. Ask for the job in your own words. Your AI opens the skill when it fits.
  3. It works best when your AI can run MATLAB with MATLAB Coder.

More for Build and ship software

Every build and ship software skill