@wwkit/freetoken

Free LLM API token manager — speed test, proxy, and web dashboard (Vue 3 + Express)
1,836
Install
npm install @wwkit/freetoken
Latest Version:1.0.12
Vue:3
License:MIT
Last Updated:Oct 19, 2026
Links: npm
Maintainer: langcai

@wwkit/freetoken

Free LLM API token 管理工具,前后端分离 Web 架构。监控和管理免费 LLM API tokens,提供测速和代理功能。

快速开始

# 从 monorepo 根目录(自动检测模式 + 打开浏览器)
pnpm --filter freetoken start

# 或直接 CLI
freetoken web              # 启动 + 打开浏览器
freetoken web --dev        # 强制开发模式(Vite + server)
freetoken web stop         # 停止
freetoken web restart      # 重启 + 打开浏览器
  • 前端:http://localhost:7905(Vite,自动代理 /api 到后端)
  • 后端:http://localhost:5905(Express + SQLite)

命令列表

命令 说明
web [start] [--dev|--prod] 启动服务并打开浏览器(start 可省略)
web stop 停止所有服务
web restart [--dev|--prod] 重启服务并打开浏览器
status 查看服务状态
speed-test 手动执行测速
config 查看当前配置
help / -h / --help 显示帮助

完整命令说明见 cli.md

配置

配置文件:~/.config/freetoken/config.json5(JSON5 格式,首次安装自动生成)

{
  server: { port: 5905 },
  client: { port: 7905 },
  speedTest: { cron: '0 9 * * *', runOnStart: true },
  web: { openBrowser: true },
}
  • 内置默认:src/config.json5
  • 用户配置:~/.config/freetoken/config.json5(深合并覆盖内置)
  • 环境注入:FREETOKEN_CONFIG_CONTENT(JSON5 字符串,优先级最高)
  • 目录覆盖:FREETOKEN_CONFIG_DIR
  • API Keys:通过 server/.env(dotenv),不写入 config

工程结构

packages/freetoken/
├── package.json          # @wwkit/freetoken monorepo 配置
├── src/                   # 配置层(config.json5 + config.js)
├── bin/                   # CLI 入口(web start/stop/restart/speed-test/config)
├── scripts/               # postinstall + 打包脚本
├── client/               # 前端 Vue 3 + Vite + Element Plus
│   ├── vite.config.js    # Vite 配置 + API 代理到 :5905
│   └── src/
├── server/               # 后端 Express + sql.js (SQLite)
│   ├── src/
│   │   ├── index.js      # Express 入口
│   │   ├── config/       # 测速目标配置
│   │   ├── lib/          # 测速引擎、调度器、数据库
│   │   └── routes/       # API 路由(proxy/speed/admin)
│   └── .env.example
└── tests/                # jest 单元测试

构建

pnpm --filter freetoken build   # 构建前端到 client/dist
freetoken web --prod            # 生产模式启动

测试

pnpm --filter freetoken run ut

技术栈

层 选型
后端 Express + sql.js (SQLite) + node-cron
前端 Vue 3 + Vue Router + Pinia + Element Plus
构建 Vite
配置 @wwkit/shared createConfigLoader (JSON5)
项目管理 pnpm workspaces (@wwkit)

Related Packages

vue-cli-plugin-express

vue-cli 3 plugin to add an Express Api

2,559 50
ai-model-form

Vue 3 AI model configuration form component backed by a Node.js Express middlewa...

4,640 0
rest-resource

Simplify your REST API resources

5,001 44
express-intlayer

Manage internationalization i18n in a simple way for express application.

2,028,836 856
@amritk/api

Framework-agnostic, contract-first API layer built on mjst JSON Schema tooling....

53,592 0

Version History

Version Released License
1.0.12 MIT
1.0.11 MIT
1.0.10 MIT
1.0.9 MIT
1.0.8 MIT