Spaces:
Running
Running
| 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}") | |