Skip to content

Instantly share code, notes, and snippets.

@sbng
Last active May 14, 2026 02:28
Show Gist options
  • Select an option

  • Save sbng/1a9469d9a18ed226da467d62fe9aacbf to your computer and use it in GitHub Desktop.

Select an option

Save sbng/1a9469d9a18ed226da467d62fe9aacbf to your computer and use it in GitHub Desktop.
AI

AI Landscape: LLMs, Harnesses, Agents & Providers

1. The Big Picture β€” How Everything Connects

graph TD
    subgraph Providers["🏒 LLM Providers"]
        OAI["OpenAI\nGPT-4o / o3"]
        ANT["Anthropic\nClaude 3.x"]
        GGL["Google\nGemini 2.x"]
        MTA["Meta\nLlama 3.x (OSS)"]
        MSC["Mistral\nMistral Large"]
    end

    subgraph LLMs["🧠 Large Language Models"]
        CORE["Foundation Model\n(Pre-trained weights)"]
        FINE["Fine-tuned / RLHF\nAligned Model"]
        EMB["Embedding Models"]
        CORE --> FINE
        CORE --> EMB
    end

    subgraph Harness["βš™οΈ LLM Harness / Orchestration"]
        PROMPT["Prompt Engineering\n& Templates"]
        MEM["Memory &\nContext Management"]
        TOOLS["Tool Use /\nFunction Calling"]
        RAG["RAG\nRetrieval-Augmented Gen"]
        PROMPT --> MEM
        MEM --> TOOLS
        TOOLS --> RAG
    end

    subgraph Agents["πŸ€– Agent Layer"]
        PLAN["Goal & Task\nPlanning"]
        LOOP["Observe → Think\n→ Act Loop"]
        MULTI["Multi-Agent\nCoordination"]
        PLAN --> LOOP --> MULTI
    end

    subgraph Apps["πŸš€ Applications"]
        CHAT["Chatbots"]
        CODE["Code Assistants"]
        ANLY["Data Analysis"]
        AUTO["Autonomous\nWorkflow"]
    end

    Providers -->|"Expose via API"| LLMs
    LLMs -->|"Model inference"| Harness
    Harness -->|"Enables reasoning &\ntool use"| Agents
    Agents -->|"Powers"| Apps
Loading

2. What Is an LLM?

flowchart LR
    INPUT["Raw Text\nInput (tokens)"]

    subgraph LLM["Large Language Model"]
        direction TB
        TF["Transformer\nArchitecture"]
        ATT["Attention\nMechanism"]
        PARAM["Billions of\nParameters"]
        TF --> ATT --> PARAM
    end

    OUTPUT["Generated Text\nOutput (tokens)"]

    INPUT --> LLM --> OUTPUT

    TRAIN["πŸ“š Training Data\n(web, books, code)"]
    RLHF["🎯 RLHF / Alignment\n(human feedback)"]

    TRAIN -->|pre-training| LLM
    RLHF -->|fine-tuning| LLM
Loading

3. LLM Provider Landscape

quadrantChart
    title LLM Providers β€” Openness vs Capability
    x-axis Closed/Proprietary --> Open/OSS
    y-axis Lower Capability --> Higher Capability
    quadrant-1 High Capability & Open
    quadrant-2 High Capability & Closed
    quadrant-3 Low Capability & Closed
    quadrant-4 Low Capability & Open
    OpenAI GPT-4o: [0.1, 0.95]
    Anthropic Claude: [0.15, 0.92]
    Google Gemini: [0.2, 0.90]
    Meta Llama 3: [0.85, 0.80]
    Mistral Large: [0.70, 0.72]
    Cohere Command: [0.30, 0.60]
    Falcon: [0.90, 0.50]
Loading

4. The LLM Harness in Detail

A harness is the orchestration layer that wraps an LLM to make it useful in production.

flowchart TD
    USER["πŸ‘€ User / Application"]

    subgraph HARNESS["LLM Harness (e.g. LangChain, LlamaIndex, DSPy)"]
        direction TB

        subgraph INPUT_LAYER["Input Layer"]
            PT["Prompt Template"]
            CTX["Context Injection"]
            GUARD_IN["Input Guardrails"]
        end

        subgraph MEMORY_LAYER["Memory Layer"]
            STM["Short-Term Memory\n(conversation window)"]
            LTM["Long-Term Memory\n(vector DB)"]
        end

        subgraph TOOL_LAYER["Tool / Action Layer"]
            FC["Function Calling"]
            WEB["Web Search"]
            DB["Database Query"]
            CODE_INT["Code Interpreter"]
        end

        subgraph OUTPUT_LAYER["Output Layer"]
            PARSE["Output Parser"]
            GUARD_OUT["Output Guardrails"]
            FORMAT["Formatter / Renderer"]
        end

        INPUT_LAYER --> MEMORY_LAYER --> TOOL_LAYER --> OUTPUT_LAYER
    end

    LLM_API["🧠 LLM API\n(Provider)"]

    USER -->|request| HARNESS
    HARNESS <-->|prompt + response| LLM_API
    HARNESS -->|final answer| USER
Loading

5. What Is an Agent?

An agent is an LLM that can autonomously plan, act, observe results, and loop β€” going beyond a single prompt/response exchange.

flowchart TD
    GOAL["🎯 Goal / Task\ngiven by user"]

    subgraph AGENT["πŸ€– Agent Loop"]
        direction TB
        THINK["Think\n(LLM reasons about next step)"]
        ACT["Act\n(invoke tool or sub-agent)"]
        OBS["Observe\n(parse tool result)"]
        CHECK{"Goal\nreached?"}

        THINK --> ACT --> OBS --> CHECK
        CHECK -->|No| THINK
    end

    subgraph TOOLS["Available Tools"]
        WEB2["Web Search"]
        CODE2["Code Execution"]
        DB2["Database / Files"]
        API2["External APIs"]
        SUBAGENT["Sub-Agents"]
    end

    DONE["βœ… Final Answer\ndelivered to user"]

    GOAL --> AGENT
    ACT <-->|calls & results| TOOLS
    CHECK -->|Yes| DONE
Loading

Single-Agent vs Multi-Agent

graph LR
    subgraph Single["Single Agent"]
        U1["User"] --> A1["Agent"] --> T1["Tools"]
        A1 --> U1
    end

    subgraph Multi["Multi-Agent System"]
        U2["User"] --> ORCH["Orchestrator\nAgent"]
        ORCH --> A2["Research\nAgent"]
        ORCH --> A3["Coding\nAgent"]
        ORCH --> A4["Critic /\nReview Agent"]
        A2 & A3 & A4 --> ORCH
        ORCH --> U2
    end
Loading

6. The Coding Agent β€” A Specialized Agent

A coding agent is an agent purpose-built to write, run, test, and iterate on software. It is the most powerful example of agents in practice because code is both the tool and the output.

Unlike a chat assistant that suggests code, a coding agent executes it, reads the result, fixes errors, and loops until the task is done.

flowchart TD
    DEV["πŸ‘€ Developer\ngives a goal"]

    subgraph CODING_AGENT["πŸ’» Coding Agent"]
        direction TB
        UNDERSTAND["Understand\nRequirements"]
        PLAN_CODE["Plan approach\n& break into tasks"]
        WRITE["Write / Edit\nCode"]
        RUN["Execute\nCode / Tests"]
        READ_OUT["Read output\n& errors"]
        FIX{"Tests\npassing?"}

        UNDERSTAND --> PLAN_CODE --> WRITE --> RUN --> READ_OUT --> FIX
        FIX -->|No β€” debug & retry| WRITE
    end

    subgraph DEV_TOOLS["πŸ› οΈ Developer Toolchain"]
        CLI["CLI\n(run commands)"]
        GIT["Git\n(version control)"]
        SSH["SSH\n(remote access)"]
        FS["File System\n(read/write files)"]
        PKG["Package Manager\n(pip, npm, cargo)"]
        TEST["Test Runner\n(pytest, jest)"]
    end

    RESULT["βœ… Working code\ncommitted & deployed"]

    DEV --> CODING_AGENT
    WRITE <-->|reads & writes| FS
    RUN <-->|executes via| CLI
    RUN <-->|installs deps via| PKG
    READ_OUT <-->|runs tests via| TEST
    FIX -->|Yes β€” commit| GIT
    GIT -->|push / deploy via| SSH
    GIT --> RESULT
Loading

Examples of Coding Agents

Agent Built by Key strength
Claude Code Anthropic Deep reasoning, safe edits, large context
GitHub Copilot Workspace GitHub / OpenAI IDE-native, PR-aware
Devin Cognition AI Fully autonomous end-to-end dev
Opencode Open source Git-native, terminal-first
Cursor Agent Cursor Fast inline iteration in editor

7. Git, SSH & CLI β€” The Agent's Hands

An LLM can think, but without tools it cannot act in the real world. Git, SSH, and the CLI are the three foundational primitives that give a coding agent the ability to work on real software systems.

Think of the LLM as the brain. Git, SSH, and CLI are the hands, legs, and eyes that let it operate in the real world.

mindmap
  root((Coding Agent\nNeeds))
    CLI
      Run scripts and commands
      Execute test suites
      Install packages and deps
      Read stdout and stderr
      Trigger build pipelines
    Git
      Read codebase history
      Understand current branch state
      Stage and commit changes safely
      Create branches per task
      Open and review pull requests
      Rollback bad changes
    SSH
      Connect to remote servers
      Deploy to staging and prod
      Run commands on cloud infra
      Tunnel into private networks
      Access containerised environments
Loading

How Each Tool Enables the Agent

flowchart LR
    AGENT["πŸ€– Coding Agent"]

    subgraph CLI_BOX["⌨️ CLI"]
        direction TB
        C1["Run: python app.py"]
        C2["Run: pytest tests/"]
        C3["Run: npm run build"]
        C4["Read: stdout / stderr"]
        C1 --> C2 --> C3 --> C4
    end

    subgraph GIT_BOX["🌿 Git"]
        direction TB
        G1["git clone / pull\n(get latest code)"]
        G2["git diff / log\n(understand changes)"]
        G3["git checkout -b\n(isolate work)"]
        G4["git add + commit\n(save progress)"]
        G5["git push + PR\n(ship for review)"]
        G1 --> G2 --> G3 --> G4 --> G5
    end

    subgraph SSH_BOX["πŸ” SSH"]
        direction TB
        S1["ssh user@server\n(remote shell)"]
        S2["scp / rsync\n(transfer files)"]
        S3["ssh-keygen\n(auth without passwords)"]
        S4["Port forwarding\n(access private services)"]
        S1 --> S2 --> S3 --> S4
    end

    AGENT -->|"executes commands\nreads output"| CLI_BOX
    AGENT -->|"tracks, saves\n& ships code"| GIT_BOX
    AGENT -->|"operates on\nremote systems"| SSH_BOX
Loading

Why Each One Is Critical

CLI β€” the agent's ability to act The command line is how the agent runs code and sees the result. Without it, the agent can only write code β€” it cannot verify whether the code works. The feedback loop of write β†’ run β†’ read error β†’ fix is entirely CLI-driven.

Git β€” the agent's safety net and memory Git gives the agent a structured record of every change. It can branch before experimenting (safe to fail), commit incrementally (checkpoints), and revert if something breaks. Without Git, an agent editing files is one mistake away from unrecoverable damage.

SSH β€” the agent's reach beyond the local machine Most real software doesn't run on a laptop. SSH lets the agent connect to staging servers, cloud VMs, and containerised environments. Without SSH, the agent is blind to runtime behaviour in production-like conditions.

sequenceDiagram
    actor Dev as πŸ‘€ Developer
    participant Agent as πŸ€– Coding Agent
    participant CLI as ⌨️ CLI
    participant Git as 🌿 Git
    participant SSH as πŸ” SSH
    participant Server as ☁️ Remote Server

    Dev->>Agent: "Fix the failing API test and deploy to staging"

    Agent->>Git: git pull origin main
    Git-->>Agent: latest code

    Agent->>Git: git checkout -b fix/api-test
    Agent->>CLI: run pytest tests/api_test.py
    CLI-->>Agent: AssertionError on line 42

    Agent->>Agent: reason about error, edit code
    Agent->>CLI: run pytest tests/api_test.py
    CLI-->>Agent: βœ… All tests passed

    Agent->>Git: git add + commit "fix: correct API response shape"
    Agent->>Git: git push origin fix/api-test

    Agent->>SSH: ssh deploy@staging-server
    SSH-->>Agent: connected
    Agent->>SSH: run deploy script
    SSH-->>Server: pull & restart service
    Server-->>Agent: βœ… deployed successfully

    Agent->>Dev: "Tests fixed and deployed to staging. PR raised."
Loading

8. Provider β†’ Harness β†’ Agent β†’ App: Full Stack View

C4Context
    title AI Application Full Stack

    Person(user, "End User", "Interacts via UI")

    System_Boundary(app_layer, "Application Layer") {
        System(app, "Product / App", "Chat, copilot, autonomous assistant")
    }

    System_Boundary(agent_layer, "Agent Layer") {
        System(agent, "Agent / Multi-Agent", "Plans, loops, delegates to sub-agents")
    }

    System_Boundary(harness_layer, "Orchestration Layer") {
        System(harness, "LLM Harness", "LangChain / LlamaIndex / custom")
        System(vector_db, "Vector DB", "Pinecone, Weaviate, pgvector")
        System(tools, "External Tools", "APIs, DBs, code exec, web search")
    }

    System_Boundary(provider_layer, "LLM Provider Layer") {
        System(llm, "LLM API", "OpenAI / Anthropic / Google / OSS")
    }

    Rel(user, app, "Uses")
    Rel(app, agent, "Delegates goal")
    Rel(agent, harness, "Uses harness for each step")
    Rel(agent, agent, "Spawns sub-agents")
    Rel(harness, llm, "Sends prompts, receives completions")
    Rel(harness, vector_db, "Retrieves context (RAG)")
    Rel(harness, tools, "Invokes tools / functions")
Loading

9. Choosing the Right Provider

flowchart TD
    START(["What matters most\nto your use case?"])

    START --> COST{Cost-sensitive?}
    START --> OPEN{Need open weights?}
    START --> SAFE{Safety-critical?}
    START --> MULTI{Multimodal?}

    COST -->|Yes| CHEAP["Mistral / Llama 3\nvia self-hosting"]
    COST -->|No| PERF{Need best\nperformance?}
    PERF -->|Yes| TOP["OpenAI o3\nor Claude 3.7"]
    PERF -->|No| MID["Claude Haiku\nor GPT-4o mini"]

    OPEN -->|Yes| OSS["Meta Llama 3\nMistral / Falcon"]
    OPEN -->|No| PROP["OpenAI / Anthropic\n/ Google"]

    SAFE -->|Yes| ANT2["Anthropic Claude\n(Constitutional AI)"]

    MULTI -->|Yes| GEMINI["Google Gemini\nor GPT-4o"]
Loading

Key Takeaways

Layer What it does Examples
LLM Provider Trains & hosts the model, exposes API OpenAI, Anthropic, Google, Meta
LLM Foundation model that predicts next tokens GPT-4o, Claude 3.7, Llama 3, Gemini
Harness Orchestrates prompts, memory, tools & RAG LangChain, LlamaIndex, DSPy, custom
Agent Plans multi-step goals, loops, delegates tasks AutoGPT, CrewAI, LangGraph, custom
Coding Agent Writes, runs, tests & ships real software Claude Code, Devin, Aider, Cursor
CLI / Git / SSH Give the agent hands to act on real systems bash, git, openssh
Application End-user product built on top Copilots, autonomous assistants, analyzers

Mental model: The provider gives you the engine. The LLM is the engine. The harness is the gearbox. The agent is the driver. And Git, CLI & SSH are the road, the map, and the ability to reach any destination.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment