DEDUPED Hot AI repos, turned into use cases Get 5 a day

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

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

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

Who it is forA 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 problemRunning a large open model usually needs a GPU or a cloud bill, and Claude Code expects an Anthropic-style endpoint.

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

What you need first

  • A Kaggle account with TPU access, verified under Settings (phone number, and for some accounts a Persona identity check)
  • Kaggle's free TPU quota, around 20 TPU hours a week
  • For the terminal route: Python 3.9+ and the Kaggle CLI

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 for your agent

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.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page