jackailocal / factory /powershell /Add-ModelToCatalog.ps1
jackboy70's picture
Deploy: accurate lite-builder note
f25362a
Raw
History Blame Contribute Delete
731 Bytes
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)][string]$Id,
[Parameter(Mandatory=$true)][string]$Label,
[Parameter(Mandatory=$true)][string]$OllamaName,
[double]$MinRamGb=8,
[double]$MinVramGb=0,
[int]$Context=4096
)
$Root = Resolve-Path (Join-Path $PSScriptRoot "..\..")
$Path = Join-Path $Root "config\model-catalog.json"
$j = Get-Content $Path -Raw | ConvertFrom-Json
$new = [pscustomobject]@{ id=$Id; label=$Label; description="Custom model"; min_ram_gb=$MinRamGb; min_vram_gb=$MinVramGb; default_backend="ollama"; ollama=$OllamaName; gguf=$null; features=@("chat"); context=$Context }
$j.profiles += $new
$j | ConvertTo-Json -Depth 20 | Set-Content -Encoding UTF8 $Path
Write-Host "Added model profile $Id."