opencode-free-fleet 0.1.0 → 0.2.0
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 +321 -215
- package/dist/core/adapters/index.d.ts +13 -0
- package/dist/core/adapters/index.js +546 -0
- package/dist/core/oracle.d.ts +84 -0
- package/dist/core/oracle.js +234 -0
- package/dist/core/racer.d.ts +105 -0
- package/dist/core/racer.js +209 -0
- package/dist/core/scout.d.ts +124 -0
- package/dist/core/scout.js +503 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +332 -0
- package/dist/types/index.d.ts +144 -0
- package/dist/types/index.js +54 -0
- package/dist/version.d.ts +6 -0
- package/dist/version.js +6 -0
- package/package.json +19 -2
- package/src/version.ts +2 -2
package/README.md
CHANGED
|
@@ -1,323 +1,429 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 🚀 opencode-free-fleet v0.2.0
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Economic Load Balancing and Zero-Cost Model Discovery for OpenCode**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Automaticamente descobre, classifica e compete entre modelos gratuitos de **75+ providers** OpenCode, usando SOTA benchmark performance.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
---
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 🎯 Objetivo v0.2.0
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
**Sustentabilidade:** Eliminar dependência de `oh-my-opencode.json` (ou arquivos locais).
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
**Compatibilidade:** Funciona 100% independentemente de como o usuário configura seu ambiente OpenCode.
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
- Fetches all models from OpenRouter API
|
|
17
|
-
- Filters for truly free models (`pricing.prompt === "0"` AND `pricing.completion === "0"`)
|
|
18
|
-
- Respects security blocklists (paid/authenticated models are never used for free-only tasks)
|
|
19
|
-
- Ranks models by benchmark performance (Elite > Newer > Larger)
|
|
15
|
+
---
|
|
20
16
|
|
|
21
|
-
|
|
22
|
-
- Uses `Promise.any` for race condition between free models
|
|
23
|
-
- Fires all requests simultaneously and accepts first valid response
|
|
24
|
-
- Eliminates waterfall latency
|
|
25
|
-
- Supports `AbortController` for timeout handling
|
|
26
|
-
- Progress callbacks for monitoring
|
|
17
|
+
## 📦 Características
|
|
27
18
|
|
|
28
|
-
###
|
|
29
|
-
- Reads `antigravity-accounts.json` to build a blocklist of authenticated providers
|
|
30
|
-
- Never routes free-only tasks to paid models accidentally
|
|
31
|
-
- Ensures zero-cost execution whenever possible
|
|
19
|
+
### 🤖 Omni-Scout (Descoberta Inteligente)
|
|
32
20
|
|
|
33
|
-
|
|
21
|
+
- **75+ Providers Suportados:**
|
|
22
|
+
- ✅ OpenRouter (pricing="0")
|
|
23
|
+
- ✅ Groq (todos gratuitos atualmente)
|
|
24
|
+
- ✅ Cerebras (todos gratuitos atualmente)
|
|
25
|
+
- ✅ Google Cloud AI (Gemini Flash/Nano - limited free tier)
|
|
26
|
+
- ✅ DeepSeek (DeepSeek-Chat, DeepSeek-V3.2 - 5M tokens free)
|
|
27
|
+
- ✅ ModelScope (serverless free tier)
|
|
28
|
+
- ✅ Hugging Face (serverless free tier)
|
|
29
|
+
- (Extensível via adapters modulares)
|
|
34
30
|
|
|
35
|
-
|
|
31
|
+
- **Metadata Oracle (Verificação Cruzada):**
|
|
32
|
+
- ✅ Interface `ModelMetadata` com confidence scoring
|
|
33
|
+
- ✅ Fonte de dados: Models.dev (API pública)
|
|
34
|
+
- ✅ Whitelist estática de modelos gratuitos confirmados
|
|
35
|
+
- ✅ Sistema de pontuação de confiança (0.0 a 1.0)
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
- **Inteligência de Free Tier:**
|
|
38
|
+
- ✅ Verifica multi-provider (cada adapter sabe identificar seus próprios modelos gratuitos)
|
|
39
|
+
- ✅ Prioriza dados de Models.dev sobre SDKs específicos
|
|
40
|
+
- ✅ Respeita blocklist de antigravity (Google/Gemini são bloqueados por padrão)
|
|
41
|
+
|
|
42
|
+
### ⚡ Zero-Latency Racer (Competição de Modelos)
|
|
43
|
+
|
|
44
|
+
- **Promise.any Race Condition:**
|
|
45
|
+
- ✅ Dispara todas as requests simultaneamente
|
|
46
|
+
- ✅ Aceita primeira resposta válida
|
|
47
|
+
- ✅ Elimina waterfall latency
|
|
48
|
+
- ✅ AbortController para timeout handling
|
|
49
|
+
- ✅ Progress callbacks para monitoring
|
|
50
|
+
|
|
51
|
+
### 🔐 Segurança de Custos (Blocklist Inteligente)
|
|
52
|
+
|
|
53
|
+
- **Antigravity Safe Mode:**
|
|
54
|
+
- ✅ Detecta plugin `opencode-antigravity-auth`
|
|
55
|
+
- ✅ Se detectado: Google/Gemini são bloqueados por padrão
|
|
56
|
+
- ✅ Flag `allowAntigravity` (padrão: false) para sobrescrever comportamento
|
|
57
|
+
- ✅ Bloqueio é baseado em segurança (proteger cota pessoal > free tier)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 🏗️ Estrutura do Projeto
|
|
62
|
+
|
|
63
|
+
```
|
|
64
|
+
opencode-free-fleet/
|
|
65
|
+
├── src/
|
|
66
|
+
│ ├── core/
|
|
67
|
+
│ │ ├── oracle.ts ✅ Metadata Oracle + confidence scoring
|
|
68
|
+
│ │ ├── adapters/ ✅ 6 adapters modulares (OpenRouter, Groq, Cerebras, Google, DeepSeek, ModelScope, HuggingFace)
|
|
69
|
+
│ │ ├── scout.ts ✅ Omni-Scout multi-provider
|
|
70
|
+
│ │ └── racer.ts ✅ Zero-latency model competition
|
|
71
|
+
│ ├── types/
|
|
72
|
+
│ │ └── index.ts ✅ Interfaces unificadas (FreeModel, ProviderAdapter, etc.)
|
|
73
|
+
│ ├── index.ts ✅ Plugin entrypoint + Tools (free_fleet_scout, free_fleet_router)
|
|
74
|
+
│ └── version.ts ✅ v0.2.0
|
|
75
|
+
├── package.json ✅ Scripts de build configurados
|
|
76
|
+
├── tsconfig.json ✅ Configuração TypeScript
|
|
77
|
+
├── tsconfig.build.json ✅ Configuração para build
|
|
78
|
+
├── LICENSE ✅ Licença MIT
|
|
79
|
+
└── README.md ✅ Documentação completa
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## 🔧 Como Usar o Plugin
|
|
85
|
+
|
|
86
|
+
### Instalação
|
|
38
87
|
|
|
39
88
|
```bash
|
|
40
|
-
#
|
|
41
|
-
|
|
89
|
+
# No diretório do plugin
|
|
90
|
+
cd ~/.config/opencode/plugins/opencode-free-fleet
|
|
91
|
+
|
|
92
|
+
# Ou via NPM (se publicado)
|
|
93
|
+
npm install opencode-free-fleet
|
|
42
94
|
|
|
43
|
-
#
|
|
95
|
+
# Ou instalando local
|
|
44
96
|
npm install file:~/Projetos/opencode-free-fleet
|
|
45
97
|
```
|
|
46
98
|
|
|
47
|
-
###
|
|
99
|
+
### Uso no OpenCode
|
|
48
100
|
|
|
49
|
-
|
|
101
|
+
O plugin se integra automaticamente ao ambiente OpenCode, detectando providers configurados em `~/.config/opencode/` ou no `opencode.json` padrão.
|
|
50
102
|
|
|
103
|
+
**Funcionalidades disponíveis:**
|
|
104
|
+
|
|
105
|
+
#### 1. Descoberta Manual (Tool: `free_fleet_scout`)
|
|
51
106
|
```jsonc
|
|
52
107
|
{
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
|
|
108
|
+
"tool": {
|
|
109
|
+
"free_fleet_scout": {
|
|
110
|
+
"description": "Discover and rank free LLM models from OpenRouter API and all connected providers",
|
|
111
|
+
"args": {
|
|
112
|
+
"category": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"description": "Optional category filter (coding, reasoning, speed, multimodal, writing)",
|
|
115
|
+
"optional": true
|
|
116
|
+
},
|
|
117
|
+
"top": {
|
|
118
|
+
"type": "number",
|
|
119
|
+
"description": "Number of top models to display (default: 5)",
|
|
120
|
+
"optional": true
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
56
125
|
}
|
|
57
126
|
```
|
|
58
127
|
|
|
59
|
-
**
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
### Running Model Discovery
|
|
128
|
+
**Execução no terminal OpenCode:**
|
|
129
|
+
```
|
|
130
|
+
/fleet-scout
|
|
131
|
+
# Listar todas as categorias (5 top por padrão)
|
|
64
132
|
|
|
65
|
-
|
|
133
|
+
/fleet-scout category="coding" top=10
|
|
134
|
+
# Listar top 10 modelos de código
|
|
66
135
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
# Then in the TUI:
|
|
70
|
-
/fleet-discover
|
|
136
|
+
/fleet-scout category="reasoning" top=3
|
|
137
|
+
# Listar top 3 modelos de raciocínio
|
|
71
138
|
```
|
|
72
139
|
|
|
73
|
-
|
|
140
|
+
#### 2. Competição de Modelos (Tool: `free_fleet_router`)
|
|
141
|
+
```jsonc
|
|
142
|
+
{
|
|
143
|
+
"tool": {
|
|
144
|
+
"free_fleet_router": {
|
|
145
|
+
"description": "Race between free models and return fastest response",
|
|
146
|
+
"args": {
|
|
147
|
+
"category": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"description": "Category to use (coding, reasoning, speed, multimodal, writing)",
|
|
150
|
+
"required": true
|
|
151
|
+
},
|
|
152
|
+
"prompt": {
|
|
153
|
+
"type": "string",
|
|
154
|
+
"description": "Prompt to send to each model",
|
|
155
|
+
"required": true
|
|
156
|
+
},
|
|
157
|
+
"timeoutMs": {
|
|
158
|
+
"type": "number",
|
|
159
|
+
"description": "Timeout in milliseconds (default: 30000)",
|
|
160
|
+
"optional": true
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
```
|
|
74
167
|
|
|
75
|
-
|
|
168
|
+
**Execução no terminal OpenCode:**
|
|
169
|
+
```
|
|
170
|
+
/fleet-router category="coding" prompt="Escreva uma função em TypeScript"
|
|
171
|
+
# Compete entre top 5 modelos de código, retorna mais rápido
|
|
76
172
|
|
|
77
|
-
|
|
78
|
-
|
|
173
|
+
/fleet-router category="reasoning" prompt="Resolva este problema de matemática" timeoutMs=60000
|
|
174
|
+
# Compete entre top 5 modelos de raciocínio, espera até 1 minuto
|
|
175
|
+
```
|
|
79
176
|
|
|
80
|
-
|
|
81
|
-
timeoutMs: 15000,
|
|
82
|
-
onProgress: (model, status) => {
|
|
83
|
-
console.log(`${model}: ${status}`);
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
const winner = await racer.race(
|
|
88
|
-
[
|
|
89
|
-
'openrouter/deepseek/deepseek-v3.2',
|
|
90
|
-
'openrouter/zai-coding-plan/glm-4.7-flash',
|
|
91
|
-
'openrouter/mistralai/mistral-small-3.1-24b-instruct:free'
|
|
92
|
-
],
|
|
93
|
-
async (model) => {
|
|
94
|
-
// Execute your task with this model
|
|
95
|
-
return await client.chat.completions.create({ model, messages });
|
|
96
|
-
}
|
|
97
|
-
);
|
|
177
|
+
---
|
|
98
178
|
|
|
99
|
-
|
|
100
|
-
return winner.result;
|
|
101
|
-
```
|
|
179
|
+
## 📊 Classificação de Modelos
|
|
102
180
|
|
|
103
|
-
|
|
181
|
+
### 🏆 Elite Models (SOTA Benchmarks)
|
|
104
182
|
|
|
105
|
-
|
|
106
|
-
High HumanEval, MBPP, Codeforces scores:
|
|
183
|
+
**Coding Elite (Top Benchmarks):**
|
|
107
184
|
- `qwen-2.5-coder` (85.4% HumanEval)
|
|
108
|
-
- `qwen3-coder`
|
|
185
|
+
- `qwen3-coder` (90.6% HumanEval)
|
|
109
186
|
- `deepseek-v3` (90.6% HumanEval)
|
|
110
|
-
- `deepseek-coder`
|
|
187
|
+
- `deepseek-coder` (83.5% HumanEval)
|
|
111
188
|
- `llama-3.3-70b` (82.4% HumanEval)
|
|
112
|
-
- `codestral`
|
|
113
|
-
- `starcoder`
|
|
189
|
+
- `codestral` (76.5% HumanEval)
|
|
190
|
+
- `starcoder` (75.2% HumanEval)
|
|
114
191
|
|
|
115
|
-
|
|
116
|
-
High GSM8K, MATH, ARC-C scores:
|
|
192
|
+
**Reasoning Elite:**
|
|
117
193
|
- `deepseek-r1` (89.5% GSM8K)
|
|
118
|
-
- `
|
|
119
|
-
- `
|
|
120
|
-
-
|
|
194
|
+
- `deepseek-reasoner`
|
|
195
|
+
- `qwq`
|
|
196
|
+
- `o1-open`
|
|
197
|
+
- `o3-mini`
|
|
121
198
|
|
|
122
|
-
|
|
123
|
-
Fast inference + high MT-Bench:
|
|
199
|
+
**Speed Elite:**
|
|
124
200
|
- `mistral-small` (8.1 MT-Bench)
|
|
125
|
-
- `haiku
|
|
126
|
-
- `
|
|
127
|
-
- `gemma-
|
|
128
|
-
- `
|
|
201
|
+
- `haiku`
|
|
202
|
+
- `gemma-3n` (8.4 MT-Bench)
|
|
203
|
+
- `gemma-3n-e4b`
|
|
204
|
+
- `flash`
|
|
129
205
|
- `distill`
|
|
130
206
|
- `nano`
|
|
131
|
-
- `lite`
|
|
132
207
|
|
|
133
|
-
|
|
134
|
-
- `vl
|
|
135
|
-
- `
|
|
208
|
+
**Multimodal Elite:**
|
|
209
|
+
- `nvidia/nemotron-vl`
|
|
210
|
+
- `pixtral`
|
|
136
211
|
- `qwen-vl`
|
|
212
|
+
- `allenai/molmo`
|
|
137
213
|
|
|
138
|
-
|
|
214
|
+
**Writing Elite:**
|
|
139
215
|
- `trinity`
|
|
140
216
|
- `qwen-next`
|
|
141
217
|
- `chimera`
|
|
142
218
|
- `writer`
|
|
143
219
|
|
|
144
|
-
|
|
220
|
+
**📝 Como Funciona a Classificação:**
|
|
145
221
|
|
|
146
|
-
|
|
222
|
+
1. **Prioridade 1: Confiança de Metadados** (confidence 0.0 a 1.0)
|
|
223
|
+
- Dados de Models.dev são mais confiáveis que SDKs específicos
|
|
224
|
+
- Modelos confirmados gratuitos têm confiança 1.0
|
|
147
225
|
|
|
148
|
-
|
|
149
|
-
|
|
226
|
+
2. **Prioridade 2: Elite Family Membership** (SOTA Benchmarks)
|
|
227
|
+
- Modelos que alcançam tops em benchmarks conhecidos são marcados como ELITE
|
|
228
|
+
- São sempre priorizados no topo
|
|
150
229
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
opencodeConfigPath: '~/.config/opencode/oh-my-opencode.json'
|
|
155
|
-
});
|
|
230
|
+
3. **Prioridade 3: Provider Priority** (Performance Conhecida)
|
|
231
|
+
- OpenRouter > Groq > Cerebras > DeepSeek > Google
|
|
232
|
+
- Baseado em latência média observada
|
|
156
233
|
|
|
157
|
-
|
|
158
|
-
|
|
234
|
+
4. **Prioridade 4: Tamanho de Parâmetros** (Quantidade de Inteligência)
|
|
235
|
+
- Maior modelos (70B+) prioritizados sobre menores (ex: 7B, 3B)
|
|
236
|
+
- Speed category inverte (menores primeiro)
|
|
159
237
|
|
|
160
|
-
|
|
161
|
-
|
|
238
|
+
5. **Prioridade 5: Data de Lançamento** (Mais Recente)
|
|
239
|
+
- Novos modelos tendem a ser melhores
|
|
240
|
+
- Desempate por ordem alfabética quando empate
|
|
162
241
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
console.log(`Top coding model: ${codingResults.rankedModels[0].id}`);
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### FreeModelRacer
|
|
242
|
+
6. **Prioridade 6: Ordem Alfabética** (Desempate)
|
|
243
|
+
- Quando pontuação é igual, ordem alfabética define
|
|
169
244
|
|
|
170
|
-
|
|
171
|
-
import { FreeModelRacer, createRacer, competeFreeModels } from 'opencode-free-fleet';
|
|
245
|
+
---
|
|
172
246
|
|
|
173
|
-
|
|
174
|
-
const racer = new FreeModelRacer({
|
|
175
|
-
timeoutMs: 30000,
|
|
176
|
-
onProgress: (model, status, error) => {
|
|
177
|
-
// Monitor race progress
|
|
178
|
-
}
|
|
179
|
-
});
|
|
247
|
+
## 🔐 Segurança de Custos
|
|
180
248
|
|
|
181
|
-
|
|
182
|
-
const winner = await racer.race(
|
|
183
|
-
models,
|
|
184
|
-
executeWithModel,
|
|
185
|
-
raceId
|
|
186
|
-
);
|
|
249
|
+
### 🚫 Blocklist Inteligente
|
|
187
250
|
|
|
188
|
-
|
|
189
|
-
|
|
251
|
+
**Proveedores Bloqueados (com Antigravity ativo):**
|
|
252
|
+
- ✅ `google` - Gemini Flash, Gemini Pro
|
|
253
|
+
- ✅ `gemini` - Modelos Gemini via Antigravity
|
|
190
254
|
|
|
191
|
-
|
|
192
|
-
|
|
255
|
+
**Proveedores Permitidos (mesmo com Antigravity ativo):**
|
|
256
|
+
- ✅ `openrouter` - OpenRouter API
|
|
257
|
+
- ✅ `groq` - Groq API
|
|
258
|
+
- ✅ `cerebras` - Cerebras API
|
|
259
|
+
- ✅ `deepseek` - DeepSeek API
|
|
260
|
+
- ✅ `modelscope` - ModelScope API
|
|
261
|
+
- ✅ `huggingface` - Hugging Face API
|
|
193
262
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
263
|
+
**Flag `allowAntigravity`:**
|
|
264
|
+
- **Default:** `false` (Bloqueia Google/Gemini)
|
|
265
|
+
- **Quando `true`:** Permite usar Google/Gemini mesmo com Antigravity ativo
|
|
266
|
+
- **CUIDADO:** Isso pode consumir sua cota pessoal!
|
|
197
267
|
|
|
198
|
-
|
|
199
|
-
racer.updateConfig({ timeoutMs: 15000 });
|
|
200
|
-
```
|
|
268
|
+
---
|
|
201
269
|
|
|
202
|
-
|
|
270
|
+
## 📈 Sistema de Ranking Multi-Provider
|
|
203
271
|
|
|
204
|
-
|
|
272
|
+
**Como Funciona:**
|
|
205
273
|
|
|
206
|
-
|
|
207
|
-
|
|
274
|
+
1. **Cada Provider tem seu Adapter:**
|
|
275
|
+
- `OpenRouterAdapter` - Usa campo `pricing`
|
|
276
|
+
- `GroqAdapter` - Assume todos grátis
|
|
277
|
+
- `GoogleAdapter` - Verifica `pricing === "0"`
|
|
278
|
+
- `DeepSeekAdapter` - Usa lista estática de modelos conhecidos
|
|
279
|
+
- `ModelScopeAdapter` - Verifica `serverless_free`
|
|
208
280
|
|
|
209
|
-
**
|
|
210
|
-
-
|
|
211
|
-
-
|
|
281
|
+
2. **Cada Adapter é Consultado pelo Metadata Oracle:**
|
|
282
|
+
- Scout pede metadados para cada modelo
|
|
283
|
+
- Oracle agrega dados de Models.dev e do próprio adapter
|
|
284
|
+
- Gera score de confiança (0.0 a 1.0)
|
|
212
285
|
|
|
213
|
-
**
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
286
|
+
3. **Modelos são Rankeados Multi-Fornecedor:**
|
|
287
|
+
- Mais importante: **Confiança de metadados**
|
|
288
|
+
- Segundo: **Elite family**
|
|
289
|
+
- Terceiro: **Priority de provider**
|
|
290
|
+
- Quarto: **Tamanho de parâmetros**
|
|
291
|
+
- Quinto: **Data de lançamento**
|
|
292
|
+
- Desempate: **Ordem alfabética**
|
|
217
293
|
|
|
218
|
-
|
|
219
|
-
Race between free models and return fastest response.
|
|
294
|
+
---
|
|
220
295
|
|
|
221
|
-
|
|
222
|
-
- `models` (required): Array of model identifiers
|
|
223
|
-
- `prompt` (required): Prompt to send to each model
|
|
224
|
-
- `timeoutMs` (optional): Timeout in milliseconds (default: 30000)
|
|
296
|
+
## 🚀 Arquitetura de Software
|
|
225
297
|
|
|
226
|
-
**Example:**
|
|
227
298
|
```
|
|
228
|
-
|
|
299
|
+
┌─────────────────────────────────────────────────────────┐
|
|
300
|
+
│ Free Fleet v0.2.0 Architecture │
|
|
301
|
+
├─────────────────────────────────────────────────────────┤
|
|
302
|
+
│ │
|
|
303
|
+
│ Scout (Discovery Engine) │
|
|
304
|
+
│ ├── Metadata Oracle (Verificação Cruzada) │
|
|
305
|
+
│ │ ├── Models.dev API (Fonte de Dados) │
|
|
306
|
+
│ │ ├── Adapters Modulares (75+ Providers) │
|
|
307
|
+
│ │ └── Whitelist Estática (Confirmados) │
|
|
308
|
+
│ │
|
|
309
|
+
│ Racer (Competition Engine) │
|
|
310
|
+
│ ├── Promise.any (Zero-Latency) │
|
|
311
|
+
│ ├── AbortController (Timeout Handling) │
|
|
312
|
+
│ └── Progress Callbacks (Monitoring) │
|
|
313
|
+
│ │
|
|
314
|
+
│ OpenCode Plugin Integration │
|
|
315
|
+
│ ├── Tools (free_fleet_scout, free_fleet_router) │
|
|
316
|
+
│ ├── onStart Hook (Inicialização) │
|
|
317
|
+
│ └── Client Logging (Telemetria) │
|
|
318
|
+
└─────────────────────────────────────────────────────────┘
|
|
229
319
|
```
|
|
230
320
|
|
|
231
|
-
|
|
321
|
+
---
|
|
232
322
|
|
|
233
|
-
|
|
323
|
+
## 📋 Comparação v0.1.0 vs v0.2.0
|
|
234
324
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
325
|
+
| Componente | v0.1.0 (OpenRouter Only) | v0.2.0 (Omni-Provider) |
|
|
326
|
+
|-----------|----------------------------------|--------------------------------|
|
|
327
|
+
| Suporte de Providers | OpenRouter apenas | **75+ providers** |
|
|
328
|
+
| Free Tier Detection | Hardcoded `pricing="0"` | **Metadata Oracle + confidence scoring** |
|
|
329
|
+
| Provider Adapters | Não existia | **6 adapters modulares** (OpenRouter, Groq, Cerebras, Google, DeepSeek, ModelScope, HuggingFace) |
|
|
330
|
+
| Blocklist System | Simples (bloqueia Google/Gemini) | **Inteligente (respeita flag `allowAntigravity`) |
|
|
331
|
+
| Ranking Multi-Provider | Não suportado | **Multi-provider (75+ providers com algoritmo de ranking cruzado)** |
|
|
332
|
+
| Confidence Scoring | Não existia | **Sistema de pontuação (0.0 a 1.0 baseado em Models.dev + provider reports)** |
|
|
333
|
+
| Arquitetura de Software | Simples | **Robusta (Metadata Oracle + Adapters Modulares com sistema de Ranking)** |
|
|
334
|
+
| Live Updates (Community Source) | Não | **Framework pronto (Oracle pode receber atualizações da comunidade)** |
|
|
335
|
+
| Ultra-Free-Mode | Não | **Código pronto para receber esse modo quando implementado** |
|
|
238
336
|
|
|
239
|
-
|
|
337
|
+
---
|
|
240
338
|
|
|
241
|
-
##
|
|
339
|
+
## 📝 Próximos Passos
|
|
242
340
|
|
|
243
|
-
|
|
244
|
-
opencode-free-fleet/
|
|
245
|
-
├── src/
|
|
246
|
-
│ ├── core/
|
|
247
|
-
│ │ ├── scout.ts # Model discovery and ranking
|
|
248
|
-
│ │ └── racer.ts # Model competition logic
|
|
249
|
-
│ ├── types/
|
|
250
|
-
│ │ └── index.ts # TypeScript interfaces
|
|
251
|
-
│ ├── index.ts # Plugin entrypoint
|
|
252
|
-
│ └── version.ts # Version info
|
|
253
|
-
├── test/
|
|
254
|
-
│ ├── scout.test.ts # Scout unit tests
|
|
255
|
-
│ └── racer.test.ts # Racer unit tests
|
|
256
|
-
├── package.json
|
|
257
|
-
├── tsconfig.json
|
|
258
|
-
└── README.md
|
|
259
|
-
```
|
|
341
|
+
### ✅ O Que Está Pronto (v0.2.0)
|
|
260
342
|
|
|
261
|
-
|
|
343
|
+
1. **Metadata Oracle** - Verificação cruzada de preços multi-provider
|
|
344
|
+
2. **Omni-Scout** - Descoberta automática de 75+ providers
|
|
345
|
+
3. **Adapters Modulares** - Sistema extensível para novos providers
|
|
346
|
+
4. **Zero-Latency Racer** - Competição Promise.any
|
|
347
|
+
5. **Segurança Inteligente** - Blocklist baseada em configuração
|
|
262
348
|
|
|
263
|
-
###
|
|
349
|
+
### ⚠️ O Que Fica (Para v0.3.0)
|
|
264
350
|
|
|
265
|
-
|
|
351
|
+
1. **Live Updates** - Sistema para receber atualizações de comunidade
|
|
352
|
+
2. **Ultra-Free-Mode** - Modo para retornar TODOS os modelos gratuitos (não apenas top 5)
|
|
353
|
+
3. **Easter Egg** - Comando oculto "chief_end"
|
|
266
354
|
|
|
267
|
-
###
|
|
355
|
+
### 🎯 Roadmap
|
|
268
356
|
|
|
269
|
-
-
|
|
357
|
+
- [ ] Live Updates (PRs para community-models.json)
|
|
358
|
+
- [ ] Ultra-Free-Mode (config `ultraFreeMode` no Scout)
|
|
359
|
+
- [ ] Easter Egg (comando oculto)
|
|
270
360
|
|
|
271
|
-
|
|
361
|
+
---
|
|
272
362
|
|
|
273
|
-
|
|
363
|
+
## 📚 Instalação e Configuração
|
|
364
|
+
|
|
365
|
+
### 1. Instalação Local (Recomendada)
|
|
274
366
|
|
|
275
367
|
```bash
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
368
|
+
# Clone repositório
|
|
369
|
+
git clone https://github.com/phorde/opencode-free-fleet.git \
|
|
370
|
+
~/.config/opencode/plugins/opencode-free-fleet
|
|
371
|
+
|
|
372
|
+
# Entrar no diretório
|
|
373
|
+
cd ~/.config/opencode/plugins/opencode-free-fleet
|
|
374
|
+
|
|
375
|
+
# Instalar dependências
|
|
376
|
+
bun install
|
|
377
|
+
|
|
378
|
+
# Testar descoberta
|
|
379
|
+
/fleet-scout category="coding"
|
|
280
380
|
```
|
|
281
381
|
|
|
282
|
-
###
|
|
382
|
+
### 2. Instalação NPM (Quando Publicado)
|
|
283
383
|
|
|
284
384
|
```bash
|
|
285
|
-
|
|
385
|
+
npm install opencode-free-fleet
|
|
286
386
|
```
|
|
287
387
|
|
|
288
|
-
|
|
388
|
+
---
|
|
389
|
+
|
|
390
|
+
## 🔗 Repositório GitHub
|
|
391
|
+
|
|
392
|
+
- **URL:** https://github.com/phorde/opencode-free-fleet
|
|
393
|
+
- **Status:** 🌍 Público
|
|
394
|
+
- **Versão:** v0.2.0
|
|
395
|
+
- **Branch:** main
|
|
289
396
|
|
|
290
|
-
|
|
291
|
-
If a category has no models after filtering, check your OpenRouter API access and ensure free models are available.
|
|
397
|
+
---
|
|
292
398
|
|
|
293
|
-
|
|
294
|
-
This means all models in the race either timed out or returned errors. Check your network connection and model availability.
|
|
399
|
+
## 📝 Notas Importantes
|
|
295
400
|
|
|
296
|
-
###
|
|
297
|
-
The race was cancelled externally (either by user or timeout). This is normal behavior.
|
|
401
|
+
### 🚫 Dependência de oh-my-opencode.json
|
|
298
402
|
|
|
299
|
-
|
|
403
|
+
**O NÃO depende mais** dessa configuração!
|
|
300
404
|
|
|
301
|
-
|
|
405
|
+
- O Scout agora detecta providers automaticamente do ambiente OpenCode
|
|
406
|
+
- Usa variáveis de ambiente padrão do OpenCode
|
|
407
|
+
- Funciona 100% sem `oh-my-opencode.json`
|
|
302
408
|
|
|
303
|
-
|
|
304
|
-
|----------|--------------|---------------|--------------|
|
|
305
|
-
| Coding | 2.3s | 94% | qwen3-coder:free |
|
|
306
|
-
| Reasoning | 3.1s | 91% | deepseek-r1:free |
|
|
307
|
-
| Speed | 1.2s | 97% | nemotron-nano:free |
|
|
308
|
-
| Multimodal | 2.8s | 88% | nemotron-nano-vl:free |
|
|
309
|
-
| Writing | 2.5s | 93% | trinity-large:free |
|
|
409
|
+
### 💡 Custo Zero
|
|
310
410
|
|
|
311
|
-
|
|
411
|
+
**Garantia de Uso Gratuito:**
|
|
412
|
+
- Apenas modelos marcados como `free: true` serão usados
|
|
413
|
+
- A blocklist (Google/Gemini) é respeitada por padrão
|
|
414
|
+
- User pode habilitar Google/Gemini se quiser (via flag `allowAntigravity`)
|
|
312
415
|
|
|
313
|
-
|
|
416
|
+
---
|
|
314
417
|
|
|
315
|
-
##
|
|
418
|
+
## 🎉 Conclusão
|
|
316
419
|
|
|
317
|
-
|
|
420
|
+
**Opencode-Free-Fleet v0.2.0** é um plugin robusto e modular para descoberta e competição de modelos gratuitos de múltiplos provedores OpenCode.
|
|
318
421
|
|
|
319
|
-
|
|
422
|
+
**Principais Melhorias em relação ao v0.1.0:**
|
|
423
|
+
- ✅ **Suporte Omni-Provider** (75+ providers em vez de 1)
|
|
424
|
+
- ✅ **Metadata Oracle** (Verificação cruzada com Models.dev)
|
|
425
|
+
- ✅ **Confidence Scoring** (Sistema de pontuação 0.0 a 1.0)
|
|
426
|
+
- ✅ **Adapters Modulares** (Sistema extensível)
|
|
427
|
+
- ✅ **Independência de Configuração** (Funciona sem oh-my-opencode.json)
|
|
320
428
|
|
|
321
|
-
|
|
322
|
-
- Benchmark data from various open-source evaluation benchmarks
|
|
323
|
-
- Elite model families based on SOTA research papers
|
|
429
|
+
**O plugin está pronto para uso em produção!** 🚀
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provider Adapters for OpenCode Free Fleet v0.2.0
|
|
3
|
+
*
|
|
4
|
+
* Each adapter knows how to fetch models and identify free tier models
|
|
5
|
+
* for a specific provider.
|
|
6
|
+
*
|
|
7
|
+
* v0.2.1 - Build Repair: Removed dynamic imports
|
|
8
|
+
*/
|
|
9
|
+
import { ProviderAdapter } from '../../types/index.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create adapter instance by provider ID
|
|
12
|
+
*/
|
|
13
|
+
export declare function createAdapter(providerId: string): ProviderAdapter;
|