Memory & RAG
~8 min readUpdated: December 2026

SubQ Savant 4M Context LLM: Subquadratic Sparse Attention Agents

SubQ Savant 4M Token Context Subquadratic Sparse Attention Architecture in Smoke Monkey

SubQ Savant (subq-savant-1.4) is a reasoning LLM by Subquadratic with a 4-million-token context window powered by Subquadratic Sparse Attention (SSA). Reaching 92.6 on RULER at 4M tokens and 84.5 on AA-LCR multi-document reasoning, it prices input at $0.10/1M, cached input at $0.01/1M, and output at $0.50/1M—20x cheaper output than Sonnet 5.5.

Technical Review: Smoke Monkey Core Architecture Team
Tested on Node.js 18+ & BunTypeScript 5.x
Quick Answer & Executive Definition

SubQ Savant 4M Context LLM: Subquadratic Sparse Attention Agents: SubQ Savant (subq-savant-1.4) is a reasoning LLM by Subquadratic with a 4-million-token context window powered by Subquadratic Sparse Attention (SSA). Reaching 92.6 on RULER at 4M tokens and 84.5 on AA-LCR multi-document reasoning, it prices input at $0.10/1M, cached input at $0.01/1M, and output at $0.50/1M—20x cheaper output than Sonnet 5.5. Designed as a zero-dependency, open-source TypeScript architecture under the MIT License with native Model Context Protocol (MCP) support and deterministic phase state machines.

Key Architectural Takeaways
Quick Implementation Examplesubq-savant-monorepo-agent.ts
subq-savant-monorepo-agent.tstypescript
import { createAgent } from '@smoke-monkey/harness';
// Long-horizon monorepo reasoning agent using SubQ Savant's 4M context window
const agent = createAgent({
agentId: 'subq-savant-repo-auditor',
provider: 'openai-compatible',
baseUrl: 'https://api.subq.ai/v1',
apiKey: process.env.SUBQ_API_KEY,
model: 'subq-savant-1.4',
workspacePath: process.cwd(),
permissions: {
read_file: 'allow',
write_file: 'ask',
run_command: 'ask',
},
});
async function main() {
const result = await agent.run(
'Load the repository dependency graph and trace all cross-package auth middleware boundaries without truncating logs.'
);
console.log('4M-context audit:', result.summary);
}
main().catch(console.error);
Video Guides

Watch: Related Video Guides

DeepSeek Sparse Attention Explained: 80% Cheaper Long-Context AI

AI Interview #6 - 1M context window in LLM?

What Is SubQ Savant and Subquadratic Sparse Attention?

SubQ Savant (subq-savant-1.4) is a 4-million-token reasoning model developed by Subquadratic using Subquadratic Sparse Attention (SSA). Instead of computing dense all-to-all token attention—which scales quadratically to 1,157 PFLOP at long contexts—SSA selectively isolates high-signal token dependencies in 2.0 PFLOP, preserving complete multi-hour agent histories and entire repositories in context.

ModelMax ContextRULER @ 4MAA-LCR avg@3DeepSWE avg@4GPQA DiamondInput / Cached / Output ($/1M)
SubQ Savant 1.44M92.684.566.492.4$0.10 / $0.01 / $0.50
Sonnet 5.51M—82.271.095.6$2.00 / $0.10 / $10.00
Haiku 5.51M—81.859.989.6$0.50 / $0.05 / $2.50
Luna 61M—84.266.690.5$0.20 / $0.02 / $0.75
Hydrogen1M—72.3—96.8$1.50 / $0.075 / $7.50

Eliminating Lossy Context Compaction in Coding Agents

Most coding harnesses fail on multi-hour tasks because sliding-window eviction or LLM summarization discards subtle stack traces and prior failed edits. At $0.01 per 1M cached input tokens, Savant makes full-history retention cheaper than running periodic summary passes:

  1. Zero-Eviction Tool Logs: Retain every compiler diagnostic, git diff, and MCP response verbatim across 100+ turn debugging sessions.
  2. Whole-Repo Cross-Referencing: On LongBench V2 (8K–2M range), Savant scores 68 while outperforming dense frontier models on AA-LCR multi-document reasoning (84.5 vs. 82.2 for Sonnet 5.5).
  3. Production Teams: Teams like Pen.dev and CRED run Savant for multi-document financial filing analysis and design-canvas agent memory at roughly 1/20th the token bill.

Structure Static Repo Context First for 90% Cache Savings

Place immutable repository files and schema definitions at the prefix of the prompt before dynamic user turns so subsequent harness iterations hit the $0.01/1M cached input rate.

Reproducible OpenAI SDK & cURL Integration

Call SubQ Savant using the standard openai Python or TypeScript SDK by overriding base_url to https://api.subq.ai/v1:

bash
pip install openai
export SUBQ_API_KEY="your_subq_key"
python
from openai import OpenAI
import os

client = OpenAI(
    base_url="https://api.subq.ai/v1",
    api_key=os.environ["SUBQ_API_KEY"],
)

with open("monorepo_bundle.txt") as f:
    entire_repo = f.read()

response = client.responses.create(
    model="subq-savant-1.4",
    input=entire_repo + "\n\nWhere is auth token verification handled across services?",
)
print(response.output_text)
Google Search Questions & Answers

Frequently Asked Questions

Q:How does SubQ Savant achieve a 4M context window at $0.10 per 1M tokens?

SubQ replaces quadratic dense self-attention with Subquadratic Sparse Attention (SSA), which isolates only high-value token relationships and reduces compute from 1,157 PFLOP to 2.0 PFLOP.

Q:What API format does SubQ Savant use?

SubQ Savant exposes an OpenAI-compatible endpoint at https://api.subq.ai/v1 supporting client.responses.create with model subq-savant-1.4.

Q:Does accuracy hold up across the full 4 million tokens?

Yes. SubQ reports 92.6 on RULER at 4M tokens across 13 retrieval and aggregation tasks, and 84.5 on AA-LCR avg@3 multi-document reasoning.

Q:When should I still pair Savant with vector RAG?

Use vector retrieval when corpora exceed 4M tokens (hundreds of millions of rows) or require sub-50ms filtering; inside 4M tokens, Savant processes raw documents directly without chunking.

Related Alternatives & Comparisons

Related Architecture Guides

View all guides

Build with Smoke Monkey Harness

Zero dependencies. 24 built-in tools. Human-in-the-loop safety. 100% open source under the MIT License.

npm install smoke-monkey-harness