freiheit 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/README.zh-CN.md +18 -3
- package/dist/cli.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{server-A5ihtQsE.mjs → server-BBI7iyfz.mjs} +9 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="static/banner.png" style="width: 1000px;"/>
|
|
3
|
+
<h1>freiheit</h1>
|
|
4
|
+
<p>Set large models free</p>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
8
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
2
9
|
|
|
3
10
|
English | [中文](README.zh-CN.md)
|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
A CLI for free model endpoints, inspired by [dsh-our-free-model](https://github.com/Ebony-Vinyl/dsh-our-free-model).
|
|
6
13
|
|
|
7
14
|
An OpenAI / Anthropic compatible HTTP gateway that aggregates **free** model sources:
|
|
8
15
|
|
|
@@ -20,7 +27,7 @@ npx freiheit --help
|
|
|
20
27
|
npx freiheit models
|
|
21
28
|
|
|
22
29
|
# Start the endpoint on the local network
|
|
23
|
-
npx freiheit
|
|
30
|
+
npx freiheit --host 0.0.0.0
|
|
24
31
|
```
|
|
25
32
|
|
|
26
33
|
## Endpoints
|
|
@@ -40,3 +47,10 @@ Install Bun: https://bun.sh
|
|
|
40
47
|
|
|
41
48
|
- Some OpenCode free model ids are region-sensitive (beam/crouton/pulse/muse-spark).
|
|
42
49
|
- Free quota is pooled per egress IP and rate-limited; heavy use may trigger `FreeUsageLimitError`.
|
|
50
|
+
- Local state (session map, Bun worker) is written to `~/.freiheit`; override with `FREIHEIT_HOME`.
|
|
51
|
+
|
|
52
|
+
<!-- Badges -->
|
|
53
|
+
[npm-version-src]: https://img.shields.io/npm/v/freiheit?style=flat&colorA=080f12&colorB=1fa669
|
|
54
|
+
[npm-version-href]: https://npmjs.com/package/freiheit
|
|
55
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/freiheit?style=flat&colorA=080f12&colorB=1fa669
|
|
56
|
+
[npm-downloads-href]: https://npmjs.com/package/freiheit
|
package/README.zh-CN.md
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<img src="static/banner.png" style="width: 1000px;"/>
|
|
3
|
+
<h1>freiheit</h1>
|
|
4
|
+
<p>实现大模型自由</p>
|
|
5
|
+
</div>
|
|
6
|
+
|
|
7
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
8
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
2
9
|
|
|
3
10
|
[English](README.md) | 中文
|
|
4
11
|
|
|
5
|
-
|
|
12
|
+
免费模型端点 CLI,灵感来自 [dsh-our-free-model](https://github.com/Ebony-Vinyl/dsh-our-free-model)。
|
|
6
13
|
|
|
7
14
|
兼容 OpenAI / Anthropic 的 HTTP 网关,聚合**免费**模型来源:
|
|
8
15
|
|
|
@@ -39,4 +46,12 @@ OpenCode 推理通过基于 Bun 的传输层路由(上游 `egressFetch` 将 op
|
|
|
39
46
|
## 说明
|
|
40
47
|
|
|
41
48
|
- 部分 OpenCode 免费模型的 id 存在地区敏感性(beam/crouton/pulse/muse-spark)。
|
|
42
|
-
- 免费额度是按出口 IP 池化并限制配额的;大量使用可能触发 `FreeUsageLimitError`。
|
|
49
|
+
- 免费额度是按出口 IP 池化并限制配额的;大量使用可能触发 `FreeUsageLimitError`。
|
|
50
|
+
- 本地状态(会话映射、Bun worker)写入 `~/.freiheit`;可通过 `FREIHEIT_HOME` 覆盖。
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
<!-- Badges -->
|
|
54
|
+
[npm-version-src]: https://img.shields.io/npm/v/freiheit?style=flat&colorA=080f12&colorB=1fa669
|
|
55
|
+
[npm-version-href]: https://npmjs.com/package/freiheit
|
|
56
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/freiheit?style=flat&colorA=080f12&colorB=1fa669
|
|
57
|
+
[npm-downloads-href]: https://npmjs.com/package/freiheit
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { i as package_default, n as startServer, r as toPublicModels, t as listAllModels } from "./server-
|
|
2
|
+
import { i as package_default, n as startServer, r as toPublicModels, t as listAllModels } from "./server-BBI7iyfz.mjs";
|
|
3
3
|
import process from "node:process";
|
|
4
4
|
import { cac } from "cac";
|
|
5
5
|
|
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import { lookup } from "node:dns/promises";
|
|
|
13
13
|
// package.json
|
|
14
14
|
var package_default = {
|
|
15
15
|
name: "freiheit",
|
|
16
|
-
version: "0.1.
|
|
16
|
+
version: "0.1.1",
|
|
17
17
|
type: "module",
|
|
18
18
|
description: "OpenAI/Anthropic compatible CLI aggregating free model sources (OpenCode Zen + Kilo).",
|
|
19
19
|
author: "Vincent-the-gamer",
|
|
@@ -46,9 +46,9 @@ var package_default = {
|
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
48
|
sideEffects: false,
|
|
49
|
-
dependencies: { "cac": "^7.1.
|
|
49
|
+
dependencies: { "cac": "^7.1.1" },
|
|
50
50
|
devDependencies: {
|
|
51
|
-
"@types/node": "^26.6.
|
|
51
|
+
"@types/node": "^26.6.11",
|
|
52
52
|
"taze": "^21.3.0",
|
|
53
53
|
"tsdown": "^0.23.7",
|
|
54
54
|
"tsx": "^4.23.15",
|
|
@@ -611,13 +611,12 @@ function createAnthropicStreamTranslator(options) {
|
|
|
611
611
|
}
|
|
612
612
|
|
|
613
613
|
// src/vendor/opencode/store.js
|
|
614
|
-
/**
|
|
615
|
-
function
|
|
616
|
-
const fromEnv = process.env.
|
|
614
|
+
/** freiheit's own state home: `$FREIHEIT_HOME` else `~/.freiheit`. */
|
|
615
|
+
function resolveFreiheitHome() {
|
|
616
|
+
const fromEnv = process.env.FREIHEIT_HOME;
|
|
617
617
|
if (typeof fromEnv === "string" && fromEnv.trim() !== "") return fromEnv.trim();
|
|
618
|
-
return path.join(os.homedir(), ".
|
|
618
|
+
return path.join(os.homedir(), ".freiheit");
|
|
619
619
|
}
|
|
620
|
-
const DATA_DIR_NAME = "our-free-model";
|
|
621
620
|
|
|
622
621
|
// src/vendor/opencode/o2a.js
|
|
623
622
|
var V2_CLIENT_VERSION = "2.2.3";
|
|
@@ -1278,7 +1277,7 @@ const SESSION_MAP_FILE = "session-map.json";
|
|
|
1278
1277
|
let sessions;
|
|
1279
1278
|
function sessionStorePath() {
|
|
1280
1279
|
try {
|
|
1281
|
-
return path.join(path.resolve(
|
|
1280
|
+
return path.join(path.resolve(resolveFreiheitHome()), SESSION_MAP_FILE);
|
|
1282
1281
|
} catch {
|
|
1283
1282
|
return;
|
|
1284
1283
|
}
|
|
@@ -1597,7 +1596,7 @@ let workerPath;
|
|
|
1597
1596
|
function bunWorkerPath() {
|
|
1598
1597
|
if (workerPath !== void 0 && existsSync(workerPath)) return workerPath;
|
|
1599
1598
|
try {
|
|
1600
|
-
const dir = join(
|
|
1599
|
+
const dir = join(resolveFreiheitHome(), "run");
|
|
1601
1600
|
mkdirSync(dir, { recursive: true });
|
|
1602
1601
|
const file = join(dir, "worker.mjs");
|
|
1603
1602
|
writeFileSync(file, WORKER_SOURCE, { mode: 384 });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "freiheit",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "OpenAI/Anthropic compatible CLI aggregating free model sources (OpenCode Zen + Kilo).",
|
|
6
6
|
"author": "Vincent-the-gamer",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
},
|
|
43
43
|
"sideEffects": false,
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"cac": "^7.1.
|
|
45
|
+
"cac": "^7.1.1"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@types/node": "^26.6.
|
|
48
|
+
"@types/node": "^26.6.11",
|
|
49
49
|
"taze": "^21.3.0",
|
|
50
50
|
"tsdown": "^0.23.7",
|
|
51
51
|
"tsx": "^4.23.15",
|