Llama Guard 4 12B
meta/llama-guard-4-12bLlama Guard 4 is a Llama 4 Scout-derived multimodal pretrained model, fine-tuned for content safety classification. Similar to previous versions, it can be used to classify content in both LLM...
Thông số kỹ thuật
- Giá đầu vào
- $0.18USD / 1M token
- Giá đầu ra
- $0.18USD / 1M token
- Cửa sổ ngữ cảnh
- 163.8K
- Đầu ra tối đa
- 16.4K
- Modalities
- Văn bản, hình ảnhVăn bản
- Phát hành
- 30 thg 4, 2025
- Chat: Được hỗ trợ
- Thị giác: Được hỗ trợ
- Suy luận: Không được hỗ trợ
- Đầu ra có cấu trúc: Không được hỗ trợ
- Gọi hàm: Không được hỗ trợ
- Đầu vào âm thanh: Không được hỗ trợ
Prices in USD / 1M token
Bắt đầu nhanh
import os
import requests
headers = {"Authorization": f"Bearer {os.environ['SANDBASE_API_KEY']}"}
payload = {
"model": "meta/llama-guard-4-12b",
"messages": [
{
"role": "user",
"content": "Hello",
},
],
"max_tokens": 2048,
}
response = requests.post(
"https://api.sandbase.ai/v1/chat/completions",
headers=headers,
json=payload,
)
response.raise_for_status()
print(response.json())Thử model
Phòng thử nghiệm
Viết prompt để thử model này. Việc sử dụng sẽ được tính phí theo mức giá hiển thị.
Thử một prompt
Thêm hình ảnh (không bắt buộc)
Phản hồi của bạn sẽ xuất hiện ở đây
Chọn một ví dụ hoặc viết prompt, rồi nhấp Chạy.
Bắt đầu xây dựng
Gửi request đầu tiên của bạn
Endpoint tương thích OpenAI với xác thực và theo dõi mức sử dụng thống nhất.
curl -X POST "https://api.sandbase.ai/v1/chat/completions" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "meta/llama-guard-4-12b",
"messages": [
{
"role": "user",
"content": "Hello"
}
],
"max_tokens": 2048
}'Schema đầu vào
10 tham số · 1 bắt buộc · 9 tùy chọn
| Tham số | Kiểu | Bắt buộc | Mô tả |
|---|---|---|---|
messages | object[] | Bắt buộc | Conversation so far, as an ordered list of messages with a role (system, user or assistant) and content. |
seed | integer | Tùy chọn | Best-effort deterministic sampling: repeated requests with the same seed and parameters should return similar results. |
stop | string[] | Tùy chọn | Sequences where the model stops generating. The stop sequence is not included in the output. |
top_k | integer | Tùy chọn | Only sample from the k most likely next tokens. · Tối thiểu: 0 |
top_p | number | Tùy chọn | Nucleus sampling: only tokens within this cumulative probability are considered. · Tối thiểu: 0 · Tối đa: 1 |
stream | boolean | Tùy chọn | Stream the response as server-sent events instead of returning it in one piece. · Mặc định: false |
max_tokens | integer | Tùy chọn | Maximum number of tokens to generate in the response. · Tối đa: 16384 |
temperature | number | Tùy chọn | Sampling temperature. Higher values make output more random; lower values make it more focused. · Tối thiểu: 0 · Tối đa: 2 · Mặc định: 1 |
presence_penalty | number | Tùy chọn | Penalizes tokens that already appear at all, encouraging new topics. · Tối thiểu: -2 · Tối đa: 2 |
frequency_penalty | number | Tùy chọn | Penalizes tokens by how often they already appear, reducing repetition. · Tối thiểu: -2 · Tối đa: 2 |
Schema đầu ra
| Trường | Kiểu | Mô tả |
|---|---|---|
id | string | Mã định danh duy nhất cho completion |
object | string | Loại đối tượng, ví dụ "chat.completion" |
model | string | Model được dùng cho completion |
choices | array | Danh sách các lựa chọn completion |
choices[].message.content | string | Nội dung văn bản được tạo |
choices[].finish_reason | string | Lý do việc tạo dừng lại |
usage.prompt_tokens | integer | Số lượng token trong prompt |
usage.completion_tokens | integer | Số lượng token trong completion |
usage.total_tokens | integer | Tổng số token đã dùng |
Câu hỏi
FAQ
Làm thế nào để gọi Meta Llama Guard 4 12B qua SandBase?
Tạo một API key SandBase, sau đó gửi yêu cầu với model ID "meta/llama-guard-4-12b" tới Chat Completions API (/v1/chat/completions) tại https://api.sandbase.ai. Các ví dụ yêu cầu trên trang này cho thấy chính xác payload.
Meta Llama Guard 4 12B có giá bao nhiêu?
$0.18 cho mỗi 1M token đầu vào và $0.18 cho mỗi 1M token đầu ra, tính phí theo từng yêu cầu từ số dư SandBase của bạn. Mức giảm giá, nếu có, được hiển thị trong phần giá trên trang này.
Cửa sổ ngữ cảnh của Meta Llama Guard 4 12B là bao nhiêu?
163.8K token ngữ cảnh, với tối đa 16.4K token đầu ra cho mỗi phản hồi.
Meta Llama Guard 4 12B hỗ trợ những tính năng nào?
Meta Llama Guard 4 12B hỗ trợ vision (đầu vào hình ảnh). Xem phần Specifications ở trên để biết danh sách đầy đủ.
Tôi có cần tài khoản Meta riêng không?
Không. Chỉ cần một API key và số dư SandBase là bạn có thể truy cập Meta Llama Guard 4 12B và các model khác trong danh mục; bạn không cần đăng ký riêng với Meta.
