Skip to main content

8.3.1 Application Development Roadmap: API, Tools, State

LLM application development is not just an input box plus a model API. A real feature validates input, calls models, uses tools, keeps state, parses output, logs errors, and gives users a recoverable experience.

See the Application Loop First

LLM application development chapter relationship diagram

LLM application development learning order diagram

LLM application capability loop diagram

The chapter upgrades one model call into a maintainable application loop: input, prompt/context, model, optional tool, validation, output, feedback.

Run a Tool Dispatch Check

Function Calling means the model proposes structured action arguments, but your application must validate and dispatch them.

model_output = {
"tool": "search_docs",
"arguments": {"query": "RAG citations"},
}

allowed_tools = {
"search_docs": {"required": ["query"]},
"create_ticket": {"required": ["title", "priority"]},
}

tool = model_output["tool"]
required = allowed_tools[tool]["required"]
validation_ok = all(name in model_output["arguments"] for name in required)

print("validation_ok:", validation_ok)
print("dispatch:", tool if validation_ok else "block")

Expected output:

validation_ok: True
dispatch: search_docs

Never execute tool calls directly from model text. Validate tool name, argument schema, permission, and failure path.

Learn in This Order

StepReadPractice Output
1LLM API practiceWrite a robust call wrapper with timeout and error handling
2Framework basicsSplit prompt, model, tool, memory, retrieval, and parser roles
3Function CallingValidate structured tool arguments before dispatch
4Hugging Face ecosystemKnow when hosted, local, or browser-side models fit
5Dialogue systemsStore session state, slots, memory, and user feedback
6Document and template appsTurn parsing, extraction, and generation into modules

Pass Check

You pass this chapter when you can build a small assistant loop that handles one API call, one optional tool call, one structured output, and one error path.

The exit mini project is a course Q&A and study-planning assistant that classifies the user request, optionally retrieves knowledge, returns structured suggestions, and logs feedback.