· 2 min read · ← All posts
Ardan Labs Go Jupyter GoMLX AI

Field notes from working through example 33 of Ardan Labs’ Ultimate AI course by Bill Kennedy and Florin Pățan (Apache 2.0). My fork: PratikDhanave/ai-training. Thank you Bill and Florin for teaching this material — the patterns in this post are derived from the course; the production reflections at the end are mine.

What the example teaches

The capstone example. A Jupyter notebook where the kernel is Go (via GoNB) and the tensor math is GoMLX. You write Go cells, plot results, iterate in the same loop data scientists use with Python — but the production code stays in Go.

What it looks like

// inside a Jupyter cell
import (
    "github.com/gomlx/gomlx/types/tensors"
)

x := tensors.FromValue([]float32{1, 2, 3, 4})
y := tensors.FromValue([]float32{2, 4, 6, 8})

// Print, plot, compute. The cell re-runs in milliseconds.

What I learned

Two things this changed for me:

The Go-vs-Python REPL gap closes. The biggest argument for Python in ML has been “the REPL.” With GoNB, the REPL exists for Go too. Different tradeoffs (Go compiles, so cell run-times are slightly longer), but the exploratory loop works.

Tensor libraries are getting good in Go. GoMLX isn’t NumPy, but it covers enough that for the kind of work I do (analytics, classification, retrieval scoring), I don’t need to drop into Python for prototyping anymore.

Production connection

In one Searce client engagement we did exploratory work in Python notebooks then re-implemented in Go for production. The re-implementation step cost weeks per piece. After working through this example I’d structure the next engagement differently — start in a Go notebook, and the production-readiness gap shrinks dramatically.


Credit & reference. This post is field notes on example 33 from Ardan Labs’ Ultimate AI by Bill Kennedy + Florin Pățan, licensed Apache 2.0. The original example: cmd/examples/example33-jupyter-tutorial/. My fork with notes: PratikDhanave/ai-training. Highly recommend the course for anyone building AI applications in Go — the material is rigorous and the Kronk + yzma + llama.cpp pipeline gives you hardware-accelerated local inference end-to-end. Thank you, Bill and Florin.

← Back to all posts