Spaces:
Sleeping
Sleeping
File size: 731 Bytes
f25362a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | [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."
|