2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Vertex AI Matching EngineのINDEXの消し方

Last updated at Posted at 2023-05-31

1.はじめに

  • Vertex AI Matching Engine(のindex)をうっかりデプロイしたままにして課金でパニックになった。
  • Indexを消さないと課金されていく。

2.経緯

  • 最近の大規模言語モデルの影響で、ベクトルの検索を高速にしたいなと思ったところ、Vertex AIのMatching Engineを発見。レスポンスがすごく速い(らしい)。
  • さっそくチュートリアルを見ながら複数indexを作成し、indexをデプロイした。

3. 翌日

  • 課金でアラートが出ていたので、見に行くと、1日で18,000円も課金されている。翌日はさらに悪化して22,000円ほど。これはまずいと思う。
    image.png

4. 対応

  • Google Bardに聞いてみたところ、indexの横にあるチェックボックスをチェックして、deleteボタンを押せばOK!とのことだが、Matching Engineのページに行っても、チェックボックスも削除ボタンもない!

image.png

  • ネット上をさまよい、この説明中のdeleteとundeploy関係のコマンドを実行。順番が大事で、
    ①まずindexに対応するINDEX ENDPOINTからINDEXをundepoy
    ②INDEX ENDPOINTを消す。
    ③INDEXを消す。

※indexの数字とdeployed-index-idの文字列は適当です。


#例:
gcloud ai index-endpoints undeploy-index 4030255473566416896 --deployed-index-id=vectest_brute_force_deployed --project={Project-ID} --region=us-central1



#例:
gcloud ai index-endpoints delete 4030255473566416896 --project={Project-ID} --region=us-central1



#例:
gcloud ai indexes delete 8238869325344145408 --project={Project-ID} --region=us-central1


無事に消えてくれる。

5.さいごに

  • このままだと月60万課金される・・・と思ったときはくらくらしました。
  • Matching EngineはOSSのscannと同じアルゴリズムとのことなので、こちらをまずはいじることに。
  • チュートリアル通り作るんじゃなくてもっと安く作って動かすプランがあるみたいですね。
2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?