# AI use cases for Kaggle Tpu Lab (ARahim3/kaggle-tpu-lab)

Repo: [ARahim3/kaggle-tpu-lab](https://github.com/ARahim3/kaggle-tpu-lab) | Use cases: 5 | Page: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/

A set of notebooks and scripts that run open AI models on Kaggle's free TPU v5e-8 and expose them as a public endpoint that speaks the OpenAI and Anthropic APIs.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Run a free open model as an endpoint for Claude Code: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/free-endpoint-for-claude-code/
- Point Codex CLI at a Kaggle-hosted open model: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/wire-codex-cli-to-open-model/
- Launch a model server from the terminal: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/serve-model-from-terminal/
- Run GLM-5.3-Flash on a rented Google Cloud TPU VM: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/run-glm-on-google-cloud-tpu-vm/
- Add a new model recipe to the repo: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/add-a-model-recipe/

## How to run a free open model as an endpoint for Claude Code with Kaggle Tpu Lab

Repo: [ARahim3/kaggle-tpu-lab](https://github.com/ARahim3/kaggle-tpu-lab) | Difficulty: Beginner | Time: 30 minutes | Basis: From the README

Start a Kaggle notebook, copy the public URL and key, and point Claude Code at an open model.

**Who it is for:** A developer who wants to use Claude Code with an open model instead of a paid cloud API, and has a Kaggle account with TPU access.

**The problem:** Running a large open model usually needs a GPU or a cloud bill, and Claude Code expects an Anthropic-style endpoint.

**The outcome:** Claude Code answers from an open model served from a Kaggle TPU at a public URL that speaks the Anthropic API.

### Steps

1. Open the Qwen3.8-27B or GLM-5.3-Flash notebook linked in the model table of the README and click Run all.
2. Wait for the last cell to print the public URL and an API key, then leave that cell running.
3. Set the variables from the README in your shell: `ANTHROPIC_BASE_URL=<url> ANTHROPIC_AUTH_TOKEN=<key> ANTHROPIC_MODEL=<model>` followed by `claude`. (inferred, check the README)
4. Send a short test prompt in Claude Code and confirm a reply comes back from the endpoint.
5. When the session ends (a little under nine hours), run the notebook again to get a new URL and key.

### Prompt to paste into your agent

```text
In the ARahim3/kaggle-tpu-lab repo, open the Qwen3.8-27B notebook from the model table, run it on Kaggle, and copy the printed URL and API key into ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, with ANTHROPIC_MODEL set to <model>. Expected output: a Claude Code reply to a test prompt from the open model. Verify that the endpoint answers before reporting success.
```

### Caveat

The endpoint lasts only until the Kaggle session limit, a little under nine hours, so you must restart the notebook to get a new URL.

Risk, credentials: The printed API key controls access to the public endpoint, so do not share it or commit it to a repo.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/free-endpoint-for-claude-code/

## How to point Codex CLI at a Kaggle-hosted open model with Kaggle Tpu Lab

Repo: [ARahim3/kaggle-tpu-lab](https://github.com/ARahim3/kaggle-tpu-lab) | Difficulty: Beginner | Time: 30 minutes | Basis: From the README

Use the public endpoint from a Kaggle TPU session as the backend for Codex CLI.

**Who it is for:** A developer who uses Codex CLI and wants to try an open model on their own code without a GPU.

**The problem:** Codex CLI needs an OpenAI-style endpoint, and most open models are too large to run on a laptop.

**The outcome:** Codex CLI sends requests to an open model on the Kaggle TPU and returns answers in the terminal.

### Steps

1. Run the notebook for Qwen3.8-27B or GLM-5.3-Flash from the README table on Kaggle and click Run all.
2. Copy the public URL and API key printed by the last cell.
3. Open the model folder README (for example qwen38-27b/) and copy the exact Codex CLI lines.
4. Fill in the URL and key from step 2 and start Codex CLI.
5. Ask Codex CLI a small coding question and check that the answer comes from the endpoint.

### Prompt to paste into your agent

```text
In the ARahim3/kaggle-tpu-lab repo, read the Codex CLI lines in the <model> folder README, run that model's notebook on Kaggle, and configure Codex CLI with the printed URL and API key. Expected output: a Codex CLI answer to a test question served from the TPU. Verify the request reaches the Kaggle endpoint, not a default provider.
```

### Caveat

The exact Codex CLI configuration lives in each model folder README, so follow the folder for the model you chose.

Risk, credentials: The printed API key grants access to the public endpoint, so keep it out of shared config files.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/wire-codex-cli-to-open-model/

## How to launch a model server from the terminal with Kaggle Tpu Lab

Repo: [ARahim3/kaggle-tpu-lab](https://github.com/ARahim3/kaggle-tpu-lab) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Clone the repo and start the Qwen3.8-27B serve recipe from your command line.

**Who it is for:** A developer comfortable with the command line who wants to start and stop model sessions without opening the Kaggle web UI.

**The problem:** Opening notebooks by hand for each session is slow and hard to repeat.

**The outcome:** A Kaggle TPU session starts from one command, and you can check or stop it from the terminal.

### Steps

1. Install Python 3.9+ and the Kaggle CLI, and make sure your Kaggle account has an API token configured. (inferred, check the README)
2. `git clone https://github.com/ARahim3/kaggle-tpu-lab`
3. `cd kaggle-tpu-lab`
4. `python launch.py serve`
5. Run `python launch.py status` to follow progress, and `python launch.py stop` when you are done. (inferred, check the README)

### Prompt to paste into your agent

```text
Clone ARahim3/kaggle-tpu-lab, run `python launch.py serve` to start the default model, and use `python launch.py status` until the server reports ready. Expected output: a running Kaggle TPU session with a public URL. Verify the status output shows the session active before handing the URL to <target>.
```

### Caveat

The README says launch.py serves Qwen3.8-27B today, and other models need a recipe added later through --model.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/serve-model-from-terminal/

## How to run GLM-5.3-Flash on a rented Google Cloud TPU VM with Kaggle Tpu Lab

Repo: [ARahim3/kaggle-tpu-lab](https://github.com/ARahim3/kaggle-tpu-lab) | Difficulty: Advanced | Time: 90 minutes | Basis: From the README

Use the gcp/ guide and scripts to serve GLM-5.3-Flash without the Kaggle queue or time cap.

**Who it is for:** A team or developer who needs GLM-5.3-Flash running on demand and can rent a Google Cloud TPU VM.

**The problem:** Kaggle sessions are capped at a little under nine hours and depend on a free quota, which is not always enough.

**The outcome:** GLM-5.3-Flash runs on a Google Cloud TPU VM with no queue and no nine-hour cap, using the repo's environment, dataset and run scripts.

### Steps

1. Confirm you have access to a Google Cloud TPU VM of type v5litepod-8 or v6e-8.
2. `git clone https://github.com/ARahim3/kaggle-tpu-lab`
3. `cd kaggle-tpu-lab/gcp` (inferred, check the README)
4. Follow the guide in gcp/ and run the environment script, then the datasets script.
5. Run the run script from gcp/ and wait for the server to start.

### Prompt to paste into your agent

```text
In the ARahim3/kaggle-tpu-lab repo, follow the gcp/ guide to set up a v5litepod-8 or v6e-8 TPU VM, run the environment, datasets and run scripts, and serve GLM-5.3-Flash. Expected output: a running server on the TPU VM. Verify the server responds to one test request before reporting success.
```

### Caveat

The README does not give rental prices, so check current Google Cloud TPU VM costs before starting.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/run-glm-on-google-cloud-tpu-vm/

## How to add a new model recipe to the repo with Kaggle Tpu Lab

Repo: [ARahim3/kaggle-tpu-lab](https://github.com/ARahim3/kaggle-tpu-lab) | Difficulty: Advanced | Time: 120 minutes | Basis: From the README

Create a model folder with a README, kernel script and notebook following the repo's layout.

**Who it is for:** A developer who wants to serve a different open model on Kaggle TPU and share the recipe in the same format.

**The problem:** Each new model needs its own serving script, notebook and config, and it is easy to make them disagree.

**The outcome:** A new top-level model folder with README, kernel/, and notebook/ that the launcher and notebook can both use.

### Steps

1. Read the Adding a model section of the README and the folder READMEs for Qwen3.8-27B and GLM-5.3-Flash.
2. Create one top-level folder named after the model, with a README.md that states the numbers and how they were measured.
3. Add a kernel/ folder with the serving script, and any patch or engine the recipe needs.
4. Add a notebook/ folder with a run-all notebook generated from the kernel script.
5. Keep the launcher and notebook on the same config block so one setting means the same thing in both.

### Prompt to paste into your agent

```text
In the ARahim3/kaggle-tpu-lab repo, add a new top-level folder for <model> with README.md, kernel/ and notebook/ following the Adding a model section and the existing folders. Expected output: a new folder whose notebook runs on Kaggle TPU and serves the model. Verify the config block matches between the launcher and the notebook.
```

### Caveat

The README says model weights keep their own licenses, so check the license of any new model before publishing a recipe.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/arahim3-kaggle-tpu-lab/add-a-model-recipe/
