Stop and start AI Search endpoints
This feature is in Beta. To use it, a workspace admin must turn on AI Search: Stop and Start Endpoints from the Previews page. See Manage Databricks previews.
Stop AI Search endpoints that are not being used. A stopped endpoint incurs no serving charges, and its indexes and data are retained. Storage is billed the same as before you stopped the endpoint. When you start the endpoint again, it serves the same indexes without re-syncing them from their source tables. Stopping and starting each take several minutes, and a stopped endpoint stays stopped until you start or delete it.
A stopped endpoint can't serve queries. Stop only endpoints that no application depends on. To find endpoints whose indexes receive no queries, see Identify unused AI Search endpoints.
Requirements
- A workspace admin must enable the AI Search: Stop and Start Endpoints preview. See Manage Databricks previews.
- You must have the CAN MANAGE permission on the endpoint. See AI Search endpoint ACLs.
What happens while an endpoint is stopped
An endpoint stops serving as soon as you stop it, and serves again when it's ready after you start it. Until then:
- Queries fail, and indexes don't sync from their source tables. The indexes show as Offline.
- You can't do the following:
- Create or delete indexes on the endpoint.
- Change endpoint settings, such as target queries per second (QPS), usage policy, or tags.
- Run retrieval quality evaluation or reranker finetuning.
- You can still view the endpoint and its indexes, edit permissions, and delete the endpoint.
After you start the endpoint, sync each triggered index to pick up changes made to its source table while the endpoint was stopped.
When an endpoint can't be stopped
The stop request fails, and the error message gives the reason, in these cases:
- The endpoint isn't ready, or an operation is in progress, such as creating, deleting, or syncing an index, or changing the target QPS. Retry after the operation completes.
- An index on the endpoint uses continuous sync mode or is a Direct Vector Access index. Endpoints with these indexes can't be stopped.
- The endpoint has no indexes. It doesn't need to be stopped, because an endpoint stops incurring charges 24 hours after its last index is deleted. See How AI Search is priced.
Stop an endpoint
You can stop an endpoint using the Databricks UI, the Python SDK, or the REST API.
- Databricks
- Python SDK
- REST API
- In the left sidebar, click Compute.
- Click the AI Search tab.
- In the row for the endpoint, click the kebab menu
and select Stop endpoint. You can also select Stop endpoint from the kebab menu on the endpoint's details page.
- In the confirmation dialog, click Stop endpoint.
The endpoint status changes to Stopping, and then to Stopped.
Stopping and starting endpoints requires databricks-ai-search version 0.80 or above:
%pip install --upgrade databricks-ai-search
dbutils.library.restartPython()
from databricks.ai_search.client import AISearchClient
client = AISearchClient()
client.stop_endpoint(name="my-endpoint")
# The state is STOPPING at first, and then STOPPED
endpoint = client.get_endpoint(name="my-endpoint")
print(endpoint["endpoint_status"]["state"])
To stop an endpoint, send the following request with no request body:
POST /api/2.0/vector-search/endpoints/{endpoint_name}/stop
The response contains the endpoint, with endpoint_status.state set to STOPPING. To check whether the endpoint has stopped, send the following request and confirm that endpoint_status.state is STOPPED:
GET /api/2.0/vector-search/endpoints/{endpoint_name}
Sending a stop request for an endpoint that is already stopping or stopped returns the endpoint without changing it.
Start an endpoint
When you start an endpoint, it serves the same indexes that it had when it stopped.
- Databricks
- Python SDK
- REST API
- In the left sidebar, click Compute.
- Click the AI Search tab.
- In the row for the stopped endpoint, click the kebab menu
and select Start endpoint. You can also select Start endpoint from the kebab menu on the endpoint's details page.
The endpoint status changes to Starting, and then to Ready when the endpoint can serve queries.
from databricks.ai_search.client import AISearchClient
client = AISearchClient()
# Start the endpoint and wait until it is ONLINE and ready to serve queries
client.start_endpoint_and_wait(name="my-endpoint")
To start the endpoint without waiting, use client.start_endpoint(name="my-endpoint").
To start an endpoint, send the following request with no request body:
POST /api/2.0/vector-search/endpoints/{endpoint_name}/start
The response contains the endpoint, with endpoint_status.state set to STARTING. When the endpoint is ready to serve queries, endpoint_status.state is ONLINE.
Sending a start request for an endpoint that is already starting returns the endpoint without changing it.