View a markdown version of this page

gpt-oss-20b - Amazon Bedrock

Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.

gpt-oss-20b

Ikon menunjukkan pola melingkar dengan segmen melengkung yang terjalin membentuk desain kincir. OpenAI — gpt-oss-20b

Detail Model

GPT OSS 20B adalah model open-source 20 miliar parameter OpenAI untuk pembuatan teks dan pengkodean yang efisien dengan biaya komputasi yang lebih rendah. Untuk informasi lebih lanjut tentang pengembangan model dan kinerja, lihat model/service kartu.

Modalitas Input Modalitas Output
Red circle with white X icon indicating error, cancel, or close action.AudioRed circle with white X icon indicating error, cancel, or close action.Menanamkan
Red circle with white X icon indicating error, cancel, or close action.GambarRed circle with white X icon indicating error, cancel, or close action.Gambar
Red circle with white X icon indicating error, cancel, or close action.PidatoRed circle with white X icon indicating error, cancel, or close action.Pidato
Green circle with white checkmark icon.TeksGreen circle with white checkmark icon.Teks
Red circle with white X icon indicating error, cancel, or close action.VideoRed circle with white X icon indicating error, cancel, or close action.Video

Titik akhir dan API didukung

Tabel berikut menunjukkan titik akhir dan API mana yang didukung untuk gpt-oss-20b. Untuk informasi selengkapnya, lihat API yang didukung oleh Amazon Bedrock dan Titik akhir didukung oleh Amazon Bedrock.

Dukungan titik akhir

Titik akhir Didukung
bedrock-runtime supported
bedrock-mantle supported

API didukung pada bedrock-runtime titik akhir

Pesan Tanggapan Penyelesaian Obrolan Converse Memanggil
not-supported supported supported supported supported

API didukung pada bedrock-mantle titik akhir

Pesan Tanggapan Penyelesaian Obrolan Converse Memanggil
not-supported supported supported not-supported not-supported
catatan

Aktifbedrock-mantle, kedua API menggunakan jalur /v1 dasar, tidak/openai/v1. Gunakan salah satu API dengan model ini:

  • Untuk Tanggapan, gunakan/v1/responses.

  • Untuk Penyelesaian Obrolan, gunakan. /v1/chat/completions

Tip

Jika memungkinkan, kami sarankan menggunakan titik bedrock-runtime akhir untuk aplikasi baru. Lihat Titik akhir didukung oleh Amazon Bedrock untuk detail.

Kemampuan dan Fitur

Fitur Bedrock

Fitur yang didukung menggunakan bedrock-mantle titik akhir

Fitur yang didukung menggunakan bedrock-runtime titik akhir

Harga

Untuk informasi harga, lihat halaman Harga Amazon Bedrock.

Akses Terprogram

Gunakan ID model dan URL titik akhir berikut untuk mengakses model ini secara terprogram. Untuk informasi selengkapnya tentang API dan titik akhir yang tersedia, lihat API yang didukung dan T itik Akhir didukung.

Titik akhir Model ID In-Region URL titik akhir ID inferensi geografis ID inferensi global
bedrock-runtime openai.gpt-oss-20b-1:0 https://bedrock-runtime.{region}.amazonaws.com us-gov.openai.gpt-oss-20b-1:0 Tidak didukung
bedrock-mantle openai.gpt-oss-20b https://bedrock-mantle.{region}.api.aws/v1 Tidak didukung Tidak didukung

Misalnya, jika wilayah adalah us-east-1 (Virginia Utara), maka URL endpoint bedrock-runtime akan menjadi "" dan untuk bedrock-mantle adalah https://bedrock-runtime.us-east-1.amazonaws.com "”. https://bedrock-mantle.us-east-1.api.aws/v1

Tingkat Layanan

Amazon Bedrock menawarkan beberapa tingkatan layanan untuk memenuhi persyaratan beban kerja Anda. Standar menyediakan akses bayar per token tanpa komitmen (atur "service_tier": "default" atau hilangkan bidang). Priority memberikan waktu respons tercepat untuk premi harga (set"service_tier": "priority"). Flex menyediakan akses berbiaya lebih rendah untuk beban kerja yang fleksibel dan tidak peka waktu (set). "service_tier": "flex" Reserved menyediakan throughput khusus dengan komitmen jangka untuk beban kerja yang dapat diprediksi; ini ditetapkan pada tingkat akun, bukan per permintaan (hubungi tim akun AWS Anda untuk mengaktifkan). Untuk informasi selengkapnya, lihat tingkatan layanan.

Standar Prioritas Fleksibel Dipesan
Green circle with white checkmark icon. Green circle with white checkmark icon. Green circle with white checkmark icon. Red circle with white X icon indicating error, cancel, or close action.

Ketersediaan Wilayah

Sekilas tentang ketersediaan regional

Amazon Bedrock menawarkan tiga opsi inferensi: In-Region menyimpan permintaan dalam satu Wilayah untuk kepatuhan yang ketat, Cross-Region rute Geo melintasi Wilayah dalam geografi (seperti AS, UE, dan APAC) sambil menghormati residensi data, dan Cross-Region rute Global di mana pun di seluruh dunia ketika tidak ada batasan residensi. Lihat Ketersediaan regional berdasarkan model halaman untuk lebih jelasnya.

Wilayah In-Region Geo Global
us-east-1(Virginia Utara)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
us-east-2(Ohio)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
us-west-2(Oregon)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-central-1(Frankfurt)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-north-1(Stockholm)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-south-1(Milan)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-west-1(Irlandia)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
eu-west-2(London)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-northeast-1(Tokyo)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-south-1(Mumbai)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-southeast-2(Sydney)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-southeast-3(Jakarta)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
sa-east-1(Sao Paulo)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
ap-southeast-4(Melbourne)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.
us-gov-west-1 (GovCloud)Green circle with white checkmark icon.Red circle with white X icon indicating error, cancel, or close action.Red circle with white X icon indicating error, cancel, or close action.

Rincian inferensi Geo CRIS

GovCloud CRIS AS

ID Inferensi GovCloud CRIS AS: us-gov.openai.gpt-oss-20b-1:0

Wilayah Sumber Daerah Tujuan
us-gov-west-1 (Barat) GovCloud us-gov-west-1 (GovCloud Barat), us-gov-east-1 (Timur) GovCloud
us-gov-east-1 (Timur) GovCloud us-gov-west-1 (GovCloud Barat), us-gov-east-1 (Timur) GovCloud

Kuota dan Batas

AWS Akun Anda memiliki kuota default untuk mempertahankan kinerja layanan dan untuk memastikan penggunaan Amazon Bedrock yang tepat. Kuota default yang ditetapkan ke akun mungkin diperbarui tergantung pada faktor regional, riwayat pembayaran, penggunaan penipuan, and/or persetujuan permintaan peningkatan kuota. Untuk informasi selengkapnya, lihat Kuota untuk Amazon Bedrock dokumentasi dan lihat batasan untuk model.

Kode Sampel

Langkah 1 - AWS Akun: Jika Anda sudah memiliki AWS akun, lewati langkah ini. Jika Anda baru mengenal AWS, daftar untuk akun AWS.

Langkah 2 - Kunci API: Buka konsol Amazon Bedrock dan buat kunci API jangka panjang.

Langkah 3 - Dapatkan SDK: Untuk menggunakan panduan memulai ini, Anda harus sudah menginstal Python. Kemudian instal perangkat lunak yang relevan tergantung pada API yang Anda gunakan.

Untuk Tanggapan atau Penyelesaian Obrolan, pilih tab OpenAI SDK. Untuk Invoke atau Converse, pilih tab Boto3.

OpenAI SDK
pip install boto3 openai
Boto3
pip install boto3

Langkah 4 - Tetapkan variabel lingkungan

Konfigurasikan lingkungan Anda untuk menggunakan kunci API untuk otentikasi.

Pilih tab untuk SDK dan titik akhir Anda.

bedrock-mantle
OPENAI_API_KEY="<provide your Bedrock API key>" OPENAI_BASE_URL="https://bedrock-mantle.<your-region>.api.aws/v1"
bedrock-runtime
OPENAI_API_KEY="<provide your Bedrock API key>" OPENAI_BASE_URL="https://bedrock-runtime.<your-region>.amazonaws.com/openai/v1"
Boto3
AWS_BEARER_TOKEN_BEDROCK="<provide your Bedrock API key>"

Langkah 5 - Jalankan permintaan inferensi pertama Anda

Simpan file sebagai bedrock-first-request.py

mantel batuan dasar

Gunakan pengaturan dari Langkah 4 - Mengatur variabel lingkungan. Pilih bedrock-mantle tab. Tab Obrolan menggunakan API Penyelesaian Obrolan.

Responses API
from openai import OpenAI client = OpenAI() response = client.responses.create( model="openai.gpt-oss-20b", input="Can you explain the features of Amazon Bedrock?" ) print(response)
Chat
from openai import OpenAI client = OpenAI() response = client.chat.completions.create( model="openai.gpt-oss-20b", messages=[{"role": "user", "content": "Can you explain the features of Amazon Bedrock?"}] ) print(response)

runtime dasar: OpenAI SDK

Gunakan pengaturan dari Langkah 4 - Mengatur variabel lingkungan. Pilih bedrock-runtime tab. Tab Obrolan menggunakan API Penyelesaian Obrolan.

Responses API
from openai import OpenAI client = OpenAI() response = client.responses.create( model="openai.gpt-oss-20b", input="Can you explain the features of Amazon Bedrock?" ) print(response)
Chat
from openai import OpenAI client = OpenAI() response = client.chat.completions.create( model="openai.gpt-oss-20b", messages=[{"role": "user", "content": "Can you explain the features of Amazon Bedrock?"}] ) print(response)

bedrock-runtime: Voto3

Gunakan pengaturan Boto3 dari Langkah 4 - Atur variabel lingkungan. Pilih API untuk permintaan Anda.

Invoke API
import json import boto3 client = boto3.client('bedrock-runtime', region_name='us-east-1') response = client.invoke_model( modelId='openai.gpt-oss-20b-1:0', body=json.dumps({ 'messages': [{ 'role': 'user', 'content': 'Can you explain the features of Amazon Bedrock?'}], 'max_tokens': 1024 }) ) print(json.loads(response['body'].read()))
Converse API
import boto3 client = boto3.client('bedrock-runtime', region_name='us-east-1') response = client.converse( modelId='openai.gpt-oss-20b-1:0', messages=[ { 'role': 'user', 'content': [{'text': 'Can you explain the features of Amazon Bedrock?'}] } ] ) print(response)