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

8
bot.py
View File

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