그렇지만 개발자의 생성형 AI 솔루션이 발전함에 따라 생성형 AI 애플리케이션과 솔루션을 엔드 투 엔드로 빌드하고 배포하는 플랫폼이 필요할 수 있습니다. Google Cloud는 개발자가 앱 개발 초기 단계부터 앱 배포, 앱 호스팅, 복잡한 데이터의 대규모 관리까지 생성형 AI의 강력한 성능을 활용할 수 있도록 포괄적인 도구 생태계를 제공합니다.
Google Cloud의 Vertex AI 플랫폼은 효율성과 안정성을 위해 AI 모델의 사용, 배포, 모니터링을 간소화하는 MLOps 도구 모음을 제공합니다. 또한 데이터베이스, DevOps 도구, 로깅, 모니터링, IAM과 통합하는 경우 생성형 AI 전체 수명 주기 관리에 대한 종합적인 접근이 가능합니다.
# To install the Python SDK, use this CLI command:# pip install google-generativeaiimportgoogle.generativeaiasgenaifromgoogle.generativeaiimportGenerativeModelAPI_KEY="API_KEY"genai.configure(api_key=API_KEY)
# To install the Python SDK, use this CLI command:# pip install google-genaifromgoogleimportgenaiPROJECT_ID="PROJECT_ID"LOCATION="LOCATION"# e.g. us-central1client=genai.Client(project=PROJECT_ID,location=LOCATION,vertexai=True)
텍스트 프롬프트에서 텍스트를 생성하는 코드 예시
Gemini Developer API
Vertex AI의 Gemini API
model=GenerativeModel("gemini-2.0-flash")response=model.generate_content("The opposite of hot is")print(response.text)# The opposite of hot is cold.
fromgoogleimportgenaifromgoogle.genai.typesimportHttpOptionsclient=genai.Client(http_options=HttpOptions(api_version="v1"))response=client.models.generate_content(model="gemini-2.5-flash",contents="How does AI work?",)print(response.text)# Example response:# Okay, let's break down how AI works. It's a broad field, so I'll focus on the ...## Here's a simplified overview:# ...
텍스트와 이미지에서 텍스트를 생성하는 코드 예시
Gemini Developer API
Vertex AI의 Gemini API
importPIL.Imagemultimodal_model=GenerativeModel("gemini-2.0-flash")image=PIL.Image.open("image.jpg")response=multimodal_model.generate_content(["What is this picture?",image])print(response.text)# A cat is shown in this picture.
fromgoogleimportgenaifromgoogle.genai.typesimportHttpOptions,Partclient=genai.Client(http_options=HttpOptions(api_version="v1"))response=client.models.generate_content(model="gemini-2.5-flash",contents=["What is shown in this image?",Part.from_uri(file_uri="gs://cloud-samples-data/generative-ai/image/scones.jpg",mime_type="image/jpeg",),],)print(response.text)# Example response:# The image shows a flat lay of blueberry scones arranged on parchment paper. There are ...
멀티턴 채팅을 생성하는 코드 예시
Gemini Developer API
Vertex AI의 Gemini API
model=GenerativeModel("gemini-2.0-flash")chat=model.start_chat()print(chat.send_message("How are you?").text)print(chat.send_message("What can you do?").text)
fromgoogleimportgenaifromgoogle.genai.typesimportHttpOptions,ModelContent,Part,UserContentclient=genai.Client(http_options=HttpOptions(api_version="v1"))chat_session=client.chats.create(model="gemini-2.5-flash",history=[UserContent(parts=[Part(text="Hello")]),ModelContent(parts=[Part(text="Great to meet you. What would you like to know?")],),],)response=chat_session.send_message("Tell me a story.")print(response.text)# Example response:# Okay, here's a story for you:# ...
Vertex AI Studio로 프롬프트 마이그레이션
Google AI Studio 프롬프트 데이터는 Google Drive 폴더에 저장됩니다. 이 섹션에서는 Vertex AI Studio로 프롬프트를 마이그레이션하는 방법을 보여줍니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# Migrate from the Gemini Developer API to the Gemini API in Vertex AI\n\nIf you are new to Gemini, using the [quickstarts](https://ai.google.dev/gemini-api/docs/quickstart?lang=python)\nis the fastest way to get started.\n\n\nHowever, as your generative AI solutions mature, you may need a platform for building and\ndeploying generative AI applications and solutions end to end. Google Cloud provides a\ncomprehensive ecosystem of tools to enable developers to harness the power of generative AI,\nfrom the initial stages of app development to app deployment, app hosting, and managing complex\ndata at scale.\n\n\nGoogle Cloud's Vertex AI platform offers a suite of MLOps tools that streamline usage, deployment,\nand monitoring of AI models for efficiency and reliability. Additionally, integrations with\ndatabases, DevOps tools, logging, monitoring, and IAM provide a holistic approach to managing the\nentire generative AI lifecycle. \n\n#### Common use cases for Google Cloud offerings\n\n\nHere are some examples of common use cases that are well-suited for Google Cloud offerings.\n\n- Productionize your apps and solutions. Products like [Cloud Run functions](https://cloud.google.com/functions/docs/concepts/overview) and [Cloud Run](https://cloud.google.com/run/docs/overview/what-is-cloud-run) lets you to deploy apps with enterprise-grade scale, security and privacy. Find more details about security and privacy on the [Security, Privacy, and Cloud Compliance on Google Cloud](https://cloud.google.com/security) guide.\n- Use Vertex AI for end to end MLOps capabilities from tuning to vector similarity-search and ML pipelines.\n- Trigger your LLM call with event-driven architecture with [Cloud Run functions](https://cloud.google.com/functions/docs/concepts/overview) or [Cloud Run](https://cloud.google.com/run/docs/overview/what-is-cloud-run).\n- Monitor usage of your app with [Cloud Logging](https://cloud.google.com/logging/docs) and [BigQuery](https://cloud.google.com/logging/docs/export/bigquery).\n- Store your data with enterprise-grade security, at scale with services like [BigQuery](https://cloud.google.com/bigquery/docs), [Cloud Storage](https://cloud.google.com/storage/docs/introduction), and [Cloud SQL](https://cloud.google.com/sql).\n- Perform retrieval-augmented generation (RAG) using data in the cloud with [BigQuery](https://cloud.google.com/bigquery/docs) or [Cloud Storage](https://cloud.google.com/storage/docs/introduction).\n- Create and schedule data pipelines. You can [schedule jobs](https://cloud.google.com/scheduler/docs/schedule-run-cron-job) using [Cloud Scheduler](https://cloud.google.com/scheduler/docs/overview).\n- Apply LLMs to your data in the cloud. If you store data in Cloud Storage or BigQuery, you can prompt LLMs over that data. For example to extract information, summarize or ask questions about it.\n- Leverage Google Cloud [data governance/residency](https://cloud.google.com/learn/what-is-data-governance) policies to manage your data lifecycle.\n\nDifferences between the Gemini Developer API and the Gemini API in Vertex AI\n----------------------------------------------------------------------------\n\n\nThe following table summarizes the main differences between the\nGemini Developer API and the Vertex AI Gemini API to help you\ndecide which option is right for your use case:\n\nMigrate to Gemini API in Vertex AI\n----------------------------------\n\nThis section shows how to migrate from the Gemini Developer API to\nthe Gemini API in Vertex AI.\n\n**Considerations when migrating**\n\nConsider the following when migrating:\n\n- You can use your existing Google Cloud project (the same one you used to\n generate your Gemini API key) or you can create a new\n [Google Cloud project](/resource-manager/docs/creating-managing-projects).\n\n- Supported regions might differ between the Gemini Developer API and\n the Gemini API in Vertex AI. See the list of\n [supported regions for generative AI on Google Cloud](/vertex-ai/generative-ai/docs/learn/locations).\n\n- Any models you created in Google AI Studio need to be retrained in\n Vertex AI.\n\n### Start using Vertex AI Studio\n\nThe process you follow to migrate to Gemini API in Vertex AI is different, depending\non if you already have a Google Cloud account or you are new to Google Cloud.\n| **Note:** Google AI Studio and the Gemini Developer API are available only in [specific regions and languages](https://ai.google.dev/available_regions). If you aren't located in a supported region, you can't start using the Gemini API in Vertex AI.\n\nTo learn how migrate to the Gemini API in Vertex AI, click one of the following\ntabs, depending on your Google Cloud account status: \n\n### Already use Google Cloud\n\n1. Sign in to [Google AI Studio](https://aistudio.google.com/app/waitlist/97445851).\n2. At the bottom of the left navigation pane, click **Build with Vertex AI on Google Cloud**.\n\n The **Try Vertex AI and Google Cloud for free** page opens.\n3. Click **Agree \\& Continue**.\n\n The **Get Started with Vertex AI studio** dialog appears.\n4. To enable the APIs required to run Vertex AI, click **Agree \\&\n Continue**.\n\n The Vertex AI console appears. To learn how to migrate your data\n from Google AI studio, see [Migrate Prompts](#migrate-prompts).\n\n### New to Google Cloud\n\n1. Sign in to [Google AI Studio](https://aistudio.google.com/app/waitlist/97445851).\n2. At the bottom of the left navigation pane, click **Build with Vertex AI on Google Cloud**.\n\n The **Create an account to get started with Google Cloud** page opens.\n3. Click **Agree \\& Continue**.\n\n The **Let's confirm your identity** page appears.\n4. Click **Start Free**.\n\n The **Get Started with Vertex AI studio** dialog appears.\n5. To enable the APIs required to run Vertex AI, click **Agree \\&\n Continue**.\n\n6. Optional: To learn how to migrate your data from Google AI studio, see Migrate\n Prompts on this page [Migrate Prompts](#migrate-prompts).\n\n### Python: Migrate to the Gemini API in Vertex AI\n\n\nThe following sections show code snippets to help you migrate your Python code to use the\nGemini API in Vertex AI.\n\n#### Vertex AI Python SDK Setup\n\n\nOn Vertex AI, you don't need an API key. Instead, Gemini on Vertex AI is managed using IAM access,\nwhich controls permission for a user, a group, or a service account to call the Gemini API\nthrough the Vertex AI SDK.\n\n\nWhile there are [many ways\nto authenticate](https://cloud.google.com/docs/authentication#auth-decision-tree), the easiest method for authenticating in a development environment is to\n[install the Google Cloud CLI](https://cloud.google.com/sdk/docs/install)\nthen use your user credentials to\n[sign in to the CLI](https://cloud.google.com/docs/authentication/gcloud#local).\n\n\nTo make inference calls to Vertex AI, you must also make sure that your user or service account has\nthe [Vertex AI\nUser role](https://cloud.google.com/vertex-ai/docs/general/access-control#aiplatform.user).\n\n#### Code example to install the client\n\n#### Code example to generate text from text prompt\n\n#### Code example to generate text from text and image\n\n#### Code example to generate multi-turn chat\n\n### Migrate prompts to Vertex AI Studio\n\nYour Google AI Studio prompt data is saved in a Google Drive folder. This\nsection shows how to migrate your prompts to Vertex AI Studio.\n\n1. Open [Google Drive](https://drive.google.com).\n2. Navigate to the **AI_Studio** folder where the prompts are stored.\n3. Download your prompts from Google Drive to a local directory.\n\n | **Note:** Prompts downloaded from Google Drive are in the text (`txt`) format. Before you upload them to Vertex AI Studio, convert them to JSON files. To do this, change the file extension from `.txt` to `.json`.\n4. Open [Vertex AI Studio](https://console.cloud.google.com/vertex-ai/generative) in the Google Cloud console.\n\n5. In the **Vertex AI** menu, click **Prompt management**.\n\n6. Click **Import prompt**.\n\n7. In the **Prompt file** field, click **Browse** and select a prompt from\n your local directory.\n\n To upload prompts in bulk, you must manually combine your prompts into a\n single JSON file.\n8. Click **Upload**.\n\n The prompts are uploaded to the **My Prompts** tab.\n\n### Upload training data to Vertex AI Studio\n\nTo migrate your training data to Vertex AI, you need to upload your data to a Cloud Storage bucket. For more information, see\n[Introduction to tuning](https://cloud.google.com/vertex-ai/generative-ai/docs/models/tune-models).\n\nDelete unused API Keys\n----------------------\n\nIf you no longer need to use your Gemini API key for the\nGemini Developer API, then follow security best practices and delete\nit.\n\nTo delete an API key:\n\n1. Open the\n [Google Cloud API Credentials](https://console.cloud.google.com/apis/credentials)\n page.\n\n2. Find the API key that you want to delete and click the **Actions** icon.\n\n3. Select **Delete API key**.\n\n4. In the **Delete credential** modal, select **Delete**.\n\n Deleting an API key takes a few minutes to propagate. After\n propagation completes, any traffic using the deleted API key is rejected.\n\n| **Important:** If you delete a key that's still used in production and need to recover it, see [`gcloud beta services api-keys undelete`](/sdk/gcloud/reference/beta/services/api-keys/undelete).\n\nWhat's next\n-----------\n\n- Try a quickstart tutorial using [Vertex AI Studio](/vertex-ai/generative-ai/docs/start/quickstarts/quickstart) or the [Vertex AI API](/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal)."]]