Bailey 的 AI 折腾笔记
中文 · English · Deutsch · 한국어 · 日本語
LLMs2026-12-029 min readLi

Install free model routing on Pi: FreeToken-Bots + OpenRouter free layer actual test

PiFreeToken-BotsOpenRouterfree model
Contents

Install free model routing on Pi

The goal: Let the coding agent in the terminal also be "whoring for free" - not paying for the API, but using each company's free quota to work. The final solution is Pi + FreeToken-Bots: the latter runs a local route that only accepts free models, and the former can be switched on top. This article will record the configuration process and two real pitfalls.

Components

  • Pi: coding agent in the terminal, the version I installed is 1.7.0
  • FreeToken-Bots (command called ftb): from min-skill, an open source tutorial repository. It sets up a model route on the local machine, listens to the 8787 port of the local loopback address, only includes free models, and automatically failsover between multiple free quotas - if one is restricted, it will automatically switch to the next one.
  • OpenRouter free tier: One of the quota sources connected this time, the free model has about 50 requests/day

Why route this layer? Because the free quota of a single company is not used up, it takes two days to write code for 50 requests. By aggregating the free quotas of multiple companies into one entrance and using them in turn, we can come up with an amount that can be used daily.

Configuration

1. Fill in the key into the local configuration of ftb

Fill in the key of OpenRouter into ftb in the keys.env configuration file of the local machine. That's it for this step, nothing else: the key only lies in the local file, without any third-party services, and the routing is also a local process. This makes me feel more confident about filling it in.

2. Add a provider to Pi

Add a provider named freetoken to Pi's models.json, pointing to the local routing, and select auto as the model - which free model to use is left to the routing to select and switch, Pi does not need to worry about it.

3. End-to-end verification

Direct actual test after configuration: Let Pi answer a test question using the free model. The answer is correct and the link is connected. It doesn't count if "the configuration file is finished". Only if it can really answer something can it mean that the key, route and provider are all correct.

Trampling on pit records

Pit 1: The routing model directory will "expire". There is a hard rule for ftb's router: it will refuse to work if the model directory is older than 24 hours. In other words, the directory you scanned yesterday will not be recognized today. The solution is to hang up a scheduled task: automatically run ftb scan once every day at 08:00 to refresh the directory and check the routing process. If it hangs, it will automatically restart. The result of a certain scan is: a total of 25 free models, 12 of which can be actually called by the router - there are more that can be seen than can be used. This is also the norm in the free ecosystem, so be aware of it first.

Pit 2: The non-interactive mode of Pi will be hung by stdin. When using the -p parameter to make Pi run non-interactively (for example, calling it in a script), if stdin is not closed, it will hang there waiting for input without reporting an error or exiting. The first time I encountered it, I thought it was the model thinking. The solution is very simple: redirect stdin to /dev/null when running, and it will be smooth immediately.

Summary

  • This combination is established: Pi + ftb routing + OpenRouter free tier, zero cost, end-to-end actual test can work
  • The real bottleneck is the quota: the free tier of OpenRouter is about 50 times/day. Route aggregation can dilute the pressure, but the total amount is still limited. You must have the "daily quota" in mind.
  • Both pitfalls belong to the type of "if you don't write it down, you will step on it next time": the directory is scanned once a day and relied on scheduled tasks, and the problem of stdin is solved by redirection.
  • Positioning: The daily lightweight coding assistant is completely sufficient - ask for a function, modify a script, and write some sample code; if you really want to run long tasks or do batch work, you still have to use it sparingly or pay honestly.

The essence of the free quota method is to find out the rules of each company and do a solid job in automatic maintenance. The rest is to not be greedy.

Views 0 次

Comments

加载中…

Comments appear after review.

← Back to Home