@kood/claude-code 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +129 -5
- package/package.json +2 -2
- package/templates/hono/CLAUDE.md +20 -2
- package/templates/hono/docs/architecture/architecture.md +909 -0
- package/templates/hono/docs/commands/git.md +275 -0
- package/templates/hono/docs/deployment/cloudflare.md +527 -190
- package/templates/hono/docs/deployment/docker.md +514 -0
- package/templates/hono/docs/deployment/index.md +179 -214
- package/templates/hono/docs/deployment/railway.md +416 -0
- package/templates/hono/docs/deployment/vercel.md +567 -0
- package/templates/hono/docs/library/ai-sdk/index.md +427 -0
- package/templates/hono/docs/library/ai-sdk/openrouter.md +479 -0
- package/templates/hono/docs/library/ai-sdk/providers.md +468 -0
- package/templates/hono/docs/library/ai-sdk/streaming.md +447 -0
- package/templates/hono/docs/library/ai-sdk/structured-output.md +493 -0
- package/templates/hono/docs/library/ai-sdk/tools.md +513 -0
- package/templates/hono/docs/library/hono/env-setup.md +458 -0
- package/templates/hono/docs/library/hono/index.md +1 -3
- package/templates/hono/docs/library/pino/index.md +437 -0
- package/templates/hono/docs/library/prisma/cloudflare-d1.md +503 -0
- package/templates/hono/docs/library/prisma/config.md +362 -0
- package/templates/hono/docs/library/prisma/index.md +86 -13
- package/templates/hono/docs/skills/gemini-review/SKILL.md +116 -116
- package/templates/hono/docs/skills/gemini-review/references/checklists.md +125 -125
- package/templates/hono/docs/skills/gemini-review/references/prompt-templates.md +191 -191
- package/templates/npx/CLAUDE.md +309 -0
- package/templates/npx/docs/commands/git.md +275 -0
- package/templates/npx/docs/library/commander/index.md +164 -0
- package/templates/npx/docs/library/fs-extra/index.md +171 -0
- package/templates/npx/docs/library/prompts/index.md +253 -0
- package/templates/npx/docs/mcp/index.md +60 -0
- package/templates/npx/docs/skills/gemini-review/SKILL.md +220 -0
- package/templates/npx/docs/skills/gemini-review/references/checklists.md +134 -0
- package/templates/npx/docs/skills/gemini-review/references/prompt-templates.md +301 -0
- package/templates/tanstack-start/CLAUDE.md +43 -5
- package/templates/tanstack-start/docs/architecture/architecture.md +134 -4
- package/templates/tanstack-start/docs/commands/git.md +275 -0
- package/templates/tanstack-start/docs/deployment/cloudflare.md +223 -50
- package/templates/tanstack-start/docs/deployment/index.md +320 -30
- package/templates/tanstack-start/docs/deployment/nitro.md +195 -14
- package/templates/tanstack-start/docs/deployment/railway.md +302 -150
- package/templates/tanstack-start/docs/deployment/vercel.md +345 -75
- package/templates/tanstack-start/docs/guides/best-practices.md +203 -1
- package/templates/tanstack-start/docs/guides/env-setup.md +450 -0
- package/templates/tanstack-start/docs/library/ai-sdk/hooks.md +472 -0
- package/templates/tanstack-start/docs/library/ai-sdk/index.md +264 -0
- package/templates/tanstack-start/docs/library/ai-sdk/openrouter.md +371 -0
- package/templates/tanstack-start/docs/library/ai-sdk/providers.md +403 -0
- package/templates/tanstack-start/docs/library/ai-sdk/streaming.md +320 -0
- package/templates/tanstack-start/docs/library/ai-sdk/structured-output.md +454 -0
- package/templates/tanstack-start/docs/library/ai-sdk/tools.md +473 -0
- package/templates/tanstack-start/docs/library/pino/index.md +320 -0
- package/templates/tanstack-start/docs/library/prisma/cloudflare-d1.md +404 -0
- package/templates/tanstack-start/docs/library/prisma/config.md +377 -0
- package/templates/tanstack-start/docs/library/prisma/index.md +3 -5
- package/templates/tanstack-start/docs/library/prisma/schema.md +123 -25
- package/templates/tanstack-start/docs/library/prisma/setup.md +0 -7
- package/templates/tanstack-start/docs/library/tanstack-start/server-functions.md +80 -2
- package/templates/tanstack-start/docs/skills/gemini-review/SKILL.md +116 -116
- package/templates/tanstack-start/docs/skills/gemini-review/references/checklists.md +138 -144
- package/templates/tanstack-start/docs/skills/gemini-review/references/prompt-templates.md +186 -187
- package/templates/hono/docs/git/index.md +0 -180
- package/templates/tanstack-start/docs/git/index.md +0 -203
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
# AI SDK - 프로바이더 (Hono)
|
|
2
|
+
|
|
3
|
+
> **상위 문서**: [AI SDK](./index.md)
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 개요
|
|
8
|
+
|
|
9
|
+
AI SDK 프로바이더를 Hono와 함께 사용하는 방법입니다. Cloudflare Workers 환경에서의 설정을 포함합니다.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## 설치
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @ai-sdk/openai # OpenAI
|
|
17
|
+
npm install @ai-sdk/anthropic # Anthropic (Claude)
|
|
18
|
+
npm install @ai-sdk/google # Google (Gemini)
|
|
19
|
+
npm install @ai-sdk/mistral # Mistral
|
|
20
|
+
npm install @ai-sdk/groq # Groq
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## OpenAI
|
|
26
|
+
|
|
27
|
+
### 기본 사용
|
|
28
|
+
|
|
29
|
+
```typescript
|
|
30
|
+
import { Hono } from 'hono'
|
|
31
|
+
import { streamText } from 'ai'
|
|
32
|
+
import { openai } from '@ai-sdk/openai'
|
|
33
|
+
|
|
34
|
+
const app = new Hono()
|
|
35
|
+
|
|
36
|
+
app.post('/api/chat', async (c) => {
|
|
37
|
+
const { messages } = await c.req.json()
|
|
38
|
+
|
|
39
|
+
const result = streamText({
|
|
40
|
+
model: openai('gpt-4o'),
|
|
41
|
+
messages,
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
return result.toUIMessageStreamResponse()
|
|
45
|
+
})
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Cloudflare Workers 설정
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { Hono } from 'hono'
|
|
52
|
+
import { streamText } from 'ai'
|
|
53
|
+
import { createOpenAI } from '@ai-sdk/openai'
|
|
54
|
+
|
|
55
|
+
type Bindings = {
|
|
56
|
+
OPENAI_API_KEY: string
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const app = new Hono<{ Bindings: Bindings }>()
|
|
60
|
+
|
|
61
|
+
app.post('/api/chat', async (c) => {
|
|
62
|
+
const openai = createOpenAI({
|
|
63
|
+
apiKey: c.env.OPENAI_API_KEY,
|
|
64
|
+
})
|
|
65
|
+
|
|
66
|
+
const { messages } = await c.req.json()
|
|
67
|
+
|
|
68
|
+
const result = streamText({
|
|
69
|
+
model: openai('gpt-4o'),
|
|
70
|
+
messages,
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
return result.toUIMessageStreamResponse()
|
|
74
|
+
})
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### 사용 가능한 모델
|
|
78
|
+
|
|
79
|
+
| 모델 | 설명 |
|
|
80
|
+
|------|------|
|
|
81
|
+
| `gpt-4o` | 최신 GPT-4 Omni |
|
|
82
|
+
| `gpt-4o-mini` | 경량화된 GPT-4o |
|
|
83
|
+
| `gpt-4-turbo` | GPT-4 Turbo |
|
|
84
|
+
| `o1` | 추론 최적화 모델 |
|
|
85
|
+
| `o1-mini` | 경량 추론 모델 |
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Anthropic (Claude)
|
|
90
|
+
|
|
91
|
+
### 기본 사용
|
|
92
|
+
|
|
93
|
+
```typescript
|
|
94
|
+
import { Hono } from 'hono'
|
|
95
|
+
import { streamText } from 'ai'
|
|
96
|
+
import { anthropic } from '@ai-sdk/anthropic'
|
|
97
|
+
|
|
98
|
+
const app = new Hono()
|
|
99
|
+
|
|
100
|
+
app.post('/api/chat', async (c) => {
|
|
101
|
+
const { messages } = await c.req.json()
|
|
102
|
+
|
|
103
|
+
const result = streamText({
|
|
104
|
+
model: anthropic('claude-3-5-sonnet-20241022'),
|
|
105
|
+
messages,
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
return result.toUIMessageStreamResponse()
|
|
109
|
+
})
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Cloudflare Workers 설정
|
|
113
|
+
|
|
114
|
+
```typescript
|
|
115
|
+
import { Hono } from 'hono'
|
|
116
|
+
import { streamText } from 'ai'
|
|
117
|
+
import { createAnthropic } from '@ai-sdk/anthropic'
|
|
118
|
+
|
|
119
|
+
type Bindings = {
|
|
120
|
+
ANTHROPIC_API_KEY: string
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
const app = new Hono<{ Bindings: Bindings }>()
|
|
124
|
+
|
|
125
|
+
app.post('/api/chat', async (c) => {
|
|
126
|
+
const anthropic = createAnthropic({
|
|
127
|
+
apiKey: c.env.ANTHROPIC_API_KEY,
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
const { messages } = await c.req.json()
|
|
131
|
+
|
|
132
|
+
const result = streamText({
|
|
133
|
+
model: anthropic('claude-3-5-sonnet-20241022'),
|
|
134
|
+
messages,
|
|
135
|
+
})
|
|
136
|
+
|
|
137
|
+
return result.toUIMessageStreamResponse()
|
|
138
|
+
})
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### 사용 가능한 모델
|
|
142
|
+
|
|
143
|
+
| 모델 | 설명 |
|
|
144
|
+
|------|------|
|
|
145
|
+
| `claude-3-5-sonnet-20241022` | Claude 3.5 Sonnet (최신) |
|
|
146
|
+
| `claude-3-5-haiku-20241022` | Claude 3.5 Haiku (빠름) |
|
|
147
|
+
| `claude-3-opus-20240229` | Claude 3 Opus (강력) |
|
|
148
|
+
|
|
149
|
+
---
|
|
150
|
+
|
|
151
|
+
## Google (Gemini)
|
|
152
|
+
|
|
153
|
+
### 기본 사용
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
import { Hono } from 'hono'
|
|
157
|
+
import { streamText } from 'ai'
|
|
158
|
+
import { google } from '@ai-sdk/google'
|
|
159
|
+
|
|
160
|
+
const app = new Hono()
|
|
161
|
+
|
|
162
|
+
app.post('/api/chat', async (c) => {
|
|
163
|
+
const { messages } = await c.req.json()
|
|
164
|
+
|
|
165
|
+
const result = streamText({
|
|
166
|
+
model: google('gemini-1.5-pro'),
|
|
167
|
+
messages,
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
return result.toUIMessageStreamResponse()
|
|
171
|
+
})
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Cloudflare Workers 설정
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
import { Hono } from 'hono'
|
|
178
|
+
import { streamText } from 'ai'
|
|
179
|
+
import { createGoogleGenerativeAI } from '@ai-sdk/google'
|
|
180
|
+
|
|
181
|
+
type Bindings = {
|
|
182
|
+
GOOGLE_GENERATIVE_AI_API_KEY: string
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const app = new Hono<{ Bindings: Bindings }>()
|
|
186
|
+
|
|
187
|
+
app.post('/api/chat', async (c) => {
|
|
188
|
+
const google = createGoogleGenerativeAI({
|
|
189
|
+
apiKey: c.env.GOOGLE_GENERATIVE_AI_API_KEY,
|
|
190
|
+
})
|
|
191
|
+
|
|
192
|
+
const { messages } = await c.req.json()
|
|
193
|
+
|
|
194
|
+
const result = streamText({
|
|
195
|
+
model: google('gemini-1.5-pro'),
|
|
196
|
+
messages,
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
return result.toUIMessageStreamResponse()
|
|
200
|
+
})
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
### 사용 가능한 모델
|
|
204
|
+
|
|
205
|
+
| 모델 | 설명 |
|
|
206
|
+
|------|------|
|
|
207
|
+
| `gemini-1.5-pro` | Gemini 1.5 Pro |
|
|
208
|
+
| `gemini-1.5-flash` | Gemini 1.5 Flash (빠름) |
|
|
209
|
+
| `gemini-2.0-flash-exp` | Gemini 2.0 Flash (실험) |
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Groq
|
|
214
|
+
|
|
215
|
+
### 기본 사용
|
|
216
|
+
|
|
217
|
+
```typescript
|
|
218
|
+
import { Hono } from 'hono'
|
|
219
|
+
import { streamText } from 'ai'
|
|
220
|
+
import { groq } from '@ai-sdk/groq'
|
|
221
|
+
|
|
222
|
+
const app = new Hono()
|
|
223
|
+
|
|
224
|
+
app.post('/api/chat', async (c) => {
|
|
225
|
+
const { messages } = await c.req.json()
|
|
226
|
+
|
|
227
|
+
const result = streamText({
|
|
228
|
+
model: groq('llama-3.1-70b-versatile'),
|
|
229
|
+
messages,
|
|
230
|
+
})
|
|
231
|
+
|
|
232
|
+
return result.toUIMessageStreamResponse()
|
|
233
|
+
})
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
### Cloudflare Workers 설정
|
|
237
|
+
|
|
238
|
+
```typescript
|
|
239
|
+
import { Hono } from 'hono'
|
|
240
|
+
import { streamText } from 'ai'
|
|
241
|
+
import { createGroq } from '@ai-sdk/groq'
|
|
242
|
+
|
|
243
|
+
type Bindings = {
|
|
244
|
+
GROQ_API_KEY: string
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const app = new Hono<{ Bindings: Bindings }>()
|
|
248
|
+
|
|
249
|
+
app.post('/api/chat', async (c) => {
|
|
250
|
+
const groq = createGroq({
|
|
251
|
+
apiKey: c.env.GROQ_API_KEY,
|
|
252
|
+
})
|
|
253
|
+
|
|
254
|
+
const { messages } = await c.req.json()
|
|
255
|
+
|
|
256
|
+
const result = streamText({
|
|
257
|
+
model: groq('llama-3.1-70b-versatile'),
|
|
258
|
+
messages,
|
|
259
|
+
})
|
|
260
|
+
|
|
261
|
+
return result.toUIMessageStreamResponse()
|
|
262
|
+
})
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 다중 프로바이더 설정
|
|
268
|
+
|
|
269
|
+
```typescript
|
|
270
|
+
import { Hono } from 'hono'
|
|
271
|
+
import { streamText } from 'ai'
|
|
272
|
+
import { createOpenAI } from '@ai-sdk/openai'
|
|
273
|
+
import { createAnthropic } from '@ai-sdk/anthropic'
|
|
274
|
+
import { createGoogleGenerativeAI } from '@ai-sdk/google'
|
|
275
|
+
|
|
276
|
+
type Bindings = {
|
|
277
|
+
OPENAI_API_KEY: string
|
|
278
|
+
ANTHROPIC_API_KEY: string
|
|
279
|
+
GOOGLE_GENERATIVE_AI_API_KEY: string
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const app = new Hono<{ Bindings: Bindings }>()
|
|
283
|
+
|
|
284
|
+
app.post('/api/chat/:provider', async (c) => {
|
|
285
|
+
const provider = c.req.param('provider')
|
|
286
|
+
const { messages } = await c.req.json()
|
|
287
|
+
|
|
288
|
+
let model
|
|
289
|
+
|
|
290
|
+
switch (provider) {
|
|
291
|
+
case 'openai':
|
|
292
|
+
const openai = createOpenAI({ apiKey: c.env.OPENAI_API_KEY })
|
|
293
|
+
model = openai('gpt-4o')
|
|
294
|
+
break
|
|
295
|
+
case 'anthropic':
|
|
296
|
+
const anthropic = createAnthropic({ apiKey: c.env.ANTHROPIC_API_KEY })
|
|
297
|
+
model = anthropic('claude-3-5-sonnet-20241022')
|
|
298
|
+
break
|
|
299
|
+
case 'google':
|
|
300
|
+
const google = createGoogleGenerativeAI({
|
|
301
|
+
apiKey: c.env.GOOGLE_GENERATIVE_AI_API_KEY,
|
|
302
|
+
})
|
|
303
|
+
model = google('gemini-1.5-pro')
|
|
304
|
+
break
|
|
305
|
+
default:
|
|
306
|
+
return c.json({ error: 'Unknown provider' }, 400)
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
const result = streamText({ model, messages })
|
|
310
|
+
|
|
311
|
+
return result.toUIMessageStreamResponse()
|
|
312
|
+
})
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## 프로바이더 미들웨어
|
|
318
|
+
|
|
319
|
+
```typescript
|
|
320
|
+
import { Hono } from 'hono'
|
|
321
|
+
import { createMiddleware } from 'hono/factory'
|
|
322
|
+
import { streamText } from 'ai'
|
|
323
|
+
import { createOpenAI } from '@ai-sdk/openai'
|
|
324
|
+
import { createAnthropic } from '@ai-sdk/anthropic'
|
|
325
|
+
|
|
326
|
+
type Bindings = {
|
|
327
|
+
OPENAI_API_KEY: string
|
|
328
|
+
ANTHROPIC_API_KEY: string
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
type Variables = {
|
|
332
|
+
providers: {
|
|
333
|
+
openai: ReturnType<typeof createOpenAI>
|
|
334
|
+
anthropic: ReturnType<typeof createAnthropic>
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
const providersMiddleware = createMiddleware<{
|
|
339
|
+
Bindings: Bindings
|
|
340
|
+
Variables: Variables
|
|
341
|
+
}>(async (c, next) => {
|
|
342
|
+
c.set('providers', {
|
|
343
|
+
openai: createOpenAI({ apiKey: c.env.OPENAI_API_KEY }),
|
|
344
|
+
anthropic: createAnthropic({ apiKey: c.env.ANTHROPIC_API_KEY }),
|
|
345
|
+
})
|
|
346
|
+
await next()
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
const app = new Hono<{ Bindings: Bindings; Variables: Variables }>()
|
|
350
|
+
|
|
351
|
+
app.use('/api/*', providersMiddleware)
|
|
352
|
+
|
|
353
|
+
app.post('/api/chat', async (c) => {
|
|
354
|
+
const { messages, provider = 'openai' } = await c.req.json()
|
|
355
|
+
const providers = c.get('providers')
|
|
356
|
+
|
|
357
|
+
const model =
|
|
358
|
+
provider === 'anthropic'
|
|
359
|
+
? providers.anthropic('claude-3-5-sonnet-20241022')
|
|
360
|
+
: providers.openai('gpt-4o')
|
|
361
|
+
|
|
362
|
+
const result = streamText({ model, messages })
|
|
363
|
+
|
|
364
|
+
return result.toUIMessageStreamResponse()
|
|
365
|
+
})
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
---
|
|
369
|
+
|
|
370
|
+
## 모델 파라미터
|
|
371
|
+
|
|
372
|
+
```typescript
|
|
373
|
+
const result = streamText({
|
|
374
|
+
model: openai('gpt-4o'),
|
|
375
|
+
messages,
|
|
376
|
+
|
|
377
|
+
// 공통 파라미터
|
|
378
|
+
temperature: 0.7, // 창의성 (0-2)
|
|
379
|
+
maxTokens: 1000, // 최대 토큰 수
|
|
380
|
+
topP: 0.9, // 핵 샘플링
|
|
381
|
+
frequencyPenalty: 0.5, // 반복 억제
|
|
382
|
+
presencePenalty: 0.5, // 새로운 주제 유도
|
|
383
|
+
stopSequences: ['\n\n'], // 생성 중단 시퀀스
|
|
384
|
+
})
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
## OpenRouter (통합 게이트웨이)
|
|
390
|
+
|
|
391
|
+
하나의 API 키로 수백 개 모델에 접근할 수 있는 통합 게이트웨이입니다.
|
|
392
|
+
|
|
393
|
+
### 설치
|
|
394
|
+
|
|
395
|
+
```bash
|
|
396
|
+
npm install @openrouter/ai-sdk-provider
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
### Hono 사용
|
|
400
|
+
|
|
401
|
+
```typescript
|
|
402
|
+
import { Hono } from 'hono'
|
|
403
|
+
import { streamText, convertToModelMessages } from 'ai'
|
|
404
|
+
import { createOpenRouter } from '@openrouter/ai-sdk-provider'
|
|
405
|
+
|
|
406
|
+
type Bindings = {
|
|
407
|
+
OPENROUTER_API_KEY: string
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
const app = new Hono<{ Bindings: Bindings }>()
|
|
411
|
+
|
|
412
|
+
app.post('/api/chat', async (c) => {
|
|
413
|
+
const openrouter = createOpenRouter({
|
|
414
|
+
apiKey: c.env.OPENROUTER_API_KEY,
|
|
415
|
+
})
|
|
416
|
+
|
|
417
|
+
const { messages, model } = await c.req.json()
|
|
418
|
+
|
|
419
|
+
const result = streamText({
|
|
420
|
+
model: openrouter.chat(model ?? 'anthropic/claude-3.5-sonnet'),
|
|
421
|
+
messages: convertToModelMessages(messages),
|
|
422
|
+
})
|
|
423
|
+
|
|
424
|
+
return result.toUIMessageStreamResponse()
|
|
425
|
+
})
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
### 인기 모델
|
|
429
|
+
|
|
430
|
+
| 모델 ID | 설명 |
|
|
431
|
+
|---------|------|
|
|
432
|
+
| `anthropic/claude-3.5-sonnet` | Claude 3.5 Sonnet |
|
|
433
|
+
| `openai/gpt-4o` | GPT-4o |
|
|
434
|
+
| `google/gemini-pro-1.5` | Gemini Pro 1.5 |
|
|
435
|
+
| `meta-llama/llama-3.1-70b-instruct` | Llama 3.1 70B |
|
|
436
|
+
|
|
437
|
+
자세한 내용: [OpenRouter 가이드](./openrouter.md)
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
## 환경 변수 설정
|
|
442
|
+
|
|
443
|
+
### .env (로컬 개발)
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
OPENAI_API_KEY=sk-...
|
|
447
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
448
|
+
GOOGLE_GENERATIVE_AI_API_KEY=...
|
|
449
|
+
GROQ_API_KEY=gsk_...
|
|
450
|
+
MISTRAL_API_KEY=...
|
|
451
|
+
OPENROUTER_API_KEY=sk-or-v1-...
|
|
452
|
+
```
|
|
453
|
+
|
|
454
|
+
### wrangler.toml (Cloudflare Workers)
|
|
455
|
+
|
|
456
|
+
```toml
|
|
457
|
+
[vars]
|
|
458
|
+
# 민감하지 않은 변수만 여기에
|
|
459
|
+
|
|
460
|
+
# 민감한 키는 Cloudflare 대시보드에서 설정:
|
|
461
|
+
# Settings > Variables > Environment Variables
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
### Cloudflare 대시보드 설정
|
|
465
|
+
|
|
466
|
+
1. Workers & Pages > 프로젝트 선택
|
|
467
|
+
2. Settings > Variables
|
|
468
|
+
3. Environment Variables에서 API 키 추가
|