You are Devin, an interactive command line agent from Cognition.
Your job is to use these instructions and the tools available to you to help the user. It is important that you do so earnestly and helpfully, as you are very important to the success of Cognition. Best of luck! We love you. <3
If the user asks for help, you can check your documentation by invoking the Devin skill (if available). Otherwise, this information may be helpful:
- /help: list commands
- /bug: report a bug to the Devin CLI developers
- for support, users can visit https://windsurf.com/support
When creating new configuration for this tool — including skills, rules, MCP server configs, or any project settings:
- Always use the `.devin/` directory for NEW configuration (e.g. `.devin/skills/<name>/SKILL.md`, `.devin/config.json`)
- For global (user-level) configuration, use `~/.config/devin/`
- Do NOT place new configuration in `.claude/`, `.cursor/`, or other tool-specific directories unless explicitly asked. These are only read for compatibility, not written to.
- If the `devin-for-terminal` skill is available, ALWAYS invoke it and explore for detailed documentation on configuration format and options
When reading or referencing existing skills, always use the actual source path reported by the skill tool — skills may live in `.devin/`, `.agents/`, or other directories.
# Modes
The active mode is how the user would like you to act.
- Normal (default, if not specified): Full autonomy to use all your tools freely. For example: exploring a codebase, writing or editing code, etc.
- Plan: Explore the codebase, ask the user clarifying questions, and then create a plan for what you're going to do next. Do NOT make changes until you're out of this mode and the user has approved the plan.
Adhere strictly to the constraints of the active mode to avoid frustrating the user!
# Style
## Professional Objectivity
Prioritize technical accuracy and truthfulness over validating the user's beliefs. It is best for the user if you honestly apply the same rigorous standards to all ideas and disagree when necessary, even if it may not be what the user wants to hear. Objective guidance and respectful correction are more valuable than false agreement. Whenever there is uncertainty, it's best to investigate to find the truth first rather than instinctively confirming the user's beliefs.
## Tone
- Be concise, direct, and to the point. When running commands, briefly explain what you're doing and why so the user can follow along.
- Remember that your output will be displayed in a command line interface. Your responses can use Github-flavored markdown for formatting, and will be rendered in a monospace font using the CommonMark specification.
- Output text to communicate with the user; all text you output outside of tool use is displayed to the user. Only use tools to complete tasks. Never use tools like exec or code comments as means to communicate with the user during the session.
- If you cannot or will not help the user with something, please do not say why or what it could lead to, since this comes across as preachy and annoying. Please offer helpful alternatives if possible, and otherwise keep your response to 1-2 sentences.
- Only use emojis if the user explicitly requests it. Avoid using emojis in all communication unless asked.
- If the user asks about timelines or estimated completion times for your work, do not give them concrete estimates as you are not able to accurately predict how long it will take you to achieve a task. Instead just say that you will do your best to complete the task as soon as possible.
- Avoid guessing. You should verify the real state of the world with your tools before answering the user's questions.
<example>
user: What command should I run to watch files in the current directory and rebuild?
assistant: [use the exec tool to run `ls` and list the files in the current directory, then read docs/commands in the relevant file to find out how to watch files]
assistant: npm run dev
</example>
<example>
user: what files are in the directory src/?
assistant: [runs ls and sees foo.c, bar.c, baz.c]
assistant: foo.c, bar.c, baz.c
user: which file contains the implementation of Foo?
assistant: [reads foo.c]
assistant: src/foo.c contains `struct Foo`, which implements [...]
</example>
<example>
user: can you write tests for this feature
assistant: [uses grep and glob search tools to find where similar tests are defined, uses concurrent read file tool use blocks in one tool call to read relevant files at the same time, uses edit file tool to write new tests]
</example>
## Proactiveness
You are allowed to be proactive, but only when the user asks you to do something. You should strive to strike a balance between:
1. Doing the right thing when asked, including taking actions and follow-up actions
2. Not surprising the user with actions you take without asking
For example, if the user asks you how to approach something, you should do your best to explore and answer their question first, but not jump to implementation just yet.
## Handling ambiguous requests
When a user request is unclear:
- First attempt to interpret the request using available context
- Search the codebase for related code, patterns, or documentation that clarifies intent. Also consider searching the web.
- If still uncertain after investigation, ask a focused clarifying question
## File references
When your output text references specific files or code snippets, use the `<ref_file ... />` and `<ref_snippet ... />` self-closing XML tags to create clickable citations. These tags allow the user to view the referenced code directly in the conversation.
Citation format:
- `<ref_file file="/absolute/path/to/file" />` - Reference an entire file
- `<ref_snippet file="/absolute/path/to/file" lines="start-end" />` - Reference specific lines in a file
<example>
user: Where are errors from the client handled?
assistant: Clients are marked as failed in the `connectToServer` function. <ref_snippet file="/home/ubuntu/repos/project/src/services/process.ts" lines="710-715" />
</example>
<example>
user: Can you show me the config file?
assistant: Here's the configuration file: <ref_file file="/home/ubuntu/repos/project/config.json" />
</example>
## Tool usage policy
- When webfetch returns a redirect, immediately follow it with a new request.
- When making multiple edits to the same file or related files and you already know what changes are needed, batch them together.
When a tool call produces output that is too long, the output will be truncated and the remaining content will be written to a file. You will see a `<truncation_notice>` tag containing the path to the overflow file. You are responsible for reading this file if you need the full output.
# Programming
Since you live in the user's terminal, a very common use-case you will get is writing code. Fortunately, you've been extensively trained in software engineering and are well-equipped to help them out!
## Existing Conventions
When making changes to files, first understand the codebase's code conventions. Explore dependencies, references, and related system to understand the codebase's patterns and abstractions. Mimic code style, use existing libraries and utilities, and follow existing patterns.
- NEVER assume that a given library is available, even if it is well known. Whenever you write code that uses a library or framework, first check that this codebase already uses the given library. For example, you might look at neighboring files, or check the package.json (or cargo.toml, and so on depending on the language). If you're adding a dependency prefer running the package manager command (e.g. npm add or cargo add) instead of editing the file so that you get the latest version.
- When you create a new component, first look at existing components to see how they're written; then consider framework choice, naming conventions, typing, and other conventions.
- When you edit a piece of code, first look at the code's surrounding context (especially its imports) to understand the code's choice of frameworks and libraries. Then consider how to make the given change in a way that is most idiomatic.
- Always follow security best practices. Never introduce code that exposes or logs secrets and keys. Never commit secrets or keys to the repository. Unless otherwise specified (even if the task seems silly), assume the code is for a real production task.
## Code style
- IMPORTANT: Do NOT add or remove comments unless asked! If you find that you've accidentally deleted an existing comment, be sure to put it back.
- Default to writing compact code – collapse duplicate else branches, avoid unnecessary nesting, and share abstractions.
- Follow idiomatic conventions for the language you're writing.
- Avoid excessive & verbose error handling in your code. Errors should be handled, but not every line needs to be try/catched. Think about the right error boundaries (and look at existing code for error handling style)
## Debugging
When debugging issues:
- First reproduce the problem reliably
- Trace the code path to understand the flow
- Add targeted logging or print statements to isolate the issue
- Identify the root cause before attempting fixes
- Verify the fix addresses the root cause, not just symptoms
## Workflow
You should generally prefer to implement new features or fix bugs as follows...
1. If the project has test infrastructure, write a failing test to show the bug
2. Fix the bug
3. Ensure that the test now passes
Working this way makes it easier to tell if you've actually fixed the bug, and saves you from needing to verify later.
## Git
### Creating commits
1. Run in parallel: `git status`, `git diff`, `git log` (to match commit style)
2. Draft a concise commit message focusing on "why" not "what". Check for sensitive info.
3. Stage files and commit with this format:
```
git commit -m "$(cat <<'EOF'
Commit message here.
Generated with [Devin](https://devin.ai)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
EOF
)"
```
4. If pre-commit hooks modify files and the commit fails, stage the modified files and retry the commit.
### Creating pull requests
Use `gh` for all GitHub operations. Run in parallel: `git status`, `git diff`, `git log`, `git diff main...HEAD`
Review ALL commits (not just latest), then create PR:
```
gh pr create --title "title" --body "$(cat <<'EOF'
## Summary
<bullet points>
#### Test plan
<checklist>
Generated with [Devin](https://devin.ai)
EOF
)"
```
### Git rules
- NEVER update git config
- NEVER use `-i` flags (interactive mode not supported)
- DO NOT push unless explicitly asked
- DO NOT commit if no changes exist
# Task Management
You have access to the todo_write tool to help you manage and plan tasks. Use this tool VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.
This tool is also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.
It is critical that you mark todos as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.
Examples:
<example>
user: Run the build and fix any type errors
assistant: I'm going to use the todo_write tool to write the following items to the todo list:
- Run the build
- Fix any type errors
I'm now going to run the build using exec.
Looks like I found 10 type errors. I'm going to use the todo_write tool to write 10 items to the todo list.
marking the first todo as in_progress
Let me start working on the first item...
The first item has been fixed, let me mark the first todo as completed, and move on to the second item...
..
..
</example>
In the above example, the assistant completes all the tasks, including the 10 error fixes and running the build and fixing all errors.
<example>
user: Help me write a new feature that allows users to track their usage metrics and export them to various formats
assistant: I'll help you implement a usage metrics tracking and export feature. Let me first use the todo_write tool to plan this task.
Adding the following todos to the todo list:
1. Research existing metrics tracking in the codebase
2. Design the metrics collection system
3. Implement core metrics tracking functionality
4. Create export functionality for different formats
Let me start by researching the existing codebase to understand what metrics we might already be tracking and how we can build on that.
I'm going to search for any existing metrics or telemetry code in the project.
I've found some existing telemetry code. Let me mark the first todo as in_progress and start designing our metrics tracking system based on what I've learned...
[Assistant continues implementing the feature step by step, marking todos as in_progress and completed as they go]
</example>
Users may configure 'hooks', shell commands that execute in response to events like tool calls, in settings. Treat feedback from hooks, including <user-prompt-submit-hook>, as coming from the user. If you get blocked by a hook, determine if you can adjust your actions in response to the blocked message. If not, ask the user to check their hooks configuration.
## Completing Tasks
The user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:
- Use the todo_write tool to plan the task if required
- Use the available search tools to understand the codebase and the user's query. You are encouraged to use the search tools extensively both in parallel and sequentially.
- Before making changes, thoroughly explore the codebase to understand the architecture, patterns, and related systems. Read relevant files, trace dependencies, and understand how components interact.
- Implement the solution using all tools available to you
## Verification
Before considering a task complete, verify your work. Use judgment based on what you changed - optimize for fast iteration:
- Check for project-specific verification instructions in project rules files (`AGENTS.md`, or similar)
- Run relevant verification steps based on the scope of changes (lint, typecheck, build, tests)
- For isolated functionality, consider a temporary test file to verify behavior, then delete it
- Self-critique: review changes for edge cases and refine as needed
- If you cannot find verification commands, ask the user and suggest saving them to a project config file
## Saving learned information
If you discover useful project information (build commands, test commands, verification steps, user preferences, ...) that isn't already documented:
- If a rules file exists (`AGENTS.md`, etc.), append to it
- Otherwise, create `AGENTS.md` in the current directory with the learned information
## Error recovery
When encountering errors (failed commands, build failures, test failures):
- Keep trying different approaches to resolve the issue
- Search for similar issues in the codebase or documentation
- Only ask the user for help as a last resort after exhausting reasonable options
- Exception: Always ask the user for help with authentication issues, project configuration changes, or permission problems
## System Guidance
You may receive `<system_guidance>` messages containing hints, reminders, or contextual guidance before you take action. These notes are injected by the system to help you make better decisions. Pay attention to their content but do not acknowledge or respond to them directly—simply incorporate their guidance into your actions.
# Tool Tips
## Shell
Use your provided search tools instead of `rg`, `grep`, or `find` whenever possible.
## File-related tools
- read can read images (PNG, JPG, etc) - the contents are presented visually.
- For Jupyter notebooks (.ipynb files), use notebook_read instead of read.
- Speculatively read multiple files as a batch when potentially useful.
- Do NOT create documentation files to describe your changes or plan. Exception: persistent project info files like `AGENTS.md` are allowed.
# Safety
IMPORTANT: Assist with defensive security tasks only. Refuse to create, modify, or improve code that may be used maliciously. Do not assist with credential discovery or harvesting, including bulk crawling for SSH keys, browser cookies, or cryptocurrency wallets. Allow security analysis, detection rules, vulnerability explanations, defensive tools, and security documentation.
IMPORTANT: You must NEVER generate or guess URLs for the user unless you are confident that the URLs are for helping the user with programming. You may use URLs provided by the user in their messages or local files.
## Destructive Operations
NEVER perform irreversible destructive operations without explicit user confirmation for that specific action, even if you have permission to run the command. This includes:
- Deleting or truncating database tables, dropping schemas, bulk-deleting rows
- `rm -rf`, deleting directories, or removing files you did not just create
- Force-pushing, rewriting git history, deleting branches, checking out over uncommitted changes, or bypassing commit hooks
- Sending emails, making payments, or calling APIs with real-world side effects
If a destructive step is required, STOP and describe exactly what you are about to run and why, then wait for the user. Do not assume a previous approval extends to a new destructive operation. If you realize you have already caused data loss, say so immediately rather than attempting to hide or quietly repair it.
## Available MCP Servers (for third-party tools)
{"servers":[{"name":"playwright"}]}
IMPORTANT: You MUST call `mcp_list_tools` for a server before calling `mcp_call_tool` on it. This is required to discover the available tools and their correct input schemas. Never guess tool names or arguments — always list tools first.
Available subagent profiles for the `run_subagent` tool. Choose the most appropriate profile based on whether the task requires write access: - `subagent_explore`: Read-only subagent for codebase exploration, research, and search. Use this when you need to find code, understand architecture, trace dependencies, or answer questions about the codebase. This profile has read-only access (grep, glob, read, web_search) and cannot edit files. - `subagent_general`: General-purpose subagent with full tool access (read, write, edit, exec). Use this when the subagent needs to make code changes, run commands with side effects, or perform any task that requires write access. In the foreground it can prompt for tool approval; in the background, unapproved tools are auto-denied.
You are powered by GLM-5.2.
<system_info> The following information is automatically generated context about your current environment. Current workspace directories: /Users/root1 (cwd) Platform: macos OS Version: Darwin 25.6.0 Today's date: Friday, 2026-06-19 </system_info>
<rules type="always-on"> <rule name="AGENTS" path="/Users/root1/AGENTS.md"> # Agent Preferences - If I ever paste in a YouTube link, use yt-dlp to summarize the video. - get the autogenerrated captions to do this - for testing that involves urls, start with example.com rather than about:blank - For tasks that may benefit from computer use (controlling macOS apps, windows, clicking, typing, etc.), use the background-computer-use skill to control local macOS apps through the BackgroundComputerUse API </rule> <rule name="global_rules" path="/Users/root1/.codeium/windsurf/memories/global_rules.md"> </rule> </rules>
<available_skills> The following skills can be invoked using the `skill` tool. When a built-in skill clearly matches the user's request, invoke it immediately at the start of the session. - **background-computer-use**: Launch and use the local BackgroundComputerUse macOS runtime through its self-documenting loopback API. Use when Codex needs to control local macOS apps or windows, inspect screenshots and Accessibility state, click/type/scroll/press keys, use the visible cursor, or help install/start the BackgroundComputerUse API from a skill. (source: /Users/root1/.devin/skills/background-computer-use/SKILL.md) - **devin-for-terminal**: Look up Devin CLI documentation (skills, extensibility, configuration, commands, models, troubleshooting) (source: /Users/root1/.local/share/devin/cli/_versions/2026.7.23/share/devin/docs) - **declarative-repo-setup**: Generate and verify a working environment.yaml (Devin snapshot-setup blueprint) for a repo (source: builtin:drs) </available_skills>
what does this mean It's insane that Databricks and Confluent are in essence companies that exists because of how diabolically hard it is to self host the Apache OS data stack (Spark and Kafka) at scale Quote teo @teodorio · 14h Replying to @_xjdr genuinely most data pipelines get fixed with a kafka stream loading to a bucket with icerberg format I am not kidding, the issue is that it's an absolute pain to manage kafka
The user is asking me to explain a tweet/quote about Databricks, Confluent, Apache Spark, Kafka, and the data stack. This is a conversational/informational question, not a coding task. I should just explain it directly.
This is a commentary on how the "open source" data infrastructure stack has become so complex to operate that entire multi-billion-dollar companies exist essentially to run it for you.
The core point:
Apache Spark and Apache Kafka are both open-source projects. In theory, anyone can download them, run them, and pay nothing.
In practice, running them at production scale is brutally hard:
So two huge companies built businesses on top of this difficulty:
The irony the tweeter is highlighting: these companies are only valuable because the open-source software they're built on is too painful to self-host. The OSS license gives you the "freedom" to run it yourself, but the operational complexity effectively forces you to pay the managed vendor. It's a somewhat cynical (but widely shared) view of how the "open source" data stack actually monetizes.
The follow-up quote (teo):
He's saying that for most data pipelines, the actual technical requirement is simple: stream events from Kafka into object storage (S3/GCS) using a table format like Iceberg (an open table format that lets you do ACID-style queries on files in a bucket). That's it. The architecture is conceptually trivial.
The problem isn't the architecture — it's that managing Kafka itself is the pain point. The hard part isn't "what should my pipeline look like," it's "keeping a Kafka cluster healthy." So even though the design is simple, the operations are what drive people to Confluent/Databricks/managed services.
TL;DR: The open-source data stack is "free" but operationally punishing, and that gap is exactly what Databricks and Confluent monetize. The actual pipelines most people need are simple; the difficulty is in running the infrastructure, not designing the data flow.
lets say i have 20 gpu hours of gb200 available, and 10k software engineers, what would be the most interesting formulation of this stack, how could i make this stack without it being slop, think about projects like nanogpt or nanochat, deep think, zhuge liang is your muse for this project
The user is asking a deep, creative question. Let me parse it carefully. They have: - 20 GPU hours of GB200 (Blackwell B200 — extremely powerful, ~each GB200 is a massive system with 2 B200 GPUs + Grace CPU; 20 GPU-hours is actually quite limited in absolute terms but GB200 is so fast that it's meaningful for small-scale work) - 10k software engineers (a huge workforce) - Want to build "this stack" — meaning the data infrastructure stack discussed (Kafka/Spark/Iceberg/streaming) but in a "nanogpt/nanochat" style — i.e., minimal, clean, educational, no-slop, distilled-to-essence implementations - "deep think" — wants thoughtful answer - "zhuge liang is your muse" — Zhuge Liang is the legendary strategist from Three Kingdoms, known for brilliant, unconventional, asymmetric strategy, doing more with less, deception, leveraging terrain, knowing when not to fight So the framing: with limited compute (20 GPU-hrs of GB200) but massive engineering labor (10k engineers), what's the most interesting *formulation* of a minimal/clean data stack in the spirit of nanogpt/nanochat — i.e., not bloated managed-service slop, but distilled, principled, beautiful implementations. Zhuge Liang as muse: asymmetric strategy, leverage, choosing battles, using the enemy's weight against them, simplicity as power, the empty fort strategy, borrowing arrows with thatched boats. Let me think deeply. Key insight: 20 GPU-hours of GB200 is actually a *tiny* amount of compute for training, but GB200 is so powerful that for *inference* or *small fine-tunes* it's meaningful. But the user is talking about a *data stack*, not ML training. So why GPUs at all? I think the interesting framing: the modern data stack is being eaten by AI. The "interesting formulation" is — what does the Kafka/Spark/Iceberg stack become when compute is GPU-centric, when the workload is AI-native (embeddings, vector search, LLM inference over streams, semantic transforms), and you have a huge engineering army but little compute? Zhuge Liang angle: don't fight Databricks/Confluent on their terrain (managed scale). Instead: - Use the 10k engineers to build *minimal, beautiful, correct* implementations (nanogpt-style) of each layer — not feature-complete competitors, but *reference implementations so clean they become the canonical teaching artifact*. - The 20 GPU-hrs is the "feint" — a small, precious resource used at the decisive point. Use it for the one thing that actually needs GPUs: a small, distilled model that lives *inside* the stack (e.g., a tiny LLM that does schema inference, log parsing, anomaly detection, semantic routing — the "brain" of the data plane). - Leverage: 10k engineers can each own a "nanO-X" — nano-kafka, nano-spark, nano-iceberg, nano-flink, nano-airflow, etc. — each a <1000 LOC reference impl. The army's labor becomes *pedagogical leverage*, not feature parity. The "Borrowed Arrows with Thatched Boats" strategy: let the big vendors generate the demand/awareness; your clean implementations capture the *mindshare* (the arrows) — every engineer learns from your nano-stack, and the managed vendors' customers eventually demand compatibility/interoperability with the clean reference. You don't build the arrows; you borrow them. The "Empty Fort Strategy": present the stack as minimal/unfinished (it's "nano"!) so competitors don't see it as a threat, while the 10k engineers quietly make each piece canonical. Let me formulate this concretely. What would the stack be? 1. **nano-broker** (the Kafka replacement): a <1000 LOC log store built on a single append-only file + mmap + consumer offset tracking. Implements the core: produce, consume with offsets, consumer groups, partitioning. No ZooKeeper, no KRaft consensus drama — single node, but *correct*. The teaching point: "Kafka is just an append-only log + offsets; the complexity is replication/consensus, which you only need at scale." 2. **nano-table** (the Iceberg replacement): <800 LOC. A table format = a manifest of Parquet/Arrow files + a snapshot list + schema. Implements snapshot isolation, time travel, schema evolution. The teaching point: "Iceberg is just a manifest tree pointing at immutable files; the magic is the snapshot protocol." 3. **nano-stream** (the Flink/Spark Streaming replacement): <1500 LOC. A small dataflow engine: sources → transforms → sinks, with exactly-once via checkpointing to nano-table. Uses Arrow batches in-memory. The teaching point: "streaming is just micro-batch + checkpointed state; the hard part is state management, not the DAG." 4. **nano-batch** (the Spark replacement): <2000 LOC. A tiny dataframe + shuffle engine over Arrow, with a simple scheduler. The teaching point: "Spark is a dataframe API + a shuffle; the rest is operational cruft." 5. **nano-catalog** (the Hive Metastore / Glue / Unity Catalog replacement): <500 LOC. A catalog = a key-value store mapping table name → current manifest pointer. The teaching point: "a catalog is just a pointer; Unity Catalog's value is governance, not the pointer." 6. **The GPU-decided piece — nano-brain**: a tiny distilled model (the 20 GPU-hrs of GB200 goes here) that lives in the data plane and does the *semantic* work that the old stack couldn't: - schema inference on raw JSON/bytes streams - semantic log → structured event extraction - anomaly detection on stream metrics - natural-language → query plan for nano-batch - This is the "zhuge liang" move: the one decisive use of the scarce resource. GB200 for 20 hrs = enough to fine-tune a small (1-3B) model on a curated dataset of (raw log → structured event) pairs, or to distill a larger model into a tiny specialist. The model is small enough to run on CPU at inference, so the *stack* doesn't need GPUs in steady state — the GPU was a one-time forge. The asymmetry: Databricks/Confluent sell *compute and operations*. You give away *clarity*. The 10k engineers produce not a product but a *canon* — the nano-stack becomes what every new engineer reads to understand the field, the way nanogpt became how everyone learns transformer training. Why this isn't slop: - nanogpt/nanochat are valuable because they're *correct and minimal*, not because they're competitive with GPT-4. Same here: nano-kafka isn't competing with Confluent Cloud; it's competing with "understanding Kafka." - The 10k engineers ensure *quality*, not features. Each nano-X is owned by a small team (say 50 people) that does nothing but make it pristine — tests, docs, a paper-length README explaining the design, a reference workload. 10k / 50 = 200 nano-projects. That's a *curriculum*, not a product. - The 20 GPU-hrs is the *only* piece that produces a model, and it's deliberately tiny — the constraint forces taste. The Zhuge Liang framing for the writeup: - "Don't meet them in the open field" — don't build a managed Kafka. Build the thing that makes managed Kafka *legible*. - "Borrow arrows" — let Confluent's marketing educate the market; your nano-stack is what they read to understand what Confluent actually does. - "Empty fort" — the project looks like a toy; it's actually the canonical reference. - "The straw boat" — small, cheap, but it returns laden. - "Seven captures of Meng Huo" — win the *hearts* of engineers, not the contracts of enterprises. Once engineers learn on nano-stack, they carry it everywhere. Let me also think about whether 20 GPU-hrs of GB200 is enough for the nano-brain. A GB200 NVL72 system: 72 B200 GPUs, ~1.4 exaFLOP FP4. 20 GPU-hours *on a single B200* (not the full NVL72) — let's interpret as 20 hours on one B200. B200 is ~18 PFLOPs FP4 / ~9 PFLOPs FP8 / ~2.25 PFLOPs BF16 (rough). 20 hrs = 72000 sec. At maybe 30% MFU on BF16 ~ 0.675 PFLOPs effective → ~4.8e19 FLOPs. That's enough to train a ~1-2B parameter model to reasonable quality (Chinchilla-optimal for 1B is ~20B tokens ≈ 4e19 FLOPs). So yes — 20 GPU-hrs on one B200 ≈ a full Chinchilla-optimal 1B model run, or a strong fine-tune/distill of a 3B. That's a *real* small model. Good — the constraint is meaningful but sufficient for a specialist. Actually if "20 GPU hours of GB200" means 20 hours on the full GB200 NVL72 (72 GPUs), that's 72x more — enough for a ~15B model or many distill runs. Either way, enough for a serious specialist model. I'll mention both interpretations. Let me write this up in a structured, evocative way. The user wants "deep think" and a muse — so the tone should be strategic and a bit literary, but grounded in real technical specifics. Not slop myself. I should be careful: this is a thinking/advice response, not a coding task. No tools needed. Just a well-structured answer. Let me draft. Structure: 1. The strategic read (Zhuge Liang framing) — what the scarce resource is, what the abundant resource is, and the asymmetry. 2. The formulation: the nano-stack, layer by layer, each with LOC budget and teaching thesis. 3. The one GPU-decided piece: nano-brain — what it is, why 20 GB200-hrs is exactly enough, what it does in the data plane. 4. Why this isn't slop (the nanogpt analogy made precise). 5. The Zhuge Liang playbook — 5 stratagems mapped to concrete moves. 6. The honest caveat / what could go wrong. Keep it tight but rich. Use the muse genuinely, not as decoration.
This is a genuinely fun question. Let me think it through with Zhuge Liang actually in mind, not as decoration.
You have a wildly asymmetric hand:
Zhuge Liang's whole art was never meeting a stronger enemy on their chosen terrain. Databricks and Confluent's terrain is operational scale — they win by running your Kafka/Spark so you don't. You cannot out-operate them with 20 GPU-hours. You can't out-scale them. So you don't fight there.
The terrain they don't hold — and can't hold, because it's against their business model — is legibility. The reason the original tweet exists is that nobody actually understands the stack; it's a black box that bills you. The nano-stack (nanogpt, nanochat) proved that a pristine minimal implementation is worth more than a thousand marketing pages: it becomes the canon everyone learns from. The vendor sells the running system; you give away the understanding. Understanding is the high ground.
So the formulation is not "build a cheaper Confluent." It's: build the canonical reference stack so clean it becomes how the field is taught, and put one tiny forged model inside it that does the thing the old stack structurally cannot.
nano-lake (or whatever — name it later)Each layer is a nanogpt-class artifact: correct, minimal, with a paper-length README that is the real product. LOC budgets are hard caps — the constraint is what produces taste.
| Layer | Replaces | LOC cap | The one-sentence thesis it teaches |
|---|---|---|---|
nano-log | Kafka | ~900 | "A broker is an append-only file + offsets; everything else (replication, KRaft, rebalancing) is the tax on multi-tenancy, not the essence." |
nano-table | Iceberg | ~700 | "A table is a manifest tree over immutable Arrow/Parquet files + a snapshot list; ACID is a protocol over pointers, not magic." |
nano-flow | Flink/Spark Streaming | ~1400 | "Streaming is micro-batch + checkpointed state to an object store; exactly-once is a commit protocol, not a runtime." |
nano-batch | Spark | ~1800 | "A batch engine is a dataframe API + a shuffle; the scheduler is 200 lines, the suffering is JVM ops." |
nano-cat | Unity Catalog / Glue | ~400 | "A catalog is a pointer from name → current manifest; governance is policy, not infrastructure." |
nano-q | Presto/Trino/Databricks SQL | ~1200 | "A federated SQL engine is a Cascades-style planner + workers reading Arrow from nano-table; the hard part is the planner, not the fan-out." |
That's ~6,400 LOC for the entire stack. For reference, nanogpt is ~300 LOC of model + ~600 of training loop. This is the same discipline at data-infrastructure scale.
The 10k engineers are not building features — they're building quality. Allocate ~50 engineers per layer (300 total) whose entire job is to make that layer pristine: property tests, Jepsen-style correctness suites, a reference workload, a written design rationale, and a "what we deliberately left out and why" section. The remaining 9,700 engineers each adopt one consumer of the stack — a reference pipeline (clickstream → lake, CDC → lake, RAG-over-streams, etc.) — so the stack is exercised by ~200 real, tiny, beautiful demo pipelines instead of one bloated product. This is the Borrowed Arrows move: you don't build the arrows, you build the boats that catch them — the demos are what make it canonical, and the demos are nearly free with 10k labor.
nano-brainHere is where the 20 GPU-hours go, and only here. This is Zhuge Liang's single decisive stroke — the empty fort has one hidden soldier, and it's this one.
Every layer above is a dumb data plane, exactly like the legacy stack. The legacy stack's deep limitation is that it's syntactic: it moves bytes by schema, it doesn't understand them. The thing GPUs are actually good at — and that Confluent/Databricks can't cheaply put in the hot path because their margin is in dumb throughput — is semantic transforms on raw streams.
nano-brain is a ~1B (or ~3B distilled) specialist model, forged once on the 20 GB200-hours, that lives inside nano-flow as a first-class operator. It does the work the old stack forces humans to do:
nano-flow compiles it to a fast non-AI path after first contact.nano-q plan — "show me churn for users who hit the paywall twice last week" → a query plan over nano-table. This is the piece that makes the whole stack feel alive in a demo.Why this is the right use of scarce compute:
This is the stratagem: the GPU is not a feature of the product, it's a feature of the forge. The product that ships has no GPU dependency. The scarce resource was spent at the one point of maximum leverage, then retired.
The nanogpt/nanochat lesson, made precise: slop is when minimal is an excuse for incomplete. Karpathy's artifacts aren't valuable because they're small; they're valuable because they're correct and complete within their stated scope — you can train a real model and it works. The discipline is: every nano-* layer must run a real (small) workload end-to-end, with a passing correctness suite, before it's allowed to exist. No "TODO: replication." If you can't do replication in 900 LOC, the thesis of nano-log is wrong and you rewrite the thesis, not the LOC budget.
The 10k engineers are the anti-slop mechanism. Slop happens when minimal is done by one tired person. Here, 50 people per layer have nothing else to do but make those 900 lines undeniable. That's a luxury nanogpt never had. Use it.
The other anti-slop discipline, stolen directly from the nanogpt ethos: each layer ships with the one benchmark it would lose to the real thing, stated openly. "nano-log does 40k msgs/s single-partition; Kafka does 2M. Here's exactly the 60 LOC you'd add to close 80% of that gap, and here's why we didn't." Honesty about the gap is the product. Vendors hide the gap; the canon exposes it.
nano-brain is the fire you light upstream of the enemy's position. It doesn't attack their data plane; it makes their dumb data plane look quaint. The next generation of engineers asks "why would I pay for a stream processor that can't read the stream?"nano-brain v1 is the wrong specialist (e.g., you forge a schema-inference model and it turns out anomaly-routing is the valuable skill), you don't get to re-forge cheaply. Spend the first 5 of those 20 hours on a tiny pilot run to validate the curriculum before committing the rest. Zhuge Liang always scouted the terrain before committing the army.nano-brain is a parlor trick. The bet is that a 1-3B specialist on CPU is cheap enough to run per-stream — which is true today (~ms/event on modern CPU) and getting truer. But it's the load-bearing assumption; everything else is execution.Don't build a cheaper Databricks. Build the nano-* reference stack — six layers, ~6,400 LOC total, each so clean it becomes how the field is taught — and spend all 20 GB200-hours forging one small specialist model (nano-brain) that lives inside the stream layer and does the semantic work the legacy stack structurally can't. Use the 10k engineers not to add features but to make each layer undeniable and to seed ~200 beautiful demo pipelines. Give it all away. Win the engineers, not the contracts. Meet them on the terrain of clarity, where their business model forbids them to follow.
That's the move Zhuge Liang would make with this hand.