Speed bot refinements, MLX standardization

This commit is contained in:
drjones
2026-08-04 00:49:37 -07:00
parent 2f0e2333df
commit b9a67ff976
2 changed files with 5 additions and 4 deletions

View File

@@ -23987,3 +23987,4 @@ sqlite3.OperationalError: no such column: id
2026-08-04 00:08:23,619 skip KXBNB15M-26AUG040315-15: BTC +1.6% 24h — no counter-trend shorts (conf 0.65<0.78) 2026-08-04 00:08:23,619 skip KXBNB15M-26AUG040315-15: BTC +1.6% 24h — no counter-trend shorts (conf 0.65<0.78)
2026-08-04 00:08:33,518 skip KXBTC15M-26AUG040315-15: BTC +1.6% 24h — no counter-trend shorts (conf 0.65<0.78) 2026-08-04 00:08:33,518 skip KXBTC15M-26AUG040315-15: BTC +1.6% 24h — no counter-trend shorts (conf 0.65<0.78)
2026-08-04 00:08:42,688 skip KXZEC15M-26AUG040315-15: passes: [split qwen=SKIP(0.50) ornith=SKIP(0.50)] Extreme fear + choppy regime, no clear edge 2026-08-04 00:08:42,688 skip KXZEC15M-26AUG040315-15: passes: [split qwen=SKIP(0.50) ornith=SKIP(0.50)] Extreme fear + choppy regime, no clear edge
2026-08-04 00:48:16,761 127.0.0.1 - - [04/Aug/2026 00:48:16] "GET /health HTTP/1.1" 404 -

8
bot.py
View File

@@ -36,7 +36,7 @@ DEFAULT_CFG = {
"swing_threshold_pct": 0.12, # fade triggers when |weighted 15m move| >= this "swing_threshold_pct": 0.12, # fade triggers when |weighted 15m move| >= this
"learning": True, "learning": True,
"ollama_url": "http://localhost:11434", "ollama_url": "http://localhost:11434",
"ollama_model": "qwen3.5:4b", "ollama_model": "qwen3.5:4b-mlx",
"series": "KXBTC15M", "series": "KXBTC15M",
"kill": False, "kill": False,
} }
@@ -330,7 +330,7 @@ def llm_vote(cfg, price, mom, mom_score, conn):
prompt = enriched_context(cfg, price, mom, mom_score, conn) prompt = enriched_context(cfg, price, mom, mom_score, conn)
try: try:
fast_url = cfg.get("fast_llm_url", cfg.get("ollama_url","http://localhost:11434")) fast_url = cfg.get("fast_llm_url", cfg.get("ollama_url","http://localhost:11434"))
fast_model = cfg.get("fast_llm_model", "qwen3.5:4b") fast_model = cfg.get("fast_llm_model", "qwen3.5:4b-mlx")
r1 = requests.post(fast_url+"/api/generate", r1 = requests.post(fast_url+"/api/generate",
json={"model": fast_model, "prompt": prompt, "stream": False, "think": False, "keep_alive": "10m", json={"model": fast_model, "prompt": prompt, "stream": False, "think": False, "keep_alive": "10m",
"options": {"temperature": 0.3, "num_predict": 60}}, timeout=8, "options": {"temperature": 0.3, "num_predict": 60}}, timeout=8,
@@ -608,7 +608,7 @@ def adapt_controls(conn, cfg):
try: try:
fast_url = cfg.get("fast_llm_url", "http://localhost:11434") fast_url = cfg.get("fast_llm_url", "http://localhost:11434")
r = requests.post(fast_url+"/api/generate", r = requests.post(fast_url+"/api/generate",
json={"model": cfg.get("fast_llm_model","qwen3.5:4b"), "prompt": prompt, json={"model": cfg.get("fast_llm_model","qwen3.5:4b-mlx"), "prompt": prompt,
"stream": False, "think": False, "options": {"temperature": 0.1, "num_predict": 80}}, "stream": False, "think": False, "options": {"temperature": 0.1, "num_predict": 80}},
timeout=10) timeout=10)
txt = r.json().get("response","") txt = r.json().get("response","")
@@ -628,7 +628,7 @@ def adapt_controls(conn, cfg):
) )
try: try:
r3 = requests.post(fast_url+"/api/generate", r3 = requests.post(fast_url+"/api/generate",
json={"model": cfg.get("fast_llm_model","qwen3.5:4b"), "prompt": lp, json={"model": cfg.get("fast_llm_model","qwen3.5:4b-mlx"), "prompt": lp,
"stream": False, "think": False, "options": {"temperature": 0.1, "num_predict": 60}}, "stream": False, "think": False, "options": {"temperature": 0.1, "num_predict": 60}},
timeout=10) timeout=10)
txt3 = r3.json().get("response","") txt3 = r3.json().get("response","")