-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-request.ps1
More file actions
28 lines (24 loc) · 865 Bytes
/
Copy pathtest-request.ps1
File metadata and controls
28 lines (24 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# ============================================================
# test-request.ps1 — smoke test against the local proxy (Windows PowerShell)
# Usage: .\test-request.ps1
# ============================================================
$Model = if ($env:DEFAULT_MODEL) { $env:DEFAULT_MODEL } else { "nvidia/nemotron-nano-9b-v2:free" }
$ProxyUrl = "http://localhost:8081/api/v1/chat/completions"
Write-Host "Testing proxy at: $ProxyUrl"
Write-Host "Model: $Model"
Write-Host "---"
$Body = @{
model = $Model
messages = @(
@{ role = "user"; content = "Say hello in one sentence." }
)
} | ConvertTo-Json -Depth 5
try {
$Response = Invoke-RestMethod -Uri $ProxyUrl `
-Method POST `
-ContentType "application/json" `
-Body $Body
$Response | ConvertTo-Json -Depth 10
} catch {
Write-Error "Request failed: $_"
}