| name | litestar-ai-serving |
| description | Auto-activate for Google ADK, LlmAgent, Runner, SQLSpecSessionService, Vertex AI, SSE agent chats, tool calls, or Litestar model workflows. Not for offline ML training. |
Litestar AI Serving
Use this skill for HTTP-facing AI agent endpoints, Google ADK integration, session-backed conversations, and Litestar service boundaries around model workflows.
Code Style Rules
- Keep agent orchestration behind service functions or providers.
- Use typed request and response DTOs at the HTTP boundary.
- Store multi-turn state through the project's database stack.
- Stream only when the client contract needs incremental output.
Quick Reference
Workflow
- Define the HTTP contract before agent internals.
- Wire agent runners through DI.
- Persist session state through the chosen data stack.
- Test deterministic failure, timeout, and cancellation paths.
Guardrails
- Do not expose raw agent internals as the API contract.
- Do not block request workers with unbounded model calls.
- Do not store prompts, tool outputs, or memory without a retention decision.
- Do not skip authorization on agent endpoints.
Validation Checkpoint
Example
@get("/chat/{session_id:str}")
async def chat(session_id: str, runner: Runner, body: ChatRequest) -> ChatResponse:
result = await runner.run_async(session_id=session_id, new_message=body.message)
return ChatResponse(message=result.final_response)
References Index
Official References
Shared Styleguide Baseline