create-deployment

A deployment generator creates the files needed to run a LangGraph workflow as a web service using FastAPI. LangGraph is a framework for building workflows from connected steps, while FastAPI is a Python framework for web APIs.

In plain words
What is it for?
Use it to create a deployment folder with the API code, data models, Docker files, dependencies, environment example, and setup guide. It can also include Prometheus monitoring and a streaming endpoint.
Why use it?
It removes the repetitive work of turning a workflow into an API, including request models, health checks, container files, and asynchronous execution.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/postindustria-tech/agentic-toolkit/create-deployment
Clone the repo
git clone --depth 1 https://github.com/postindustria-tech/agentic-toolkit
Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 962 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00016 $0.00962
Opus 5 $0.00008 $0.00481
Sonnet 5 $0.00003 $0.00192
Haiku 4.5 $0.00002 $0.00096

Measured yesterday against content hash b9007dfbdec0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

create-deployment scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/langgraph-dev/commands/create-deployment.md · 179 lines

How it starts

The opening of the file, as written. The whole thing — 179 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Create FastAPI Deployment

Generate production-ready FastAPI deployment code for LangGraph workflows with async execution, health checks, and optional monitoring.

Instructions for Claude

1. Analyze Graph

Read the graph file to understand:

  • State schema
  • Entry points
  • Expected inputs/outputs

2. Gather Requirements

Ask user:

  • Port to run on (default: 8000)
  • Whether to include Prometheus monitoring (default: yes)
  • Whether to include streaming endpoint (default: yes)
  • CORS configuration (if needed)

3. Generate Deployment Structure

Create:

deployment/
├── api.py              # FastAPI application
├── models.py           # Pydantic request/response models
├── Dockerfile
├── docker-compose.yml
├── requirements.txt
├── .env.example
└── README.md

4. Generate models.py

from pydantic import BaseModel, Field

class QueryRequest(BaseModel):
    input: str = Field(description="User input")
    config: dict = Field(default_factory=dict, description="Optional configuration")

class QueryResponse(BaseModel):
    output: str = Field(description="Generated output")
    metadata: dict = Field(default_factory=dict, description="Execution metadata")

5. Generate api.py

from fastapi import FastAPI, HTTPException
from fastapi.responses import StreamingResponse
from prometheus_client import Counter, Histogram, generate_latest, CONTENT_TYPE_LATEST
import asyncio

from src.graph import create_graph
from .models import QueryRequest, QueryResponse

app = FastAPI(title="LangGraph API")
graph = create_graph()

# Metrics
REQUEST_COUNT = Counter('requests_total', 'Total requests')
REQUEST_LATENCY = Histogram('request_latency_seconds', 'Request latency')

@app.post("/process", response_model=QueryResponse)
@REQUEST_LATENCY.time()
async def process_query(request: QueryRequest):
    \"\"\"Process query through workflow.\"\"\"
    REQUEST_COUNT.inc()

    try:
        result = await graph.ainvoke({
            "messages": [{"role": "user", "content": request.input}]
        })

        return QueryResponse(
            output=result["messages"][-1]["content"],
            metadata={"steps": result.get("current_step")}
        )
    except Exception as e:
        raise HTTPException(status_code=500, detail=str(e))

@app.post("/stream")
async def stream_process(request: QueryRequest):
    \"\"\"Stream workflow execution.\"\"\"
    async def event_generator():
        async for event in graph.astream({"messages": [request.input]}):
            yield f"data: {json.dumps(event)}\\n\\n"

    return StreamingResponse(event_generator(), media_type="text/event-stream")

@app.get("/health")
async def health_check():
    return {"status": "healthy"}

@app.get("/metrics")
async def metrics():
    return Response(generate_latest(), media_type=CONTENT_TYPE_LATEST)

Read the full file on GitHub · 179 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 179 lines · 16 tokens per session scan A b9007dfbdec0

Subscribe to this mod's changes

create-deployment is a command published in the GitHub repository postindustria-tech/agentic-toolkit (2 stars, last pushed 1mo ago), licensed MIT. It adds 16 tokens to every session and 962 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.