File size: 734 Bytes
61bb677
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import uvicorn
import threading
import httpx
import time
from free_claude_code.runtime.bootstrap import build_asgi_app
from free_claude_code.config.settings import Settings

def run():
    app = build_asgi_app(Settings())
    uvicorn.run(app, host="127.0.0.1", port=8000, log_level="error")

t = threading.Thread(target=run, daemon=True)
t.start()

time.sleep(3)
try:
    res = httpx.post("http://127.0.0.1:8000/v1/messages", json={
        "model": "nvidia/nemotron",
        "messages": [{"role": "user", "content": "hi"}],
        "max_tokens": 10
    }, headers={"Authorization": "Bearer TEST"}, timeout=10.0)
    print(f"Status: {res.status_code}")
    print(f"Body: {res.text}")
except Exception as e:
    print(f"Failed: {e}")