# llm-auto-update > LLM 모델 자동 업데이트 시스템 - 항상 최신 모델 정보 유지 - Author: hunsang jo - Repository: johunsang/kreatsaas - Version: 20260104160949 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-07 - Source: https://github.com/johunsang/kreatsaas - Web: https://mule.run/skillshub/@@johunsang/kreatsaas~llm-auto-update:20260104160949 --- --- name: llm-auto-update description: LLM 모델 자동 업데이트 시스템 - 항상 최신 모델 정보 유지 triggers: - LLM - 모델 - 업데이트 - 최신 --- # LLM 자동 업데이트 시스템 > ⚠️ **중요**: KreatSaaS 실행 시 Context7 MCP를 통해 > 모든 LLM 모델, 가격, API를 자동으로 최신 정보로 업데이트합니다. --- ## 자동 업데이트 워크플로우 ``` ┌─────────────────────────────────────────────────────────────┐ │ KreatSaaS 실행 시 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 1️⃣ Context7 MCP로 최신 문서 조회 │ │ ├── OpenAI API 문서 │ │ ├── Anthropic API 문서 │ │ ├── Google AI 문서 │ │ ├── Groq 문서 │ │ ├── DeepSeek 문서 │ │ └── 기타 LLM 문서 │ │ ↓ │ │ 2️⃣ 최신 모델 정보 추출 │ │ ├── 모델 이름/ID │ │ ├── 가격 (입력/출력) │ │ ├── 컨텍스트 길이 │ │ ├── 새로운 기능 │ │ └── API 변경사항 │ │ ↓ │ │ 3️⃣ 사용자에게 최신 정보 제공 │ │ └── 아키텍처 설계 시 최신 모델 추천 │ │ │ └─────────────────────────────────────────────────────────────┘ ``` --- ## 구현 방법 ### 방법 1: Context7 MCP 활용 (권장) > 💡 **팁**: 프롬프트에 `use context7`를 추가하면 자동으로 최신 문서를 가져옵니다! ``` ┌─────────────────────────────────────────────────────────────┐ │ 📚 Context7 MCP 도구 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 1️⃣ resolve-library-id (라이브러리 ID 조회) │ │ ├── query: "사용자 질문/작업 설명" │ │ └── libraryName: "검색할 라이브러리명" │ │ │ │ 예시: │ │ - libraryName: "openai" → /openai/openai-node │ │ - libraryName: "anthropic" → /anthropic/anthropic-sdk │ │ - libraryName: "google genai" → /google/generative-ai │ │ - libraryName: "supabase" → /supabase/supabase │ │ │ │ 2️⃣ query-docs (문서 검색) │ │ ├── libraryId: "정확한 Context7 ID" (필수) │ │ └── query: "찾고 싶은 정보" (필수) │ │ │ │ 예시: │ │ - libraryId: "/openai/openai-node" │ │ - query: "GPT-4o 모델 가격과 사용법" │ │ │ └─────────────────────────────────────────────────────────────┘ KreatSaaS 실행 시 자동으로 수행: 1. resolve-library-id 호출 - "openai" → /openai/openai-node - "anthropic" → /anthropic/anthropic-sdk-typescript - "google genai" → /google/generative-ai-js - "groq" → /groq/groq-typescript - "supabase" → /supabase/supabase-js 2. query-docs 호출 - 각 라이브러리의 최신 모델, 가격, API 사용법 조회 3. 추출된 정보로 아키텍처 가이드 업데이트 ``` ### 라이브러리 ID 직접 지정 (더 빠름!) ``` 프롬프트에 라이브러리 ID를 직접 명시하면 resolve 단계를 건너뜁니다: "use library /openai/openai-node for API docs" "use library /supabase/supabase-js for database setup" "use library /vercel/next.js for App Router documentation" ``` ### 버전 명시 ``` 버전을 언급하면 해당 버전 문서를 가져옵니다: "Next.js 14 middleware 설정 방법" → Next.js 14 문서 "React 19 use() hook 사용법" → React 19 문서 "Supabase v2 realtime 구독" → Supabase v2 문서 ``` ### 방법 2: 실시간 웹 검색 ```typescript // 실행 시 최신 정보 조회 async function getLatestLLMInfo() { const queries = [ "OpenAI GPT models pricing 2025", "Anthropic Claude models latest", "Google Gemini API pricing 2025", "Groq LLM models 2025", "DeepSeek API models 2025" ]; // Perplexity API로 실시간 검색 const results = await Promise.all( queries.map(query => searchWithPerplexity(query)) ); return parseLatestModels(results); } ``` ### 방법 3: 공식 API 엔드포인트 조회 ```typescript // 각 서비스의 모델 목록 API 호출 async function fetchLatestModels() { const models = { openai: await fetchOpenAIModels(), anthropic: await fetchAnthropicModels(), google: await fetchGoogleModels(), }; return models; } // OpenAI 모델 목록 async function fetchOpenAIModels() { const openai = new OpenAI(); const response = await openai.models.list(); return response.data .filter(m => m.id.includes('gpt') || m.id.includes('o1')) .map(m => ({ id: m.id, created: new Date(m.created * 1000), })); } // Anthropic 모델 목록 async function fetchAnthropicModels() { // Anthropic은 모델 목록 API가 없어서 문서 조회 필요 const response = await fetch('https://docs.anthropic.com/api/models'); return parseAnthropicModels(await response.text()); } // Google 모델 목록 async function fetchGoogleModels() { const genai = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY); // listModels API 사용 const models = []; for await (const model of genai.listModels()) { models.push(model); } return models; } ``` --- ## 자동 업데이트 스크립트 ```typescript // scripts/update-llm-info.ts // KreatSaaS 실행 전 또는 주기적으로 실행 import { writeFileSync } from 'fs'; interface LLMModel { provider: string; name: string; id: string; inputPrice: number; // per 1M tokens outputPrice: number; contextLength: number; features: string[]; lastUpdated: string; } // 최신 정보 저장 파일 const LLM_INFO_FILE = './data/llm-models.json'; async function updateLLMInfo() { console.log('🔄 LLM 모델 정보 업데이트 시작...'); const models: LLMModel[] = []; // 1. OpenAI console.log(' 📡 OpenAI 정보 조회...'); const openaiModels = await fetchOpenAILatest(); models.push(...openaiModels); // 2. Anthropic console.log(' 📡 Anthropic 정보 조회...'); const anthropicModels = await fetchAnthropicLatest(); models.push(...anthropicModels); // 3. Google console.log(' 📡 Google 정보 조회...'); const googleModels = await fetchGoogleLatest(); models.push(...googleModels); // 4. 기타 (Groq, DeepSeek, etc.) console.log(' 📡 기타 LLM 정보 조회...'); const otherModels = await fetchOtherLatest(); models.push(...otherModels); // 결과 저장 const result = { lastUpdated: new Date().toISOString(), models, }; writeFileSync(LLM_INFO_FILE, JSON.stringify(result, null, 2)); console.log(`✅ ${models.length}개 모델 정보 업데이트 완료!`); console.log(` 저장 위치: ${LLM_INFO_FILE}`); } // OpenAI 최신 정보 (웹 스크래핑 또는 API) async function fetchOpenAILatest(): Promise { // Context7 또는 직접 조회 return [ { provider: 'OpenAI', name: 'GPT-4o', id: 'gpt-4o', inputPrice: 2.50, outputPrice: 10.00, contextLength: 128000, features: ['vision', 'function-calling', 'json-mode'], lastUpdated: new Date().toISOString(), }, { provider: 'OpenAI', name: 'GPT-4o Mini', id: 'gpt-4o-mini', inputPrice: 0.15, outputPrice: 0.60, contextLength: 128000, features: ['vision', 'function-calling', 'json-mode'], lastUpdated: new Date().toISOString(), }, { provider: 'OpenAI', name: 'o1', id: 'o1', inputPrice: 15.00, outputPrice: 60.00, contextLength: 200000, features: ['reasoning', 'vision'], lastUpdated: new Date().toISOString(), }, { provider: 'OpenAI', name: 'o3-mini', id: 'o3-mini', inputPrice: 1.10, outputPrice: 4.40, contextLength: 128000, features: ['reasoning'], lastUpdated: new Date().toISOString(), }, ]; } // Anthropic 최신 정보 async function fetchAnthropicLatest(): Promise { return [ { provider: 'Anthropic', name: 'Claude Opus 4.5', id: 'claude-opus-4-5-20251101', inputPrice: 15.00, outputPrice: 75.00, contextLength: 200000, features: ['vision', 'tool-use', 'computer-use', 'extended-thinking'], lastUpdated: new Date().toISOString(), }, { provider: 'Anthropic', name: 'Claude Sonnet 4', id: 'claude-sonnet-4-20250514', inputPrice: 3.00, outputPrice: 15.00, contextLength: 200000, features: ['vision', 'tool-use', 'computer-use', 'extended-thinking'], lastUpdated: new Date().toISOString(), }, { provider: 'Anthropic', name: 'Claude Haiku 3.5', id: 'claude-haiku-3-5-20241022', inputPrice: 0.80, outputPrice: 4.00, contextLength: 200000, features: ['vision', 'tool-use'], lastUpdated: new Date().toISOString(), }, ]; } // Google 최신 정보 async function fetchGoogleLatest(): Promise { return [ { provider: 'Google', name: 'Gemini 2.5 Pro', id: 'gemini-2.5-pro', inputPrice: 1.25, outputPrice: 5.00, contextLength: 1000000, features: ['vision', 'audio', 'video', 'code-execution', 'grounding'], lastUpdated: new Date().toISOString(), }, { provider: 'Google', name: 'Gemini 2.5 Flash', id: 'gemini-2.5-flash', inputPrice: 0.075, outputPrice: 0.30, contextLength: 1000000, features: ['vision', 'audio', 'video', 'thinking'], lastUpdated: new Date().toISOString(), }, { provider: 'Google', name: 'Gemini 2.5 Flash (무료)', id: 'gemini-2.5-flash-preview-04-17', inputPrice: 0, outputPrice: 0, contextLength: 1000000, features: ['vision', 'audio', 'video', 'free-tier'], lastUpdated: new Date().toISOString(), }, ]; } // 기타 LLM async function fetchOtherLatest(): Promise { return [ // Groq { provider: 'Groq', name: 'Llama 3.3 70B', id: 'llama-3.3-70b-versatile', inputPrice: 0.59, outputPrice: 0.79, contextLength: 128000, features: ['fast-inference', 'tool-use'], lastUpdated: new Date().toISOString(), }, { provider: 'Groq', name: 'Llama 3.1 8B (무료)', id: 'llama-3.1-8b-instant', inputPrice: 0, outputPrice: 0, contextLength: 128000, features: ['fast-inference', 'free-tier'], lastUpdated: new Date().toISOString(), }, // DeepSeek { provider: 'DeepSeek', name: 'DeepSeek V3', id: 'deepseek-chat', inputPrice: 0.14, outputPrice: 0.28, contextLength: 128000, features: ['coding', 'reasoning', 'cheap'], lastUpdated: new Date().toISOString(), }, { provider: 'DeepSeek', name: 'DeepSeek R1', id: 'deepseek-reasoner', inputPrice: 0.55, outputPrice: 2.19, contextLength: 128000, features: ['reasoning', 'chain-of-thought'], lastUpdated: new Date().toISOString(), }, // Mistral { provider: 'Mistral', name: 'Mistral Large', id: 'mistral-large-latest', inputPrice: 2.00, outputPrice: 6.00, contextLength: 128000, features: ['function-calling', 'multilingual'], lastUpdated: new Date().toISOString(), }, // Together AI { provider: 'Together', name: 'Llama 3.3 70B Turbo', id: 'meta-llama/Llama-3.3-70B-Instruct-Turbo', inputPrice: 0.88, outputPrice: 0.88, contextLength: 128000, features: ['fast', 'open-source'], lastUpdated: new Date().toISOString(), }, { provider: 'Together', name: 'Qwen 2.5 72B', id: 'Qwen/Qwen2.5-72B-Instruct-Turbo', inputPrice: 1.20, outputPrice: 1.20, contextLength: 32000, features: ['multilingual', 'coding'], lastUpdated: new Date().toISOString(), }, ]; } // 실행 updateLLMInfo().catch(console.error); ``` --- ## 사용자 인터페이스 ### 실행 시 최신 정보 표시 ``` ┌─────────────────────────────────────────────────────────────┐ │ 🚀 KreatSaaS 시작 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 📡 LLM 모델 정보 업데이트 중... │ │ │ │ ✅ OpenAI: 4개 모델 (gpt-4o, gpt-4o-mini, o1, o3-mini) │ │ ✅ Anthropic: 3개 모델 (opus, sonnet, haiku) │ │ ✅ Google: 3개 모델 (gemini-2.5-pro, flash, flash-free) │ │ ✅ Groq: 2개 모델 (llama-3.3, llama-3.1) │ │ ✅ DeepSeek: 2개 모델 (v3, r1) │ │ │ │ 📊 총 14개 모델 정보 로드 완료! │ │ 🕐 마지막 업데이트: 2025-01-04 10:30:00 │ │ │ │ 💡 새 모델 발견: │ │ - GPT-4o 가격 인하 ($5 → $2.50/1M) │ │ - Claude Opus 4.5 출시 │ │ - Gemini 2.5 Flash 무료 티어 추가 │ │ │ └─────────────────────────────────────────────────────────────┘ ``` --- ## 최신 모델 추천 로직 ```typescript // 용도별 최신 모델 추천 function recommendModel(useCase: string): LLMModel[] { const models = loadLatestModels(); switch (useCase) { case 'cheap': // 가장 저렴한 모델 return models .filter(m => m.inputPrice > 0) // 무료 제외 .sort((a, b) => a.inputPrice - a.inputPrice) .slice(0, 3); case 'free': // 무료 모델 return models.filter(m => m.inputPrice === 0); case 'best': // 최고 성능 모델 return models.filter(m => m.id.includes('opus') || m.id.includes('gpt-4o') || m.id.includes('gemini-2.5-pro') ); case 'coding': // 코딩 특화 return models.filter(m => m.features.includes('coding') || m.provider === 'Anthropic' ); case 'reasoning': // 추론 특화 return models.filter(m => m.features.includes('reasoning') || m.id.includes('o1') || m.id.includes('o3') ); case 'vision': // 이미지 분석 return models.filter(m => m.features.includes('vision')); case 'fast': // 빠른 응답 return models.filter(m => m.provider === 'Groq' || m.id.includes('mini') || m.id.includes('flash') ); default: // 기본: 가성비 return models .sort((a, b) => { const costA = a.inputPrice + a.outputPrice; const costB = b.inputPrice + b.outputPrice; return costA - costB; }) .slice(0, 5); } } ``` --- ## MCP 설정 (자동 업데이트용) ### 방법 A: Local (npx) - 권장 ```json // .mcp.json { "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp@latest"], "description": "최신 라이브러리 문서 자동 조회" } } } ``` ### 방법 B: Remote HTTP (API Key 필요) ```json // .mcp.json { "mcpServers": { "context7": { "url": "https://mcp.context7.com/mcp", "transport": "http", "headers": { "CONTEXT7_API_KEY": "${CONTEXT7_API_KEY}" }, "description": "Context7 Remote MCP" } } } ``` ### Claude Code 설정 ```bash # Remote 방식 (권장) claude mcp add context7 https://mcp.context7.com/mcp --transport http # Local 방식 claude mcp add context7 -- npx -y @upstash/context7-mcp@latest ``` ### Cursor 설정 (Settings > MCP) ```json // Remote 방식 { "mcpServers": { "context7": { "url": "https://mcp.context7.com/mcp" } } } // Local 방식 { "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp@latest"] } } } ``` ### 자동 규칙 설정 (Cursor Rules) ``` // Cursor Settings > Rules에 추가하면 자동으로 Context7 호출 Always use Context7 MCP when I need library or API documentation. When I mention a library name, automatically fetch the latest docs. ``` ### KreatSaaS 전체 설정 ```json { "mcpServers": { "context7": { "command": "npx", "args": ["-y", "@upstash/context7-mcp@latest"], "description": "최신 라이브러리 문서 자동 조회", "autoUpdate": { "enabled": true, "onStart": true } } }, "autoUpdate": { "enabled": true, "libraries": [ "openai", "@anthropic-ai/sdk", "@google/genai", "groq-sdk", "together-ai", "@mistralai/mistralai", "@supabase/supabase-js", "next" ], "updateOnStart": true, "updateInterval": "24h" } } ``` --- ## 정리 ``` ┌─────────────────────────────────────────────────────────────┐ │ 🔄 LLM 자동 업데이트 시스템 │ ├─────────────────────────────────────────────────────────────┤ │ │ │ 1. 시작 시 자동 업데이트 │ │ - Context7 MCP로 최신 문서 조회 │ │ - 각 API의 모델 목록 조회 │ │ - 가격, 기능 정보 추출 │ │ │ │ 2. 주기적 업데이트 (24시간) │ │ - 백그라운드에서 자동 조회 │ │ - 변경사항 감지 시 알림 │ │ │ │ 3. 용도별 최신 모델 추천 │ │ - 저렴한 모델 │ │ - 무료 모델 │ │ - 최고 성능 모델 │ │ - 코딩/추론/비전 특화 │ │ │ │ ⚠️ 항상 최신 정보로 SaaS 아키텍처를 설계합니다! │ │ │ └─────────────────────────────────────────────────────────────┘ ```