feat: Add Kilo Gateway as AI provider
Add full support for Kilo Gateway AI provider across the codebase: - Add custom loader for 'kilo' provider in provider.ts with API key detection - Add auth CLI hint for Kilo Gateway in auth.ts - Add Kilo to DEFAULT_PROVIDER_SEEDS in chat server.js - Add Kilo to PLANNING_PROVIDERS for planning chain support - Add Kilo provider configuration with baseURL and API key support - Update admin env config to show Kilo API key status Kilo Gateway provides access to 500+ AI models through a single OpenAI-compatible endpoint at https://api.kilo.ai/api/gateway
This commit is contained in:
@@ -512,7 +512,7 @@ const PLAN_PRICES = {
|
||||
};
|
||||
const AUTO_MODEL_TOKEN = 'auto';
|
||||
const DEFAULT_PROVIDER_FALLBACK = 'opencode';
|
||||
const DEFAULT_PROVIDER_SEEDS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama', DEFAULT_PROVIDER_FALLBACK, 'cohere'];
|
||||
const DEFAULT_PROVIDER_SEEDS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'chutes', 'cerebras', 'ollama', DEFAULT_PROVIDER_FALLBACK, 'cohere', 'kilo'];
|
||||
const PROVIDER_PERSIST_DEBOUNCE_MS = 200;
|
||||
const TOKEN_ESTIMATION_BUFFER = 400;
|
||||
const BOOST_PACK_SIZE = 500_000;
|
||||
@@ -1539,7 +1539,7 @@ let mistralSettings = {
|
||||
backupModel2: MISTRAL_MODEL_BACKUP_2,
|
||||
backupModel3: MISTRAL_MODEL_BACKUP_3,
|
||||
};
|
||||
const PLANNING_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'ollama', 'cohere'];
|
||||
const PLANNING_PROVIDERS = ['openrouter', 'mistral', 'google', 'groq', 'nvidia', 'ollama', 'cohere', 'kilo'];
|
||||
let planSettings = {
|
||||
provider: 'openrouter', // legacy field, retained for backwards compatibility
|
||||
freePlanModel: '',
|
||||
@@ -5229,6 +5229,10 @@ async function ensureOpencodeConfig(session) {
|
||||
nvidia: {
|
||||
apiKey: NVIDIA_API_KEY,
|
||||
baseURL: 'https://integrate.api.nvidia.com/v1'
|
||||
},
|
||||
kilo: {
|
||||
apiKey: process.env.KILO_API_KEY,
|
||||
baseURL: 'https://api.kilo.ai/api/gateway'
|
||||
}
|
||||
};
|
||||
|
||||
@@ -16177,6 +16181,7 @@ async function handleAdminEnvConfig(req, res) {
|
||||
const mistralKey = process.env.MISTRAL_API_KEY || process.env.MISTRAL_API_TOKEN || '';
|
||||
const openrouterKey = process.env.OPENROUTER_API_KEY || process.env.OPENROUTER_API_TOKEN || '';
|
||||
const chutesKey = process.env.PLUGIN_COMPASS_CHUTES_API_KEY || process.env.CHUTES_API_KEY || process.env.CHUTES_API_TOKEN || '';
|
||||
const kiloKey = process.env.KILO_API_KEY || '';
|
||||
|
||||
const payload = {
|
||||
GROQ: {
|
||||
@@ -16199,6 +16204,11 @@ async function handleAdminEnvConfig(req, res) {
|
||||
prefix: chutesKey ? `${chutesKey.substring(0, 8)}...` : null,
|
||||
source: chutesKey ? (process.env.PLUGIN_COMPASS_CHUTES_API_KEY ? 'PLUGIN_COMPASS_CHUTES_API_KEY' : process.env.CHUTES_API_KEY ? 'CHUTES_API_KEY' : 'CHUTES_API_TOKEN') : null,
|
||||
},
|
||||
KILO: {
|
||||
configured: !!kiloKey,
|
||||
prefix: kiloKey ? `${kiloKey.substring(0, 8)}...` : null,
|
||||
source: kiloKey ? 'KILO_API_KEY' : null,
|
||||
},
|
||||
};
|
||||
|
||||
sendJson(res, 200, { ok: true, env: payload });
|
||||
|
||||
Reference in New Issue
Block a user