I’ve submitted a Flink Improvement Proposal (FLIP) about adding support for Flink to be able to fetch remote jars for applications submitted to a session cluster.
Archive for the ‘code’ Category
Adding support for remote jar fetching in Flink session clusters
Sunday, August 23rd, 2026Why we can’t have nice things
Sunday, August 9th, 2026Looking at the server request logs for Machine Learning for Kids is a depressing reminder of what it means to run something on the Internet nowadays.
I was skimming through the request logs for the Machine Learning for Kids servers yesterday [1], and what jumped out at me was the constant rate of requests to non-existent paths that I just generate HTTP 404 responses for.

These aren’t someone accidentally mistyping a URL.
I grepped an excerpt from the log for requests that got an HTTP-404 response and put the result in a gist.
Running Flink jobs in MiniCluster using the Kubernetes Operator
Wednesday, August 5th, 2026I’ve submitted a Flink Improvement Proposal (FLIP) about adding support for the Flink Kubernetes Operator to run Flink’s MiniCluster in a single pod for low-throughput jobs that require isolation.
In the last few weeks, I’ve been working on a proof-of-concept to demonstrate the feasibility of this idea. I’ve done enough to convince myself that this is viable and identify where the issues will be, but I’m looking for community feedback before I take it much further.
Background
The Flink Kubernetes Operator is one of the best ways to run Flink jobs. From the documentation:
Flink deployments are declared like any other Kubernetes workload, and the operator runs their whole operational life:
- Lifecycle Management: deployment, stateful upgrades, rollbacks, and self-healing
- Zero-Downtime Upgrades: blue/green deployments that switch over only once the new version is proven healthy
- Autoscaling: parallelism and memory continuously right-sized to the observed load
- Kubernetes-Native Operations: Helm installation, RBAC, high availability, metrics, logging, and ingress
You create a FlinkDeployment Kubernetes custom resource that points to your Flink application, and the Operator handles provisioning independently schedulable and independently configurable Job Manager Deployment and Task Manager Deployment, configuring them to form a distributed Flink cluster.
This provides scalability and high availability, and is the right approach in a lot of situations. However, this comes at the cost of a fixed baseline cost of at least one JobManager pod and one or more TaskManager pods.
A smaller, lighter-weight alternative would be useful for small or intermittent jobs, where the minimum resource cost of two separately-scheduled pods is disproportionate to the job itself.
A single-pod, self-contained Flink job that starts fast and needs no multi-pod coordination could be a good fit for low-throughput jobs that aren’t suitable for session clusters because they need isolation.
Generative AI with tool calling in Scratch
Friday, July 10th, 2026In this post, I want to share a new feature in the generative AI support in Machine Learning for Kids: tool calling.
I wrote last year about how I introduced Generative AI in Machine Learning for Kids by adding support for projects using small language models. And earlier this year, I walked through my six favourite projects for explaining different aspects of Gen AI.
This week I’ve been working on extending the language model support in the site, by adding a new model that is capable of tool calling.
demo video at youtu.be/HdcTseNvjhU
Why is tool calling useful?
Try asking a model what the weather is like in New York right now.
If the temperature and top-p is high enough, many of the models will likely hallucinate an answer.

If the temperature and top-p is low enough, the models can just respond that they cannot answer that.

(If you don’t know why “temperature” makes that difference, I’ve written about that before and have a student worksheet that focuses on this.)
This second answer is more accurate at least, but it is still not helpful. The point is, if you ask the model for something that can’t possibly be represented in the knowledge used to create it, the model cannot give a helpful answer by itself.
Tool calling helps in these situations by making tools available to the model. It can call these tools to help respond to prompts that can’t be answered by the model alone.
iTunes extension for Scratch
Tuesday, June 9th, 2026In this post, I want to share a new Scratch extension I made today.

It uses the iTunes Search API to let you search for songs, and play 30 second previews of them, in your Scratch projects.
The blocks are simple, and hopefully self-explanatory, but here is a short demo of them in action if it’s not obvious.
I’ve added this extension to the version of Scratch I host for Machine Learning for Kids, so you’ll need to go there to try it out. (To access the extensions library, click on the extensions button in the bottom left.)
Embedding Tiny Language Models in Flink SQL
Wednesday, May 20th, 2026I gave a talk at Current yesterday about how to embed a tiny language model inside your Flink SQL pipeline.
I used a fun mix of demos to show what I think are the main approaches available for using generative AI with Kafka events from a Flink SQL job. Some demos were definitely more sensible than others!
These are the slides I used, and what I’d planned to say.
In this session, I’ll be talking about your options for running language models for Flink SQL jobs.
I’ll cover:
- your options for where you run them, in relation to Flink
- what sorts of choices you have for the models you run
- how to use them – the sorts of prompts and settings we’d want for Flink
- how to keep an eye on it that it’s working well
- and finally, some thoughts on when it’s a good idea to do any of this
Instrumenting a Kafka Connect connector with metrics
Saturday, May 2nd, 2026Metrics can help provide operational insight over Kafka Connect connectors, informing users of how to better configure them. With simple updates, a Kafka Connect connector can be instrumented to make this possible by emitting useful metrics.
A couple years ago, I created a simple skeleton Connect connector project to help developers at a hackathon create their first Kafka connector.
I’ve updated the source connector from that sample to emit metrics. In this post, I’ll walk through what I did, as an example for how to add metrics to your own Kafka connector.
How to create a Scratch extension
Monday, April 27th, 2026A few years ago, I ran a workshop about how to create custom Scratch blocks.

I made a template repository, based on the Scratch Team repos, but with a skeleton extension and some extra scripts and automation to handle building and publishing it. I included step-by-step instructions for building different types of Scratch extensions, including Scratch blocks based on web APIs, and Scratch blocks based on JavaScript modules from npm.