Receber inferências de um modelo treinado personalizado
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Uma inferência é a saída de um modelo de aprendizado de máquina treinado. Esta página
oferece uma visão geral do fluxo de trabalho para receber inferências dos seus modelos na
Vertex AI.
A Vertex AI oferece dois métodos para fazer inferências:
As inferências on-line são solicitações síncronas feitas em um modelo implantado em um Endpoint.
Portanto, antes de enviar uma solicitação, é necessário implantar o recurso
Model
para um endpoint. Isso associa
recursos de computação ao
modelo para que ele possa exibir inferências on-line com
baixa latência. Use as inferências on-line ao fazer solicitações em
resposta à entrada do aplicativo ou em situações que exigem inferência
em tempo hábil.
As inferências em lote são solicitações assíncronas feitas em um modelo que não está implantado em um endpoint. Você envia a solicitação (como um recurso
BatchPredictionJob)
diretamente ao recurso Model. Use as inferências em lote quando não precisar de uma resposta imediata e quiser processar dados acumulados com uma única solicitação.
Testar o modelo localmente
Antes de receber inferências, é útil implantar o modelo em um endpoint local durante a fase de desenvolvimento e teste. Isso permite que você itere
com mais rapidez e teste seu modelo sem implantá-lo em um endpoint on-line ou
gerar custos de inferência. A implantação local é
destinada ao desenvolvimento e teste locais, não às implantações de produção.
Para implantar um modelo localmente, use o SDK da Vertex AI para Python e implante um
LocalModel
em um LocalEndpoint.
Para ver uma demonstração, consulte
este notebook.
Mesmo que seu cliente não esteja escrito em Python, ainda será possível usar o
SDK da Vertex AI para Python para iniciar o contêiner e o servidor. Assim, será possível
testar as solicitações do cliente.
Receber inferências de modelos treinados personalizados
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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)."]]