freegate 0.6.12 → 0.6.13
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 +14 -14
- package/README.ru.md +13 -13
- package/bin/freegate.js +15 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Freegate
|
|
2
2
|
|
|
3
|
-
[](https://github.com/Artur21101965/freegate/actions)
|
|
4
4
|
[](https://hub.docker.com/r/nik951751/freegate)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://www.npmjs.com/package/freegate)
|
|
7
|
+
[](https://github.com/Artur21101965/freegate)
|
|
8
8
|
|
|
9
9
|
**[Русская версия](README.ru.md) · Russian version**
|
|
10
10
|
|
|
@@ -39,9 +39,9 @@ never see "rate limit", and you never pay.
|
|
|
39
39
|
## Quick start — 30 seconds
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
|
-
npx
|
|
43
|
-
npx
|
|
44
|
-
npx
|
|
42
|
+
npx freegate init -i # wizard: password + each provider's key
|
|
43
|
+
npx freegate start # proxy on http://localhost:4000
|
|
44
|
+
npx freegate test # verify everything works
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
Dashboard: `http://localhost:4000/?key=your_password`
|
|
@@ -49,7 +49,7 @@ Dashboard: `http://localhost:4000/?key=your_password`
|
|
|
49
49
|
Or via Docker:
|
|
50
50
|
|
|
51
51
|
```bash
|
|
52
|
-
docker run -d --name
|
|
52
|
+
docker run -d --name freegate -p 4000:4000 \
|
|
53
53
|
-e PROVIDER_GROQ_APIKEY=... \
|
|
54
54
|
-e PROVIDER_MISTRAL_APIKEY=... \
|
|
55
55
|
-e AUTH=your-secret-key \
|
|
@@ -146,13 +146,13 @@ put it in `config.json` → `providers` (same format as `providers.json`).
|
|
|
146
146
|
## CLI commands
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
|
-
npx
|
|
150
|
-
npx
|
|
151
|
-
npx
|
|
152
|
-
npx
|
|
153
|
-
npx
|
|
154
|
-
npx
|
|
155
|
-
npx
|
|
149
|
+
npx freegate init # create config
|
|
150
|
+
npx freegate init -i # interactive wizard (keys, password)
|
|
151
|
+
npx freegate start # start proxy
|
|
152
|
+
npx freegate status # diagnostics: providers, limits, errors
|
|
153
|
+
npx freegate test # verify it works
|
|
154
|
+
npx freegate install-service # autostart at boot
|
|
155
|
+
npx freegate dashboard # open dashboard
|
|
156
156
|
```
|
|
157
157
|
|
|
158
158
|
## FAQ
|
package/README.ru.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# Freegate
|
|
2
2
|
|
|
3
|
-
[](https://github.com/Artur21101965/freegate/actions)
|
|
4
4
|
[](https://hub.docker.com/r/nik951751/freegate)
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://www.npmjs.com/package/freegate)
|
|
7
7
|
|
|
8
8
|
**English version: [README.md](README.md)**
|
|
9
9
|
|
|
@@ -38,9 +38,9 @@ DeepSeek и локальные модели. Если один провайде
|
|
|
38
38
|
## Быстрый старт — 30 секунд
|
|
39
39
|
|
|
40
40
|
```bash
|
|
41
|
-
npx
|
|
42
|
-
npx
|
|
43
|
-
npx
|
|
41
|
+
npx freegate init -i # мастер спросит: пароль + ключи каждого провайдера
|
|
42
|
+
npx freegate start # прокси на http://localhost:4000
|
|
43
|
+
npx freegate test # проверить, что всё работает
|
|
44
44
|
```
|
|
45
45
|
|
|
46
46
|
Дашборд: `http://localhost:4000/?key=твой_пароль`
|
|
@@ -48,7 +48,7 @@ npx davil-cod test # проверить, что всё работает
|
|
|
48
48
|
Или через Docker:
|
|
49
49
|
|
|
50
50
|
```bash
|
|
51
|
-
docker run -d --name
|
|
51
|
+
docker run -d --name freegate -p 4000:4000 \
|
|
52
52
|
-e PROVIDER_GROQ_APIKEY=... \
|
|
53
53
|
-e PROVIDER_MISTRAL_APIKEY=... \
|
|
54
54
|
-e AUTH=your-secret-key \
|
|
@@ -145,13 +145,13 @@ PROVIDER_ZAI_APIKEY=... # ZAI
|
|
|
145
145
|
## Команды CLI
|
|
146
146
|
|
|
147
147
|
```bash
|
|
148
|
-
npx
|
|
149
|
-
npx
|
|
150
|
-
npx
|
|
151
|
-
npx
|
|
152
|
-
npx
|
|
153
|
-
npx
|
|
154
|
-
npx
|
|
148
|
+
npx freegate init # создать конфиг
|
|
149
|
+
npx freegate init -i # интерактивный мастер (ключи, пароль)
|
|
150
|
+
npx freegate start # запустить прокси
|
|
151
|
+
npx freegate status # диагностика: провайдеры, лимиты, ошибки
|
|
152
|
+
npx freegate test # проверить, что работает
|
|
153
|
+
npx freegate install-service # автозапуск при старте системы
|
|
154
|
+
npx freegate dashboard # открыть дашборд
|
|
155
155
|
```
|
|
156
156
|
|
|
157
157
|
## FAQ
|
package/bin/freegate.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// bin/
|
|
2
|
+
// bin/freegate.js — CLI wrapper + interactive setup wizard
|
|
3
3
|
const path = require('path');
|
|
4
4
|
const fs = require('fs');
|
|
5
5
|
const { spawn } = require('child_process');
|
|
@@ -74,7 +74,7 @@ async function initWizard() {
|
|
|
74
74
|
|
|
75
75
|
const filled = Object.values(keys).filter(Boolean).length;
|
|
76
76
|
console.log(`\nГотово! Провайдеров с ключами: ${filled} из ${envVars.size}`);
|
|
77
|
-
console.log(`Запуск: npx
|
|
77
|
+
console.log(`Запуск: npx freegate start (пароль: ${authKey})`);
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
function copyExample(name, example) {
|
|
@@ -95,8 +95,8 @@ if (cmd === 'init') {
|
|
|
95
95
|
// Non-interactive fallback: plain copy (safe — never overwrites)
|
|
96
96
|
copyExample('config.json', 'config.example.json');
|
|
97
97
|
copyExample('.env', '.env.example');
|
|
98
|
-
console.log('\nГотово! Заполни .env ключами, затем: npx
|
|
99
|
-
console.log('Совет: npx
|
|
98
|
+
console.log('\nГотово! Заполни .env ключами, затем: npx freegate start');
|
|
99
|
+
console.log('Совет: npx freegate init -i — интерактивный мастер с вопросами.');
|
|
100
100
|
}
|
|
101
101
|
} else if (cmd === 'start') {
|
|
102
102
|
// Spawn from the user's cwd (not package dir) so server.js picks up their
|
|
@@ -150,10 +150,10 @@ RestartSec=5
|
|
|
150
150
|
[Install]
|
|
151
151
|
WantedBy=default.target
|
|
152
152
|
`;
|
|
153
|
-
const unitPath = path.join(os.homedir(), '.config', 'systemd', 'user', '
|
|
153
|
+
const unitPath = path.join(os.homedir(), '.config', 'systemd', 'user', 'freegate.service');
|
|
154
154
|
fs.mkdirSync(path.dirname(unitPath), { recursive: true });
|
|
155
155
|
fs.writeFileSync(unitPath, unit);
|
|
156
|
-
execSync(`systemctl --user daemon-reload && systemctl --user enable
|
|
156
|
+
execSync(`systemctl --user daemon-reload && systemctl --user enable freegate && systemctl --user start freegate`);
|
|
157
157
|
console.log('✅ Служба автозапуска установлена (systemd)');
|
|
158
158
|
}
|
|
159
159
|
} else if (cmd === 'dashboard') {
|
|
@@ -174,7 +174,7 @@ WantedBy=default.target
|
|
|
174
174
|
});
|
|
175
175
|
}).on('error', (err) => {
|
|
176
176
|
console.log('❌ Прокси не запущен на ' + base);
|
|
177
|
-
console.log(' Запусти: npx
|
|
177
|
+
console.log(' Запусти: npx freegate start');
|
|
178
178
|
process.exit(1);
|
|
179
179
|
});
|
|
180
180
|
} else if (cmd === 'status') {
|
|
@@ -189,7 +189,7 @@ WantedBy=default.target
|
|
|
189
189
|
res.on('end', () => {
|
|
190
190
|
if (res.statusCode !== 200) {
|
|
191
191
|
console.log('❌ Прокси не отвечает (HTTP ' + res.statusCode + ')');
|
|
192
|
-
console.log(' Запусти: npx
|
|
192
|
+
console.log(' Запусти: npx freegate start');
|
|
193
193
|
process.exit(1);
|
|
194
194
|
}
|
|
195
195
|
try {
|
|
@@ -211,7 +211,7 @@ WantedBy=default.target
|
|
|
211
211
|
});
|
|
212
212
|
}).on('error', () => {
|
|
213
213
|
console.log('❌ Прокси не запущен на ' + base);
|
|
214
|
-
console.log(' Запусти: npx
|
|
214
|
+
console.log(' Запусти: npx freegate start');
|
|
215
215
|
process.exit(1);
|
|
216
216
|
});
|
|
217
217
|
} else if (cmd === 'version' || cmd === '-v' || cmd === '--version') {
|
|
@@ -220,10 +220,10 @@ WantedBy=default.target
|
|
|
220
220
|
} else {
|
|
221
221
|
console.log('Freegate — бесплатный LLM-прокси с failover');
|
|
222
222
|
console.log('Команды:');
|
|
223
|
-
console.log(' npx
|
|
224
|
-
console.log(' npx
|
|
225
|
-
console.log(' npx
|
|
226
|
-
console.log(' npx
|
|
227
|
-
console.log(' npx
|
|
228
|
-
console.log(' npx
|
|
223
|
+
console.log(' npx freegate init интерактивная настройка (ключи, пароль)');
|
|
224
|
+
console.log(' npx freegate start запустить прокси');
|
|
225
|
+
console.log(' npx freegate status диагностика: провайдеры, лимиты, ошибки');
|
|
226
|
+
console.log(' npx freegate test проверить, что прокси работает');
|
|
227
|
+
console.log(' npx freegate dashboard открыть дашборд');
|
|
228
|
+
console.log(' npx freegate install-service автозапуск при старте системы');
|
|
229
229
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "freegate",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.13",
|
|
4
4
|
"description": "Free multi-provider LLM gateway with automatic failover. One OpenAI-compatible endpoint routes to 25 free models (Groq, Mistral, Gemini, NIM, OpenRouter, ZAI, Cerebras, DeepSeek). Never pay for LLMs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|