llm-patterns

Featured

AI-first application patterns, LLM testing, prompt management

AI & Automation 694 stars 57 forks Updated today MIT

Install

View on GitHub

Quality Score: 98/100

Stars 20%
95
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# LLM Patterns Skill For AI-first applications where LLMs handle logical operations. --- ## Core Principle **LLM for logic, code for plumbing.** Use LLMs for: - Classification, extraction, summarization - Decision-making with natural language reasoning - Content generation and transformation - Complex conditional logic that would be brittle in code Use traditional code for: - Data validation (Zod/Pydantic) - API routing and HTTP handling - Database operations - Authentication/authorization - Orchestration and error handling --- ## Project Structure ``` project/ ├── src/ │ ├── core/ │ │ ├── prompts/ # Prompt templates │ │ │ ├── classify.ts │ │ │ └── extract.ts │ │ ├── llm/ # LLM client and utilities │ │ │ ├── client.ts # LLM client wrapper │ │ │ ├── schemas.ts # Response schemas (Zod) │ │ │ └── index.ts │ │ └── services/ # Business logic using LLM │ ├── infra/ │ └── ... ├── tests/ │ ├── unit/ │ ├── integration/ │ └── llm/ # LLM-specific tests │ ├── fixtures/ # Saved responses for deterministic tests │ ├── evals/ # Evaluation test suites │ └── mocks/ # Mock LLM responses └── _project_specs/ └── prompts/ # Prompt specifications ``` --- ## LLM Client Pattern ### Typed LLM Wrapper ```typescript // core/llm/client.ts import Anthropic from '@anthropic-ai/sdk'; import { z } from 'zod'; cons...

Details

Author
alinaqi
Repository
alinaqi/maggy
Created
5 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category