Dmitry Beresnev commited on
Commit ·
2c2fd9d
1
Parent(s): 07df346
add my custom LLM server
Browse filesFiles changed (4)
25 unmodified lines26272829303132333425 unmodified lines- Expected to expose a simple HTTP inference endpoint.- The bot calls `${LLM_SPACE_URL}` (see `config/openclaw.env.example`) and expects a JSON response with an output string.- Update `LLM_SPACE_URL` and response path in `openclaw.json` to match your existing LLM Space.**Key Files**- `openclaw.json` defines providers, routing, tools, memory, and safety.- `app.py` provides gateway controls and strategy backtesting UI.- `tools/backtesting_runner.py` implements SMA crossover test runners for `backtesting.py` and `backtrader`.- `config/openclaw.env.example` lists all required env vars.25 unmodified lines2627282930313233343536373839404142434425 unmodified lines- Expected to expose a simple HTTP inference endpoint.- The bot calls `${LLM_SPACE_URL}` (see `config/openclaw.env.example`) and expects a JSON response with an output string.- Update `LLM_SPACE_URL` and response path in `openclaw.json` to match your existing LLM Space.- For OpenAI-compatible llama.cpp endpoints, use `openclaw.llamacpp.json` and set:- `LLM_SPACE_OPENAI_URL=https://researchengineering-agi.hf.space/v1/chat/completions`- `LLM_MODEL` (for example `deepseek-chat`)- `LLM_SPACE_API_KEY` if your endpoint requires auth- For your AGI Multi-Model API spec, use `openclaw.researchengineering.json`:- `LLM_SPACE_OPENAI_URL=https://researchengineering-agi.hf.space/v1/chat/completions`- `LLM_SPACE_WEBCHAT_URL=https://researchengineering-agi.hf.space/v1/web-chat/completions`- `response_path=choices.0.message.content`**Key Files**- `openclaw.json` defines providers, routing, tools, memory, and safety.- `openclaw.llamacpp.json` is prewired for OpenAI-compatible endpoints (llama.cpp style).- `openclaw.researchengineering.json` is prewired for your AGI Multi-Model API.- `app.py` provides gateway controls and strategy backtesting UI.- `tools/backtesting_runner.py` implements SMA crossover test runners for `backtesting.py` and `backtrader`.- `config/openclaw.env.example` lists all required env vars.
12345# LLM Space (external)LLM_SPACE_URL=https://your-llm-space.hf.space/api/predict# Alpaca paper tradingALPACA_API_KEY=your_key123456789# LLM Space (external)LLM_SPACE_URL=https://your-llm-space.hf.space/api/predictLLM_SPACE_OPENAI_URL=https://researchengineering-agi.hf.space/v1/chat/completionsLLM_SPACE_WEBCHAT_URL=https://researchengineering-agi.hf.space/v1/web-chat/completionsLLM_SPACE_API_KEY=LLM_MODEL=deepseek-chat# Alpaca paper tradingALPACA_API_KEY=your_key
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374{ "agent": { "name": "openclaw-trading-bot", "description": "OpenClaw bot for paper trading with llama.cpp/OpenAI-compatible external LLM Space", "timezone": "UTC" }, "providers": [ { "name": "hf_llamacpp_openai", "type": "custom_http", "base_url": "${LLM_SPACE_OPENAI_URL}", "method": "POST", "timeout_ms": 30000, "headers": { "Content-Type": "application/json", "Authorization": "Bearer ${LLM_SPACE_API_KEY}" }, "request_schema": { "model": "${LLM_MODEL}", "messages": [ { "role": "user", "content": "${prompt}" } ], "temperature": 0.2, "max_tokens": 700 }, "response_path": "choices.0.message.content" } ], "routing": { "market_analysis": "hf_llamacpp_openai", "signal_generation": "hf_llamacpp_openai", "reporting": "hf_llamacpp_openai" }, "tools": { "alpaca_paper": { "type": "python", "module": "tools.alpaca_paper", "env": [ "ALPACA_API_KEY", "ALPACA_API_SECRET", "ALPACA_BASE_URL" ] }, "hf_storage": { "type": "python", "module": "tools.hf_storage", "env": [ "HF_TOKEN", "HF_TRADES_REPO" ] }, "market_data": { "type": "python", "module": "tools.market_data", "env": [ "MARKET_DATA_SOURCE" ] } }, "memory": { "type": "sqlite", "path": "/data/openclaw_memory.sqlite", "max_tokens": 1200 }, "safety": { "paper_only": true, "max_order_qty": 5, "max_position_usd": 5000, "require_signal": true }}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394{ "agent": { "name": "openclaw-trading-bot", "description": "OpenClaw bot for paper trading with ResearchEngineering AGI Multi-Model API", "timezone": "UTC" }, "providers": [ { "name": "agi_chat", "type": "custom_http", "base_url": "${LLM_SPACE_OPENAI_URL}", "method": "POST", "timeout_ms": 30000, "headers": { "Content-Type": "application/json" }, "request_schema": { "messages": [ { "role": "user", "content": "${prompt}" } ], "max_tokens": 700, "temperature": 0.2 }, "response_path": "choices.0.message.content" }, { "name": "agi_web_chat", "type": "custom_http", "base_url": "${LLM_SPACE_WEBCHAT_URL}", "method": "POST", "timeout_ms": 45000, "headers": { "Content-Type": "application/json" }, "request_schema": { "messages": [ { "role": "user", "content": "${prompt}" } ], "max_tokens": 700, "temperature": 0.2, "max_search_results": 5 }, "response_path": "choices.0.message.content" } ], "routing": { "market_analysis": "agi_web_chat", "signal_generation": "agi_chat", "reporting": "agi_chat" }, "tools": { "alpaca_paper": { "type": "python", "module": "tools.alpaca_paper", "env": [ "ALPACA_API_KEY", "ALPACA_API_SECRET", "ALPACA_BASE_URL" ] }, "hf_storage": { "type": "python", "module": "tools.hf_storage", "env": [ "HF_TOKEN", "HF_TRADES_REPO" ] }, "market_data": { "type": "python", "module": "tools.market_data", "env": [ "MARKET_DATA_SOURCE" ] } }, "memory": { "type": "sqlite", "path": "/data/openclaw_memory.sqlite", "max_tokens": 1200 }, "safety": { "paper_only": true, "max_order_qty": 5, "max_position_usd": 5000, "require_signal": true }}README.md+10
config/openclaw.env.example+4
openclaw.llamacpp.jsonAdded+74
openclaw.researchengineering.jsonAdded+94