Spaces:
Paused
Paused
Download run_openhands.py from adityaxess/deepseek-proxy: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/adityaxess/deepseek-proxy/resolve/main/run_openhands.py
- Command line
-
hf download hf://spaces/adityaxess/deepseek-proxy/run_openhands.py
-
curl -L -o run_openhands.py https://huggingface.co/spaces/adityaxess/deepseek-proxy/resolve/main/run_openhands.py
1.2 kB
| """ | |
| OpenHands Agent Server Custom Launcher Script. | |
| Launches OpenHands Agent Server configured to route LLM requests through the local proxy server (http://127.0.0.1:8000/v1). | |
| """ | |
| import os | |
| import sys | |
| import subprocess | |
| def launch_openhands(model_name: str = "deepseek-v3-r1", port: int = 8005): | |
| print("=" * 65) | |
| print("🚀 LAUNCHING OPENHANDS AGENT SERVER") | |
| print(f"Target LLM Model : openai/{model_name}") | |
| print(f"Base LLM Server URL: http://127.0.0.1:8000/v1") | |
| print(f"OpenHands Agent Port: http://127.0.0.1:{port}") | |
| print("=" * 65) | |
| os.environ["LLM_MODEL"] = f"openai/{model_name}" | |
| os.environ["LLM_BASE_URL"] = "http://127.0.0.1:8000/v1" | |
| os.environ["LLM_API_KEY"] = "secret_bearer_token" | |
| os.environ["WORKSPACE_BASE"] = "/home/adi/deepseek/openhands_workspace" | |
| os.makedirs("/home/adi/deepseek/openhands_workspace", exist_ok=True) | |
| agent_bin = "/home/adi/deepseek/venv/bin/agent-server" | |
| cmd = [agent_bin, "--port", str(port)] + sys.argv[1:] | |
| subprocess.run(cmd, env=os.environ) | |
| if __name__ == "__main__": | |
| target_m = sys.argv[1] if len(sys.argv) > 1 and not sys.argv[1].startswith("-") else "deepseek-v3-r1" | |
| launch_openhands(target_m) | |