SubQ Quick Brief
When to use SubQ's long-context architecture — 12M-token windows, SSA attention, API setup, and workflows for repos, research, and agent state.
What SubQ is
SubQ is a long-context language model from Subquadratic built on Subquadratic Sparse Attention (SSA). Standard transformers scale quadratically with context — every token attends to every other token. SSA routes attention to relevant token pairs only, so compute and memory grow roughly linearly. The result: multi-million-token context windows at practical cost.
SubQ is not a chatbot upgrade. It is infrastructure for workloads where the answer lives across an entire artifact — a repo, a contract bundle, a research corpus, or months of agent history.
Product lineup
| Product | Interface | Best for |
|---|---|---|
| SubQ API | OpenAI-compatible REST | Custom apps, enterprise pipelines |
| SubQ Code | CLI coding agent | Full-repo planning and edits in one pass |
| SubQ Search | Chat + deep research | Long-document Q&A at speed |
Access is rolling out via early-access request at subq.ai.
When SubQ wins (and when it does not)
Use SubQ when:
- You need the whole repo in context, not RAG chunks
- Retrieval pipelines keep missing cross-file dependencies
- Agent sessions exceed 200K tokens and quality degrades
- You are paying heavily to re-ingest the same corpus every call
Skip SubQ when:
- Short prompts and quick replies suffice
- A well-tuned RAG stack already hits your accuracy bar
- Latency under 2 seconds matters more than context breadth
- You have not exhausted cheaper fixes (better chunking, hybrid search)
Architecture in one paragraph
Dense attention at 1M tokens is ~1,000× more expensive than SSA at the same length (per Subquadratic's benchmarks). SSA learns content-dependent routing: which tokens actually need to talk to which. Training runs at 2M tokens with retrieval performance extending toward 12M in exploratory evals. The model family builds on open base weights with SSA applied — not a from-scratch frontier trainer, but a real architectural change at the attention layer.
API quick start (OpenAI-compatible)
Once you have API access:
export SUBQ_API_KEY="your-key"
export SUBQ_BASE_URL="https://api.subq.ai/v1" # confirm in your onboarding docs
from openai import OpenAI
client = OpenAI(api_key=os.environ["SUBQ_API_KEY"], base_url=os.environ["SUBQ_BASE_URL"])
response = client.chat.completions.create(
model="subq-1.1-small",
messages=[
{"role": "system", "content": "You analyze full codebases. Cite file paths."},
{"role": "user", "content": repo_context + "\n\nWhere is auth handled?"}
],
max_tokens=4096,
)
Load repo context from a single concatenated dump or structured file tree + contents. SubQ Code automates this for CLI workflows.
SubQ Code workflow
- Point CLI at repo root
- Agent loads entire codebase into one context window
- Ask cross-cutting questions: "Trace payment flow end-to-end"
- Request multi-file plans before edits
- Review diffs — long context does not mean perfect code
Pair with your existing editor (Claude Code, Cursor, Codex) as a context layer for map-reduce questions that normally require five agent hops.
SubQ Search workflow
- Upload or paste document set (PDFs, reports, transcripts)
- Ask synthesis questions: "What contradictions exist across these filings?"
- Request citations with page or section references
- Export brief for team review
Treat output as a research accelerator, not a final legal or compliance opinion.
Evaluation checklist (before committing)
Run your own needle-in-haystack tests:
- Hide a unique string in file 400 of 500 — can the model retrieve it?
- Ask a question requiring facts from three distant sections
- Compare cost vs. your current RAG pipeline at equal accuracy
- Measure prefill latency at your target context length
- Test on your actual repo, not a demo notebook
Cost framing
Linear scaling means million-token calls become economically viable where dense models would be prohibitive. Calculate:
Cost per task = (input tokens + output tokens) × price per token
Tasks per month × cost per task = monthly spend
If whole-repo analysis replaces 10 chunked calls that each re-upload context, SubQ often wins on total cost and coherence.
SubQ is built for workloads where context is the bottleneck. Run your own needle-in-haystack eval before committing. If short prompts are your constraint, fix that first.