Backup #442

ID442
Dateipfad/var/www/dev.campus.systemische-tools.de/src/Infrastructure/AI/ModelConfig.php
Version3
Typ modified
Größe2.4 KB
Hash77d97570714d3a1f3031a4c820233f91524be4f3006da8b3962ca29b35c6334d
Datum2025-12-22 10:14:58
Geändert vonclaude-code-hook
GrundClaude Code Pre-Hook Backup vor Edit-Operation
Datei existiert Ja

Dateiinhalt

<?php

declare(strict_types=1);

namespace Infrastructure\AI;

/**
 * Central configuration for available AI models.
 * Used by Chat, Content Studio, and other AI-powered features.
 */
final class ModelConfig
{
    /**
     * All available models with their display labels.
     * Format: 'model-id' => 'Display Label'
     */
    public const MODELS = [
        // Anthropic Claude
        'claude-opus-4-5-20251101' => 'Claude Opus 4.5',
        'claude-sonnet-4-20250514' => 'Claude Sonnet 4',
        // Local Ollama models (Text)
        'ollama:gemma3:4b-it-qat' => 'Gemma 3 (lokal)',
        'ollama:mistral:latest' => 'Mistral (lokal)',
        'ollama:llama3.2:latest' => 'Llama 3.2 (lokal)',
        'ollama:gpt-oss:20b' => 'GPT-OSS 20B (lokal)',
        // Local Ollama models (Vision)
        'ollama:minicpm-v:latest' => 'MiniCPM-V (Vision)',
    ];

    /**
     * Vision-capable models for image/document analysis.
     */
    public const VISION_MODELS = [
        'ollama:minicpm-v:latest' => 'MiniCPM-V (Vision, lokal)',
        'claude-opus-4-5-20251101' => 'Claude Opus 4.5 (Vision)',
        'claude-sonnet-4-20250514' => 'Claude Sonnet 4 (Vision)',
    ];

    /**
     * Default vision model for document analysis.
     */
    public const DEFAULT_VISION_MODEL = 'ollama:minicpm-v:latest';

    /**
     * Default model for new sessions/orders.
     * Local Ollama model for cost-efficiency.
     */
    public const DEFAULT_MODEL = 'ollama:gemma3:4b-it-qat';

    /**
     * Get all models as array.
     */
    public static function getAll(): array
    {
        return self::MODELS;
    }

    /**
     * Get display label for a model ID.
     */
    public static function getLabel(string $modelId): string
    {
        return self::MODELS[$modelId] ?? $modelId;
    }

    /**
     * Check if a model ID is valid.
     */
    public static function isValid(string $modelId): bool
    {
        return isset(self::MODELS[$modelId])
            || str_starts_with($modelId, 'claude-')
            || str_starts_with($modelId, 'ollama:');
    }

    /**
     * Validate and return model, or default if invalid.
     */
    public static function validate(string $modelId): string
    {
        return self::isValid($modelId) ? $modelId : self::DEFAULT_MODEL;
    }

    /**
     * Check if model is a local (Ollama) model.
     */
    public static function isLocal(string $modelId): bool
    {
        return str_starts_with($modelId, 'ollama:');
    }
}

Vollständig herunterladen

Aktionen

Herunterladen

Andere Versionen dieser Datei

ID Version Typ Größe Datum
2025 7 modified 2.6 KB 2025-12-28 23:21
1304 6 modified 2.5 KB 2025-12-25 13:29
790 5 modified 2.6 KB 2025-12-23 08:06
679 4 modified 2.6 KB 2025-12-23 07:39
442 3 modified 2.4 KB 2025-12-22 10:14
433 2 modified 1.9 KB 2025-12-22 10:11
425 1 modified 1.8 KB 2025-12-22 10:00

← Zurück zur Übersicht