Lambda AI
Lambda AI는 대규모 추론에 최적화된 자체 클라우드 GPU 인프라를 통해 다양한 오픈소스 언어 모델에 접근을 제공해요. 모든 Lambda AI 모델을 지원해요. completion 요청 시 lambda_ai/ 접두사로 설정하기만 하면 돼요.
출처: 문서
본문
개요 (Overview)
| 속성 |
설명 |
| 설명 |
대규모 추론에 최적화된 클라우드 GPU 인프라로 다양한 오픈소스 언어 모델 접근 제공 |
| LiteLLM 라우트 |
lambda_ai/ |
| 공급자 문서 |
Lambda AI API Documentation |
| 기본 URL |
https://api.lambda.ai/v1 |
| 지원 작업 |
/chat/completions |
사용 가능한 모델 (Available Models)
대형 언어 모델
| 모델 |
설명 |
컨텍스트 창 |
| lambda_ai/llama3.3-70b-instruct-fp8 |
FP8 양자화된 Llama 3.3 70B |
8,192 토큰 |
| lambda_ai/llama3.1-405b-instruct-fp8 |
FP8 양자화된 Llama 3.1 405B |
8,192 토큰 |
| lambda_ai/llama3.1-70b-instruct-fp8 |
FP8 양자화된 Llama 3.1 70B |
8,192 토큰 |
| lambda_ai/llama3.1-8b-instruct |
Llama 3.1 8B instruction-tuned |
8,192 토큰 |
| lambda_ai/llama3.1-nemotron-70b-instruct-fp8 |
Llama 3.1 Nemotron 70B |
8,192 토큰 |
DeepSeek 모델
| 모델 |
설명 |
컨텍스트 창 |
| lambda_ai/deepseek-llama3.3-70b |
DeepSeek Llama 3.3 70B |
8,192 토큰 |
| lambda_ai/deepseek-r1-0528 |
DeepSeek R1 0528 |
8,192 토큰 |
| lambda_ai/deepseek-r1-671b |
DeepSeek R1 671B |
8,192 토큰 |
| lambda_ai/deepseek-v3-0324 |
DeepSeek V3 0324 |
8,192 토큰 |
Hermes 모델
| 모델 |
설명 |
컨텍스트 창 |
| lambda_ai/hermes3-405b |
Hermes 3 405B |
8,192 토큰 |
| lambda_ai/hermes3-70b |
Hermes 3 70B |
8,192 토큰 |
| lambda_ai/hermes3-8b |
Hermes 3 8B |
8,192 토큰 |
코딩 모델
| 모델 |
설명 |
컨텍스트 창 |
| lambda_ai/qwen25-coder-32b-instruct |
Qwen 2.5 Coder 32B |
8,192 토큰 |
| lambda_ai/qwen3-32b-fp8 |
FP8인 Qwen 3 32B |
8,192 토큰 |
비전 모델
| 모델 |
설명 |
컨텍스트 창 |
| lambda_ai/llama3.2-11b-vision-instruct |
비전 기능이 있는 Llama 3.2 11B |
8,192 토큰 |
특수 모델
| 모델 |
설명 |
컨텍스트 창 |
| lambda_ai/llama-4-maverick-17b-128e-instruct-fp8 |
128k 컨텍스트의 Llama 4 Maverick |
131,072 토큰 |
| lambda_ai/llama-4-scout-17b-16e-instruct |
16k 컨텍스트의 Llama 4 Scout |
16,384 토큰 |
| lambda_ai/lfm-40b |
LFM 40B 모델 |
8,192 토큰 |
| lambda_ai/lfm-7b |
LFM 7B 모델 |
8,192 토큰 |
필수 변수
os.environ["LAMBDA_API_KEY"] = "" # your Lambda AI API key
LiteLLM Python SDK 사용법
비스트리밍 (Non-streaming)
import os
import litellm
from litellm import completion
os.environ["LAMBDA_API_KEY"] = "" # your Lambda AI API key
messages = [{"content": "Hello, how are you?", "role": "user"}]
# Lambda AI call
response = completion(
model="lambda_ai/llama3.1-8b-instruct",
messages=messages
)
print(response)
스트리밍 (Streaming)
import os
import litellm
from litellm import completion
os.environ["LAMBDA_API_KEY"] = "" # your Lambda AI API key
messages = [{"content": "Write a short story about AI", "role": "user"}]
# Lambda AI call with streaming
response = completion(
model="lambda_ai/llama3.1-70b-instruct-fp8",
messages=messages,
stream=True
)
for chunk in response:
print(chunk)
비전/멀티모달 지원
Llama 3.2 Vision 모델은 이미지 입력을 지원해요.
import os
import litellm
from litellm import completion
os.environ["LAMBDA_API_KEY"] = "" # your Lambda AI API key
messages = [{
"role": "user",
"content": [
{
"type": "text",
"text": "What's in this image?"
},
{
"type": "image_url",
"image_url": {
"url": "https://example.com/image.jpg"
}
}
]
}]
# Lambda AI vision model call
response = completion(
model="lambda_ai/llama3.2-11b-vision-instruct",
messages=messages
)
print(response)
Function Calling
Lambda AI 모델은 function calling을 지원해요.
import os
import litellm
from litellm import completion
os.environ["LAMBDA_API_KEY"] = "" # your Lambda AI API key
# Define tools
tools = [{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather in a location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
}
},
"required": ["location"]
}
}
}]
messages = [{"role": "user", "content": "What's the weather in Boston?"}]
# Lambda AI call with function calling
response = completion(
model="lambda_ai/hermes3-70b",
messages=messages,
tools=tools,
tool_choice="auto"
)
print(response)
LiteLLM Proxy Server 사용법
config.yaml:
model_list:
- model_name: llama-8b
litellm_params:
model: lambda_ai/llama3.1-8b-instruct
api_key: os.environ/LAMBDA_API_KEY
- model_name: deepseek-70b
litellm_params:
model: lambda_ai/deepseek-llama3.3-70b
api_key: os.environ/LAMBDA_API_KEY
- model_name: hermes-405b
litellm_params:
model: lambda_ai/hermes3-405b
api_key: os.environ/LAMBDA_API_KEY
- model_name: qwen-coder
litellm_params:
model: lambda_ai/qwen25-coder-32b-instruct
api_key: os.environ/LAMBDA_API_KEY
사용자 지정 API Base (Custom API Base)
사용자 지정 API base URL을 사용해야 하는 경우:
import os
import litellm
from litellm import completion
# Using environment variable
os.environ["LAMBDA_API_BASE"] = "https://custom.lambda-api.com/v1"
os.environ["LAMBDA_API_KEY"] = "" # your API key
# Or pass directly
response = completion(
model="lambda_ai/llama3.1-8b-instruct",
messages=[{"content": "Hello!", "role": "user"}],
api_base="https://custom.lambda-api.com/v1",
api_key="your-api-key"
)
고급 파라미터
response = completion(
model="lambda_ai/hermes3-405b",
messages=[{"content": "Explain quantum computing", "role": "user"}],
temperature=0.7,
max_tokens=500,
top_p=0.9,
frequency_penalty=0.2,
presence_penalty=0.1
)
더 알아보기 (Learn more)