WhoBuilt

Compilers in the Age of LLMs

Nov 24, 2025· 18 min· 4.2K views·Watch on YouTube

Speaker

Yusuf Olokoba of Muna speaks at AI Engineer about compiling Python model inference code into portable native binaries and using LLMs in the compiler pipeline.

Make model deployment simpler

Olokoba describes the overhead of trying new models: writing Dockerfiles, provisioning infrastructure, and wiring each model into agent tools. Muna’s goal is an OpenAI-style client that can point to models running locally or remotely with minimal code changes.

Trace Python into an intermediate representation

Olokoba frames a Python compiler as a way to make model deployment simpler and support hybrid inference, where smaller local or edge models work alongside larger cloud models. For an EmbeddingGemma 270M example, he explains why Muna built its own tracer: PyTorch’s tracer is focused on PyTorch code and relies on fake inputs that are difficult to create for arbitrary data types. An early LLM-based tracing approach was nearly 100% accurate in their tests but too slow, so they switched to analyzing Python’s abstract syntax tree and building an intermediate representation.

Propagate types and generate native code

Python variables can change type, while C++ and Rust require fixed types, so the compiler propagates type information through the intermediate representation. For example, it determines that adding a string prefix to an input string produces another string. Olokoba says LLMs can generate native implementations of the many elementary operations the compiler needs, reducing manual rewriting.

Run the compiled model through a familiar client

The compiler generates C++ code that can be built into a dynamic library for a target device or platform. Olokoba demonstrates calling that library from Node.js using a foreign function interface, then mapping a model name in an OpenAI-style embeddings client to the library path. The client returns the compiled model’s embedding matrix in a format resembling the official OpenAI client.

Takeaways

  • A standard client interface can make switching between model runtimes simpler for application code.
  • Tracing arbitrary Python inputs may require a custom approach when existing tools depend on framework-specific types or fake inputs.
  • Type propagation connects Python function signatures and known native types to the fixed types required by generated C++ or Rust.
  • LLMs can help produce implementations for compiler operations, while the compiler’s tracing and type analysis provide structure for code generation.
  • Compiling inference code into native libraries can let applications call models across languages and on devices beyond cloud servers.

Mentioned in this talk

Search inside this talk

What was claimed 6

  • feature
    Python compiler: Converts Python inference code into tiny, self-contained binaries that can run across platforms
    “convert that into a tiny, self-contained binary that can run anywhere at all”
    YouTube
    Unverified1 source· Talk
  • built
    “we decided to build a compiler for Python”
    YouTube
    Unverified1 source· Talk
  • metric
    EmbeddingGemma 270M: 270 million parameters
    “at only 270 million parameters”
    YouTube
    Unverified1 source· Talk
  • feature
    Python compiler: Generates C++ and Rust code from Python inference functions
    “generate equivalent C++ and Rust code”
    YouTube
    Unverified1 source· Talk
  • feature
    Python compiler: Produces a dynamic library or shared object that can be loaded into a process
    “we’ll get a dynamic library, or shared object, that we can load into a process”
    YouTube
    Unverified1 source· Talk
  • feature
    OpenAI client: Maps a model name to a compiled library path, loads the library, and returns embeddings in the client’s output format
    “we can take the model, resolve it to a path to the library, load the library, and execute it to get our embedding matrix”
    YouTube
    Unverified1 source· Talk

Related talks