Logo van Complete Ai Agent Stack Deployment Self Hosted From Scratch

Complete Ai Agent Stack Deployment Self Hosted From Scratch

Community
selvarajmurugesan90
complete-ai-agent-stack-deployment-self-hosted-from-scratch

Sequences a complete, end-to-end, fully self-hosted AI agent stack deployment from scratch — GPU procurement/sizing for open-weight model serving, self-hosted LLM serving (vLLM/TGI), agent control-flow architecture, a self-hosted vector database for RAG, self-hosted MCP servers for tool access, and an evaluation/guardrails harness — with no managed LLM API or managed vector database anywhere in the stack. An integration/orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points, explicit about the added GPU-procurement and operational burden versus a cloud-managed agent stack. Use when a user asks to "build a self-hosted AI agent stack with open-weight models," "run our agent on our own GPUs with no managed LLM API," "stand up a self-hosted vector database and MCP servers for an agent platform," or "give me the end-to-end sequence for a fully self-hosted agent deployment from GPU procurement to production."

Overzicht

Uitgeverselvarajmurugesan90
Repositoryops-engineering-skills
Skillnaamcomplete-ai-agent-stack-deployment-self-hosted-from-scratch
Sterren
44
Forks
18
Meegeleverde bestanden
Alleen instructies
LicentieApache-2.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door selvarajmurugesan90 op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Complete Ai Agent Stack Deployment Self Hosted From Scratch in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/selvarajmurugesan90/ops-engineering-skills/tree/main/plugins/ai-agent/skills/complete-ai-agent-stack-deployment-self-hosted-from-scratch
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/selvarajmurugesan90/ops-engineering-skills.git /tmp/ops-engineering-skills
mkdir -p .claude/skills
cp -r /tmp/ops-engineering-skills/plugins/ai-agent/skills/complete-ai-agent-stack-deployment-self-hosted-from-scratch .claude/skills/complete-ai-agent-stack-deployment-self-hosted-from-scratch
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Complete Ai Agent Stack Deployment Self Hosted From Scratch in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Complete Ai Agent Stack Deployment Self Hosted From Scratch automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Complete Ai Agent Stack Deployment Self Hosted From Scratch niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Complete AI Agent Stack Deployment (Self-Hosted) From Scratch

Purpose

The cloud-managed AI agent path in this skill family leans on managed LLM provider APIs and a managed vector database, trading infrastructure ownership for per-token pricing and someone else's on-call rotation. This skill is the opposite path: serving an open-weight model on GPU infrastructure the team itself procures and operates, paired with a self-hosted vector database and self-hosted MCP servers, with no managed LLM API or managed vector database anywhere in the stack. The tradeoff is real, and the sequencing risk is sharper than on the managed path: GPU capacity has to be sized and provisioned before the agent's latency budget is even meaningfully designable (unlike a managed API, where provider-side scaling is someone else's problem), and every durability concern a managed vector database absorbs — replication, backup, upgrade — becomes this team's responsibility from day one. This skill sequences that whole path — GPU procurement through evaluation — and is explicit throughout about where the self-hosted burden actually lands.

When to use

  • Standing up a production AI agent with a hard requirement of no managed LLM API or managed vector database — data residency, air-gapped deployment, fixed-cost GPU amortization, or model-customization reasons all commonly drive this.
  • Deciding whether a team genuinely has the GPU procurement and operational capacity to self-host an agent stack, versus one of the cloud-managed alternatives in this skill family.
  • Auditing an existing self-hosted agent deployment for a skipped or out-of-order phase (e.g. an agent's latency budget designed before real serving latency was measured on actual hardware, or a self-hosted vector database with no replication running in production for months).
  • Rebuilding a reference self-hosted agent architecture for a second team or environment that should follow the same proven sequence as a known-good first deployment.
  • Honestly comparing the total cost and operational burden of this path against the cloud-managed alternative before committing to it.

Prerequisites & environment

  • GPU infrastructure already provisioned or provisionable — on Kubernetes, this means the NVIDIA GPU Operator and dedicated serving-shaped GPU node pools per gpu-accelerator-infrastructure-for-ml-training (that skill's title says "for ML training" but its GPU Operator/MIG/ node-pool guidance applies identically to inference-serving GPU capacity). Whether this capacity is on-prem, colocated, or cloud-rented-as-raw-compute, this team owns its procurement lead time and scaling — there is no managed API absorbing a traffic spike on its own.
  • A self-hosting-capable serving runtime (vLLM or TGI) and the open-weight model checkpoint(s) already selected and downloaded, with a plan for where model weights are versioned and stored (not just "a directory on the serving node").
  • A self-hosted vector database deployment target (Weaviate or Milvus, self-managed on Kubernetes) and its own dedicated compute/storage — distinct from the GPU serving nodes, since vector search is typically CPU/memory-bound, not GPU-bound.
  • kubectl/helm if deploying on Kubernetes, and a realistic estimate of expected concurrent request volume and sequence length before sizing either the GPU serving fleet or the vector database cluster — sizing either without real numbers produces guesses that fail under real load.
  • A decision, made deliberately and with realistic staffing in mind, about whether this team can actually operate GPU capacity planning, model serving upgrades, and vector database durability long-term — see the honest tradeoff called out in Common pitfalls.

Step-by-step guidance

This is the phase sequence. Each phase links to the skill that covers its full depth; the text here covers only the self-hosted-specific sequencing and the operational burden each phase adds versus a managed alternative.

  1. Phase 1 — GPU infrastructure procurement and sizing. Before anything else, size and provision the GPU capacity this stack will run on, per gpu-accelerator-infrastructure-for-ml-training: install the NVIDIA GPU Operator, and design a dedicated serving GPU node pool (separate from any training capacity that may share the cluster) sized to the model's memory footprint plus KV-cache headroom at expected concurrency:

    bash
    helm install gpu-operator nvidia/gpu-operator \
      --namespace gpu-operator --create-namespace --set mig.strategy=mixed
    kubectl taint nodes -l gpu-pool=agent-serving workload=serving:NoSchedule

    This has no equivalent phase at all on the cloud-managed path — a managed LLM API absorbs this entirely. Treat GPU procurement lead time (physical hardware or committed cloud GPU capacity) as a hard blocking dependency for every phase that follows, not something to start in parallel with agent-architecture work.

  2. Phase 2 — self-hosted LLM serving. Deploy the chosen open-weight model with vLLM or TGI on the Phase 1 GPU pool, applying the batching-aware LLM serving guidance from model-serving-and-scaling (that skill's LLM-specific guidance on continuous batching and KV-cache sizing applies directly here, even though it lives in the MLOps domain):

    yaml
    apiVersion: apps/v1
    kind: Deployment
    metadata: { name: agent-llm-server }
    spec:
      template:
        spec:
          nodeSelector: { gpu-pool: agent-serving }
          containers:
            - name: vllm
              image: vllm/vllm-openai:latest
              args: ["--model", "<OPEN_WEIGHT_MODEL_ID>", "--tensor-parallel-size", "1"]
              resources: { limits: { nvidia.com/gpu: 1 } }

    Measure real serving latency on this actual hardware before Phase 3 finalizes the agent's iteration cap and per-step timeout — a latency budget designed against an assumed number, rather than the real measured p95 on the Phase 1 hardware, is the most common self-hosted- specific design error in this sequence (see Common pitfalls).

  3. Phase 3 — agent architecture design. Design the control loop, termination condition, iteration cap, wall-clock timeout, and tool- boundary classification per agent-architecture-design, using the Phase 2 measured latency (not an assumed managed-API latency figure) to set realistic per-call timeouts and the overall loop's wall-clock budget.

  4. Phase 4 — self-hosted vector database and RAG pipeline. Design the chunking/embedding/retrieval pattern per rag-pipeline-design, then deploy a self-hosted Weaviate or Milvus cluster per vector-database-operations-pinecone-weaviate-milvus's self-hosted guidance — sized, sharded, and replicated from the start:

    python
    # Milvus collection replication (self-hosted — no managed-service
    # durability behind this unless explicitly configured)
    collection: agent_knowledge_base
    replica_number: 2   # survives one query-node loss without downtime

    Unlike a managed vector database, replication, backup, and capacity planning here are entirely this team's responsibility — a single-replica self-hosted index has no vendor SLA behind it at all.

  5. Phase 5 — self-hosted MCP servers. Build and deploy MCP servers for tool access per mcp-server-development, on network infrastructure segmented from the Phase 1/2 GPU serving cluster's internal network — an MCP server sharing an unsegmented network with the model-serving control plane gives a compromised tool call a much larger blast radius than the tool's documented scope suggests. Scope each server's backend credential to least privilege, independent of any broad credential the GPU cluster's own service accounts might otherwise have.

  6. Phase 6 — evaluation harness and guardrails. Build the offline eval set and runtime guardrail layer per agent-evaluation-and-guardrails before Phase 2–5's full stack serves real traffic, including adversarial cases for RAG-content injection (Phase 4) and MCP-tool- output injection (Phase 5), exactly as on the cloud-managed path — the injection risk itself doesn't change because the model is self-hosted.

  7. Phase 7 — cost and utilization monitoring. Unlike the cloud- managed path's per-token provider billing, self-hosted cost is dominated by GPU capital/amortized cost and utilization, not per-call spend — apply the structural levers from llm-cost-and-latency-optimization (context trimming, batching, right-sized models per step) alongside GPU utilization monitoring (DCGM_FI_DEV_GPU_UTIL) from the Phase 1 GPU infrastructure layer. A self-hosted GPU fleet sitting at 15% utilization between bursty agent traffic can easily cost more in amortized terms than the managed-API alternative would have — this is a real total-cost-of-ownership comparison to make explicitly, not an assumption that self-hosting is automatically cheaper.

Best practices

  • Treat GPU procurement (Phase 1) as the hard, lead-time-bound prerequisite it is — every other phase's design decisions (Phase 3's latency budget especially) depend on real measured numbers from this phase, not estimates made in parallel with it.
  • Measure real serving latency and throughput on the actual Phase 1/2 hardware before finalizing any agent-loop timeout in Phase 3 — a self-hosted serving stack's latency characteristics differ enough from a managed API's that assumptions carried over from the managed path are unreliable here.
  • Set a replication factor of at least 2 on the self-hosted vector database (Phase 4) from the start — there is no managed-service failover behind a self-hosted single-replica index, and this is a cheap decision to make before go-live versus after a first outage.
  • Segment MCP servers' (Phase 5) network access from the GPU serving/training cluster's internal network deliberately — don't treat "it's all internal infrastructure" as equivalent to "it's all one trust boundary."
  • Model the total cost of the self-hosted stack (Phase 7) including GPU idle time between bursts, not just a per-token comparison against the managed-API alternative — the honest comparison is total cost of ownership, not sticker price per call.
  • Version model checkpoints, vLLM/TGI server configuration, and vector database schema/replication settings in one repository, exactly as rigorously as a registered model artifact would be versioned on the MLOps side of this repo — a self-hosted stack has no vendor console showing "what's currently deployed."

Common pitfalls

  • Symptom: The agent's control loop (Phase 3) frequently times out mid-task, even though the same design worked fine when prototyped against a managed LLM API. Fix: The per-call timeout and iteration cap were carried over from assumptions valid for a managed API's latency profile, not the actually measured p95 latency of the Phase 2 self-hosted serving stack on the Phase 1 hardware — re-measure real serving latency under realistic concurrency and re-tune Phase 3's budget against those numbers.

  • Symptom: A routine node restart or upgrade on the self-hosted vector database causes a multi-minute outage for every agent query that needs retrieval. Fix: Phase 4's vector database was deployed with no replication (or a replication factor of 1), unlike a managed vector database which handles this transparently. Set a replication factor of at least 2 before cutover, not after the first maintenance-window outage.

  • Symptom: A compromised or manipulated MCP tool call reaches infrastructure far beyond its documented tool surface, including parts of the model-serving control plane. Fix: Phase 5's MCP servers were deployed on the same unsegmented network as the Phase 1/2 GPU serving cluster, with no network policy isolating them. Segment MCP server network access independently of the ML infrastructure's internal network, regardless of how convenient sharing it was during initial setup.

  • Symptom: Total infrastructure spend for the self-hosted stack ends up higher than the cloud-managed alternative would have cost for the same traffic volume, contrary to the assumption that self-hosting is always cheaper. Fix: Phase 7's cost model only compared a rough per-token estimate against managed-API pricing, without accounting for GPU idle time between bursty agent traffic. Model utilization explicitly — a GPU fleet provisioned for peak load but averaging low utilization between bursts often costs more in amortized terms than metered managed-API usage would have for the same real traffic pattern.

  • Symptom: An eval suite that passed cleanly before launch fails to catch a real regression introduced when the open-weight model checkpoint was updated in place. Fix: The self-hosted model checkpoint was swapped without version pinning or re-running the Phase 6 eval suite against the new checkpoint — treat every checkpoint change exactly like a registered model version change on the MLOps side of this repo: pin it, and re-run the full eval suite before it replaces the serving deployment.

Worked example

Scenario: A defense-adjacent company must run its internal engineering-assistant agent entirely on-premises with no managed LLM API or managed vector database, using an open-weight model on their own GPU cluster.

bash
# Phase 1 — GPU procurement: 4x A100-80GB nodes provisioned on-prem,
# GPU Operator installed, dedicated agent-serving node pool tainted
helm install gpu-operator nvidia/gpu-operator --namespace gpu-operator --create-namespace
kubectl taint nodes gpu-node-01 gpu-node-02 workload=serving:NoSchedule

# Phase 2 — vLLM serving the chosen open-weight model on the serving pool
kubectl apply -f agent-llm-vllm-deployment.yaml
# real p95 measured under expected concurrency: 2.8s per generation step

# Phase 3 — ReAct-style agent loop, iteration cap and per-call timeout
# tuned against the Phase 2 measured 2.8s p95 (not an assumed managed-API number)
MAX_ITERATIONS = 10
PER_CALL_TIMEOUT_SECONDS = 8   # real p95 + margin, not a guess

# Phase 4 — self-hosted Milvus, replica_number=2, RAG design decided first
collection: engineering_docs
replica_number: 2

# Phase 5 — self-hosted MCP servers on a segmented network, separate from
# the GPU cluster's internal network, least-privilege backend credentials

# Phase 6 — 50-case eval suite including RAG-injection and MCP-tool-output
# injection adversarial cases, passing before wide internal rollout

# Phase 7 — GPU utilization dashboard (DCGM) alongside token-cost tracking;
# utilization holds at ~55% average across business hours, confirmed as a
# reasonable total-cost-of-ownership tradeoff versus the managed-API
# alternative that was priced out before committing to this path

Two months in, a scheduled node maintenance window restarts one Milvus node; because Phase 4's replication factor was set to 2 from the start, agent queries continue serving without interruption from the remaining replica — the exact failure mode this skill's Common pitfalls section flags as catastrophic on a single-replica self-hosted deployment.

Cross-references

Veelgestelde vragen

Wat doet de AI-skill Complete Ai Agent Stack Deployment Self Hosted From Scratch?

Sequences a complete, end-to-end, fully self-hosted AI agent stack deployment from scratch — GPU procurement/sizing for open-weight model serving, self-hosted LLM serving (vLLM/TGI), agent control-flow architecture, a self-hosted vector database for RAG, self-hosted MCP servers for tool access, and an evaluation/guardrails harness — with no managed LLM API or managed vector database anywhere in the stack. An integration/orchestration skill that sequences existing tool-specific skills in the right order and flags handoff points, explicit about the added GPU-procurement and operational burden...

Waarom Complete Ai Agent Stack Deployment Self Hosted From Scratch gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Complete Ai Agent Stack Deployment Self Hosted From Scratch bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Complete Ai Agent Stack Deployment Self Hosted From Scratch in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/selvarajmurugesan90/ops-engineering-skills/tree/main/plugins/ai-agent/skills/complete-ai-agent-stack-deployment-self-hosted-from-scratch. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Complete Ai Agent Stack Deployment Self Hosted From Scratch gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Complete Ai Agent Stack Deployment Self Hosted From Scratch gebruiken?

Zoveel als je wilt. Je kunt Complete Ai Agent Stack Deployment Self Hosted From Scratch gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Complete Ai Agent Stack Deployment Self Hosted From Scratch gratis?

Ja. Deze skill is door selvarajmurugesan90 op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇