Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Inferensi adalah output dari model machine learning yang telah dilatih. Halaman ini
menyediakan ringkasan alur kerja untuk mendapatkan inferensi dari model Anda di
Vertex AI.
Vertex AI menawarkan dua metode untuk mendapatkan inferensi:
Inferensi online adalah permintaan sinkron yang dibuat ke
model yang di-deploy ke
Endpoint.
Oleh karena itu, sebelum mengirim permintaan, Anda harus men-deploy resource Model ke endpoint terlebih dahulu. Hal ini mengaitkan
resource komputasi dengan
model sehingga model dapat menyalurkan inferensi online dengan
latensi rendah. Gunakan inferensi online saat Anda membuat permintaan sebagai respons terhadap input aplikasi atau dalam situasi yang memerlukan inferensi tepat waktu.
Inferensi
batch adalah permintaan asinkron yang dibuat ke model
yang tidak di-deploy ke endpoint. Anda mengirim permintaan (sebagai resource BatchPredictionJob) langsung ke resource Model. Gunakan inferensi batch jika Anda tidak memerlukan respons langsung dan ingin memproses data yang terakumulasi menggunakan satu permintaan.
Menguji model Anda secara lokal
Sebelum mendapatkan inferensi, sebaiknya deploy model Anda ke endpoint lokal selama fase pengembangan dan pengujian. Hal ini memungkinkan Anda melakukan iterasi dengan lebih cepat dan menguji model tanpa men-deploy-nya ke endpoint online atau menimbulkan biaya inferensi. Deployment lokal ditujukan untuk pengembangan dan pengujian lokal, bukan untuk deployment produksi.
Untuk men-deploy model secara lokal, gunakan SDK Vertex AI untuk Python dan deploy LocalModel ke LocalEndpoint.
Untuk demonstrasi, lihat notebook ini.
Meskipun klien Anda tidak ditulis dalam Python, Anda masih dapat menggunakan SDK Vertex AI untuk Python guna meluncurkan container dan server sehingga Anda dapat menguji permintaan dari klien.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-08-19 UTC."],[],[],null,["# Get inferences from a custom trained model\n\nAn inference is the output of a trained machine learning model. This page\nprovides an overview of the workflow for getting inferences from your models on\nVertex AI.\n\nVertex AI offers two methods for getting inferences:\n\n- **Online inferences** are synchronous requests made to a model that is deployed to an [`Endpoint`](/vertex-ai/docs/reference/rest/v1/projects.locations.endpoints). Therefore, before sending a request, you must first deploy the [`Model`](/vertex-ai/docs/reference/rest/v1/projects.locations.models) resource to an endpoint. This associates [compute resources](/vertex-ai/docs/predictions/configure-compute) with the model so that the model can serve online inferences with low latency. Use online inferences when you are making requests in response to application input or in situations that require timely inference.\n- are asynchronous requests made to a model that isn't deployed to an endpoint. You send the request (as a [`BatchPredictionJob`](/vertex-ai/docs/reference/rest/v1/projects.locations.batchPredictionJobs) resource) directly to the `Model` resource. Use batch inferences when you don't require an immediate response and want to process accumulated data by using a single request.\n\nTest your model locally\n-----------------------\n\nBefore getting inferences, it's useful to deploy your model to a local\nendpoint during the development and testing phase. This lets you both iterate\nmore quickly and test your model without deploying it to an online endpoint or\nincurring inference costs. Local deployment is intended for local development\nand testing, not for production deployments.\n\nTo deploy a model locally, use the Vertex AI SDK for Python and deploy a\n[`LocalModel`](/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.prediction.LocalModel)\nto a\n[`LocalEndpoint`](/python/docs/reference/aiplatform/latest/google.cloud.aiplatform.prediction.LocalEndpoint).\nFor a demonstration, see [this\nnotebook](https://github.com/GoogleCloudPlatform/vertex-ai-samples/blob/main/notebooks/community/vertex_endpoints/find_ideal_machine_type/find_ideal_machine_type.ipynb).\n\nEven if your client is not written in Python, you can still use the\nVertex AI SDK for Python to launch the container and server so that you can test\nrequests from your client.\n\nGet inferences from custom trained models\n-----------------------------------------\n\nTo get inferences, you must first [import your\nmodel](/vertex-ai/docs/model-registry/import-model). After it's imported, it becomes a\n[`Model`](/vertex-ai/docs/reference/rest/v1/projects.locations.models) resource that is visible in\n[Vertex AI Model Registry](/vertex-ai/docs/model-registry/introduction).\n\nThen, read the following documentation to learn how to get inferences:\n\n- [Get batch inferences](/vertex-ai/docs/predictions/get-batch-predictions)\n\n Or\n- [Deploy model to endpoint](/vertex-ai/docs/general/deployment) and\n [get online inferences](/vertex-ai/docs/predictions/get-online-predictions).\n\nWhat's next\n-----------\n\n- Learn about [Compute resources for\n prediction](/vertex-ai/docs/predictions/configure-compute)."]]