QVAC

Finance

qvac-finance-agent

A local-first crypto trading agent that reasons on-device and grounds every call in dual local RAG

ragtool-callingagents
qvac-finance-agent

Reading a coin's price is trivial; reasoning about it without shipping positions to a cloud API is not. qvac-finance-agent is a multi-agent pipeline that pulls live Hyperliquid market data, reasons over it with a fully on-device LLM, and grounds every call in local RAG and a private trade journal - with a testnet-only trading agent gated behind two explicit flags.

Seven agents, seven jobs

An analyst agent turns live data into a factual summary, with cross-run deltas pulled from a persisted snapshot rather than invented. A RAG agent retrieves from a local knowledge base with EmbeddingGemma-300M. A signal agent emits a GBNF-constrained JSON object so the structured output is always valid. A scanner sweeps the whole perp universe for anomalies, an orchestrator lets the model pick which Hyperliquid tool to call, a journal agent runs RAG over a private trading journal, and a psy agent - running on MedGemma-4B, QVAC's medical model - reviews a signal for FOMO or over-leverage before a trader agent turns it into a risk-sized order.

architecture (README.md)
Hyperliquid public API  ──►  tools/hyperliquid.js  ──►  tools/market.js (tool calling)

   data/ (knowledge base) ──► agents/rag.js  ──────────────┤

                          agents/analyst.js  ──►  agents/signal.js
                          (factual summary)       (structured signal)
                                   └──── all inference via lib/qvac.js → @qvac/sdk ───┘

                                                   logs/run-*.jsonl (evidence)

Tool calling, the honest way

Native tool-call token emission wasn't reliable on sub-8B models on this SDK build, so the orchestrator uses GBNF-constrained tool selection instead: the model's decision is forced into valid JSON - {action:"call_tool",tool,arguments} or {action:"final",answer} - which stays deterministic even on a 1B model.

Demo video

Why it's evidence-first

  • Every inference call and market fetch is logged with timestamps, tokens/sec, and model name

  • Cross-run deltas (open interest, price) come from a persisted snapshot, never invented by the model

  • The trading agent is testnet-only and dry-run unless both --execute and --confirm are passed

Build this

Ship your own local AI

One install in JavaScript or Python. 10+ AI tasks. Private, offline and free - on the hardware you already own.