First Commit
This commit is contained in:
Executable
+107
@@ -0,0 +1,107 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\AiModel;
|
||||
use App\Models\AiProvider;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AiProviderSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Seed the application AI providers.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$openrouter = AiProvider::withTrashed()->where('slug', 'openrouter')->first();
|
||||
if (!$openrouter) {
|
||||
$openrouter = AiProvider::create([
|
||||
'name' => 'OpenRouter',
|
||||
'slug' => 'openrouter',
|
||||
'description' => 'Provedor OpenRouter com múltiplos modelos de IA',
|
||||
'base_url' => env('OPENROUTER_BASE_URL', 'https://openrouter.ai/api/v1'),
|
||||
'api_key' => env('OPENROUTER_API_KEY', ''),
|
||||
'is_active' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$stepfun = AiProvider::withTrashed()->where('slug', 'stepfun')->first();
|
||||
if (!$stepfun) {
|
||||
$stepfun = AiProvider::create([
|
||||
'name' => 'StepFun',
|
||||
'slug' => 'stepfun',
|
||||
'description' => 'Provedor StepFun com modelos avançados',
|
||||
'base_url' => env('STEPFUN_BASE_URL', 'https://api.stepfun.ai/v1'),
|
||||
'api_key' => env('STEPFUN_API_KEY', ''),
|
||||
'is_active' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$llamacpp = AiProvider::withTrashed()->where('slug', 'llamacpp')->first();
|
||||
if (!$llamacpp) {
|
||||
$llamacpp = AiProvider::create([
|
||||
'name' => 'Llama.cpp Local',
|
||||
'slug' => 'llamacpp',
|
||||
'description' => 'Servidor local Llama.cpp',
|
||||
'base_url' => env('LLAMACPP_BASE_URL', 'http://localhost:8080'),
|
||||
'api_key' => null,
|
||||
'is_active' => true,
|
||||
]);
|
||||
}
|
||||
|
||||
$this->seedModels($openrouter, 'openrouter');
|
||||
$this->seedModels($stepfun, 'stepfun');
|
||||
$this->seedModels($llamacpp, 'llamacpp');
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed models for a given provider.
|
||||
*/
|
||||
private function seedModels(AiProvider $provider, string $providerSlug): void
|
||||
{
|
||||
$models = [
|
||||
'openrouter' => [
|
||||
['name' => 'inclusionai/ling-2.6-flash', 'slug' => 'inclusionai/ling-2.6-flash', 'max_tokens' => 4096],
|
||||
['name' => 'inclusionai/ling-3.0-tiny:free', 'slug' => 'inclusionai/ling-3.0-tiny:free', 'max_tokens' => 4096],
|
||||
['name' => 'poolside/laguna-s-2.1:free', 'slug' => 'poolside/laguna-s-2.1:free', 'max_tokens' => 4096],
|
||||
['name' => 'poolside/laguna-xs-2.1:free', 'slug' => 'poolside/laguna-xs-2.1:free', 'max_tokens' => 4096],
|
||||
['name' => 'cohere/north-mini-code:free', 'slug' => 'cohere/north-mini-code:free', 'max_tokens' => 4096],
|
||||
['name' => 'nvidia/nemotron-3.5-content-safety:free', 'slug' => 'nvidia/nemotron-3.5-content-safety:free', 'max_tokens' => 4096],
|
||||
['name' => 'nvidia/nemotron-3-ultra-550b-a55b:free', 'slug' => 'nvidia/nemotron-3-ultra-550b-a55b:free', 'max_tokens' => 4096],
|
||||
['name' => 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free', 'slug' => 'nvidia/nemotron-3-nano-omni-30b-a3b-reasoning:free', 'max_tokens' => 4096],
|
||||
['name' => 'google/gemma-4-26b-a4b-it:free', 'slug' => 'google/gemma-4-26b-a4b-it:free', 'max_tokens' => 4096],
|
||||
['name' => 'google/gemma-4-31b-it:free', 'slug' => 'google/gemma-4-31b-it:free', 'max_tokens' => 4096],
|
||||
['name' => 'google/lyria-3-pro-preview', 'slug' => 'google/lyria-3-pro-preview', 'max_tokens' => 4096],
|
||||
['name' => 'google/lyria-3-clip-preview', 'slug' => 'google/lyria-3-clip-preview', 'max_tokens' => 4096],
|
||||
['name' => 'nvidia/nemotron-3-super-120b-a12b:free', 'slug' => 'nvidia/nemotron-3-super-120b-a12b:free', 'max_tokens' => 4096],
|
||||
['name' => 'openrouter/free', 'slug' => 'openrouter/free', 'max_tokens' => 4096],
|
||||
['name' => 'nvidia/nemotron-3-nano-30b-a3b:free', 'slug' => 'nvidia/nemotron-3-nano-30b-a3b:free', 'max_tokens' => 4096],
|
||||
['name' => 'nvidia/nemotron-nano-12b-v2-vl:free', 'slug' => 'nvidia/nemotron-nano-12b-v2-vl:free', 'max_tokens' => 4096],
|
||||
['name' => 'nvidia/nemotron-nano-9b-v2:free', 'slug' => 'nvidia/nemotron-nano-9b-v2:free', 'max_tokens' => 4096],
|
||||
['name' => 'openai/gpt-oss-20b:free', 'slug' => 'openai/gpt-oss-20b:free', 'max_tokens' => 4096],
|
||||
['name' => 'deepseek/deepseek-v4-flash', 'slug' => 'deepseek/deepseek-v4-flash', 'max_tokens' => 8192],
|
||||
],
|
||||
'stepfun' => [
|
||||
['name' => 'step-3.5-flash', 'slug' => 'step-3.5-flash', 'max_tokens' => 8192],
|
||||
['name' => 'step-3.7-flash', 'slug' => 'step-3.7-flash', 'max_tokens' => 8192],
|
||||
],
|
||||
'llamacpp' => [
|
||||
['name' => 'Qwen3-8B-Q4_K_M.gguf', 'slug' => 'Qwen3-8B-Q4_K_M.gguf', 'max_tokens' => 4096],
|
||||
['name' => 'Llama-3.2-3B-Instruct-uncensored-Q4_K_M.gguf', 'slug' => 'Llama-3.2-3B-Instruct-uncensored-Q4_K_M.gguf', 'max_tokens' => 2048],
|
||||
['name' => 'ibm-granite_granite-4.1-3b-Q4_K_M.gguf', 'slug' => 'ibm-granite_granite-4.1-3b-Q4_K_M.gguf', 'max_tokens' => 2048],
|
||||
['name' => 'qwen2.5-coder-3b-instruct-q4_k_m.gguf', 'slug' => 'qwen2.5-coder-3b-instruct-q4_k_m.gguf', 'max_tokens' => 2048],
|
||||
['name' => 'LiquidAI_LFM2.5-1.2B-Instruct-Q4_0.gguf', 'slug' => 'LiquidAI_LFM2.5-1.2B-Instruct-Q4_0.gguf', 'max_tokens' => 2048],
|
||||
],
|
||||
];
|
||||
|
||||
foreach ($models[$providerSlug] as $modelData) {
|
||||
AiModel::firstOrCreate(
|
||||
[
|
||||
'provider_id' => $provider->id,
|
||||
'slug' => $modelData['slug'],
|
||||
],
|
||||
$modelData
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user