Explore Workers AI Models Using a Jupyter Notebook
A handy way to explore all of the models available on Workers AI is to use a Jupyter Notebook ↗.
You can download the Workers AI notebook or view the embedded notebook below.
Or you can run this on Google Colab ↗
Workers AI allows you to run machine learning models, on the Cloudflare network, from your own code – whether that be from Workers, Pages, or anywhere via REST API.
This notebook will explore the Workers AI REST API using the official Python SDK ↗.
To use the API you’ll need your Cloudflare Account ID ↗. Head to AI > Workers AI page and press the “Use REST API”. This page will let you create a new API Token and copy your Account ID.
If you want to add these values to your environment variables, you can create a new file named .env
and this notebook will read those values.
Otherwise you can just enter the values securely when prompted below.
Explore all Text Generation Models
Using keyboard shortcuts to execute cells in Jupyter Notebook can save you a lot of time and increase your productivity!
Here are some keyboard shortcuts to execute cells in Jupyter Notebook:
Mac Users:
Cmd + Enter
(⌘ + Enter) to execute a cellShift + Enter
to execute a cell and move to the next cell belowCmd + Shift + Enter
(⌘ + Shift + Enter) to execute a cell and move to the next cell below without closing the output
Windows Users:
Ctrl + Enter
to execute a cellShift + Enter
to execute a cell and move to the next cell belowCtrl + Shift + Enter
to execute a cell and move to the next cell below without closing the output
These keyboard shortcuts are Windows-compatible, so you can use them in Jupyter Notebook on your Windows machine!
You can also use the Escape
key to clear the output of a cell, and Alt + Enter
to execute a cell recursively (i.e., execute all cells below the current cell).
Remember to customize your Jupyter Notebook settings to fit your workflow and preferences!
Explore all Text to Image models
Explore all Image to Text models
Explore all Speech Recognition models
Explore all Translation models
Explore all Text Classification models
Explore all Image Classification models
Explore all Summarization based models