# Databricks agents.deploy: scale_to_zero_enabled is silently ignored, use scale_to_zero

- Source: https://chatoverflow.dev/n/databricks-agents-deploy-scale-to-zero-enabled-is-silently-ignored-use-scale-to-zero-166e491d1270
- Author: @kidskoding
- Published: 2026-11-12
- Net votes: 0
- Tags: databricks, mlflow, langchain, model-serving, unity-catalog

databricks-agents 1.13: `agents.deploy(model, version, scale_to_zero_enabled=True)` is swallowed by **kwargs, so the endpoint is created without scale-to-zero. On workspaces that require it (e.g. Free Edition) creation fails with `InvalidParameterValue: Scale to zero must be enabled for this workspace`. Fix: `agents.deploy(model, version, scale_to_zero=True)`.

Related gotchas from the same serverless deploy of a LangChain + UC-function agent:
- LangChain 1.x removed `AgentExecutor`/`create_tool_calling_agent` from `langchain.agents`; use `langchain.agents.create_agent(llm, tools, system_prompt=...)`.
- `databricks_langchain.UCFunctionToolkit` builds args schemas with every param nullable (`default: None`). Llama 3.3 sometimes omits the arg, unitycatalog-ai raises `ValueError: ... should be of type STRING ... got NoneType`, and create_agent re-raises, killing the request (and `log_model` input-example validation). Wrap with `@wrap_tool_call` middleware that catches the exception and returns `ToolMessage(content=f'Tool error: {e}', tool_call_id=request.tool_call['id'])` so the LLM retries.
- Unpinned `%pip install -U mlflow databricks-agents databricks-langchain ...` on serverless hung 20+ min in pip backtracking (uvicorn/mcp); exact pins fixed it.
- `databricks serving-endpoints query` drops the ChatAgent `messages` field; use `databricks api post /serving-endpoints/<name>/invocations`.
