Amazon Nova

Amazon Nova

Amazon Nova는 Amazon이 만든 파운데이션 모델 제품군으로, 최첨단 지능과 업계 선도적인 가격 대비 성능을 제공해요.

속성 세부 내용
설명 Amazon Nova는 Amazon이 만든 파운데이션 모델 제품군으로, 최첨단 지능과 업계 선도적인 가격 대비 성능을 제공해요.
LiteLLM 프로바이더 라우트 amazon_nova/
프로바이더 문서 Amazon Nova ↗
지원 OpenAI 엔드포인트 /chat/completions, v1/responses
기타 지원 엔드포인트 v1/messages, /generateContent

출처: 문서

본문

인증 (Authentication)

Amazon Nova는 API 키 인증을 사용해요. Amazon Nova 개발자 콘솔 ↗에서 API 키를 받을 수 있어요.

export AMAZON_NOVA_API_KEY="your-api-key"

사용법 (Usage)

SDK

import os
from litellm import completion

# Set your API key
os.environ["AMAZON_NOVA_API_KEY"] = "your-api-key"

response = completion(
    model="amazon_nova/nova-micro-v1",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "Hello, how are you?"}
    ]
)

print(response)

PROXY

1. config.yaml 설정하기

model_list:
  - model_name: amazon-nova-micro
    litellm_params:
      model: amazon_nova/nova-micro-v1
      api_key: os.environ/AMAZON_NOVA_API_KEY

2. 프록시 시작하기

litellm --config /path/to/config.yaml

3. 테스트하기

curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
    "model": "amazon-nova-micro",
    "messages": [
        {
            "role": "user",
            "content": "Hello, how are you?"
        }
    ]
}'

지원 모델 (Supported Models)

모델 이름 사용법 컨텍스트 창
Nova Micro completion(model="amazon_nova/nova-micro-v1", messages=messages) 128K tokens
Nova Lite completion(model="amazon_nova/nova-lite-v1", messages=messages) 300K tokens
Nova Pro completion(model="amazon_nova/nova-pro-v1", messages=messages) 300K tokens
Nova Premier completion(model="amazon_nova/nova-premier-v1", messages=messages) 1M tokens

사용법 - 스트리밍 (Streaming)

SDK

import os
from litellm import completion

os.environ["AMAZON_NOVA_API_KEY"] = "your-api-key"

response = completion(
    model="amazon_nova/nova-micro-v1",
    messages=[
        {"role": "system", "content": "You are a helpful assistant"},
        {"role": "user", "content": "Tell me about machine learning"}
    ],
    stream=True
)

for chunk in response:
    print(chunk.choices[0].delta.content or "", end="")

PROXY

curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
    "model": "amazon-nova-micro",
    "messages": [
        {
            "role": "user",
            "content": "Tell me about machine learning"
        }
    ],
    "stream": true
}'

사용법 - 함수 호출 / 도구 사용

SDK

import os
from litellm import completion

os.environ["AMAZON_NOVA_API_KEY"] = "your-api-key"

tools = [
    {
        "type": "function",
        "function": {
            "name": "getCurrentWeather",
            "description": "Get the current weather in a given city",
            "parameters": {
                "type": "object",
                "properties": {
                    "location": {
                        "type": "string",
                        "description": "City and country e.g. San Francisco, CA"
                    }
                },
                "required": ["location"]
            }
        }
    }
]

response = completion(
    model="amazon_nova/nova-micro-v1",
    messages=[
        {"role": "user", "content": "What's the weather like in San Francisco?"}
    ],
    tools=tools
)

print(response)

PROXY

curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
    "model": "amazon-nova-micro",
    "messages": [
        {
            "role": "user",
            "content": "What's the weather like in San Francisco?"
        }
    ],
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "getCurrentWeather",
                "description": "Get the current weather in a given city",
                "parameters": {
                    "type": "object",
                    "properties": {
                        "location": {
                            "type": "string",
                            "description": "City and country e.g. San Francisco, CA"
                        }
                    },
                    "required": ["location"]
                }
            }
        }
    ]
}'

temperature, top_p 등 설정하기

SDK

import os
from litellm import completion

os.environ["AMAZON_NOVA_API_KEY"] = "your-api-key"

response = completion(
    model="amazon_nova/nova-pro-v1",
    messages=[
        {"role": "user", "content": "Write a creative story"}
    ],
    temperature=0.8,
    max_tokens=500,
    top_p=0.9
)

print(response)

yaml에 설정하기

model_list:
  - model_name: amazon-nova-pro
    litellm_params:
      model: amazon_nova/nova-pro-v1
      temperature: 0.8
      max_tokens: 500
      top_p: 0.9

요청에 설정하기

curl --location 'http://0.0.0.0:4000/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
    "model": "amazon-nova-pro",
    "messages": [
        {
            "role": "user",
            "content": "Write a creative story"
        }
    ],
    "temperature": 0.8,
    "max_tokens": 500,
    "top_p": 0.9
}'

모델 비교 (Model Comparison)

모델 최적 용도 속도 비용 컨텍스트
Nova Micro 단순 작업, 높은 처리량 가장 빠름 가장 낮음 128K
Nova Lite 균형 잡힌 성능 빠름 낮음 300K
Nova Pro 복잡한 추론 중간 중간 300K
Nova Premier 가장 고급 작업 느림 높음 1M

오류 처리 (Error Handling)

흔한 오류 코드와 의미:

  • 401 Unauthorized: 잘못된 API 키
  • 429 Too Many Requests: 속도 제한 초과
  • 400 Bad Request: 잘못된 요청 형식
  • 500 Internal Server Error: 서비스 일시적 불가

더 알아보기 (Learn more)