mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-04 20:14:13 +00:00
# What does this PR do? add/enable the Databricks inference adapter Databricks inference adapter was broken, closes #3486 - remove deprecated completion / chat_completion endpoints - enable dynamic model listing w/o refresh, listing is not async - use SecretStr instead of str for token - backward incompatible change: for consistency with databricks docs, env DATABRICKS_URL -> DATABRICKS_HOST and DATABRICKS_API_TOKEN -> DATABRICKS_TOKEN - databricks urls are custom per user/org, add special recorder handling for databricks urls - add integration test --setup databricks - enable chat completions tests - enable embeddings tests - disable n > 1 tests - disable embeddings base64 tests - disable embeddings dimensions tests note: reasoning models, e.g. gpt oss, fail because databricks has a custom, incompatible response format ## Test Plan ci and ``` ./scripts/integration-tests.sh --stack-config server:ci-tests --setup databricks --subdirs inference --pattern openai ``` note: databricks needs to be manually added to the ci-tests distro for replay testing
35 lines
926 B
Python
35 lines
926 B
Python
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the terms described in the LICENSE file in
|
|
# the root directory of this source tree.
|
|
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel, Field, SecretStr
|
|
|
|
from llama_stack.schema_utils import json_schema_type
|
|
|
|
|
|
@json_schema_type
|
|
class DatabricksImplConfig(BaseModel):
|
|
url: str = Field(
|
|
default=None,
|
|
description="The URL for the Databricks model serving endpoint",
|
|
)
|
|
api_token: SecretStr = Field(
|
|
default=SecretStr(None),
|
|
description="The Databricks API token",
|
|
)
|
|
|
|
@classmethod
|
|
def sample_run_config(
|
|
cls,
|
|
url: str = "${env.DATABRICKS_HOST:=}",
|
|
api_token: str = "${env.DATABRICKS_TOKEN:=}",
|
|
**kwargs: Any,
|
|
) -> dict[str, Any]:
|
|
return {
|
|
"url": url,
|
|
"api_token": api_token,
|
|
}
|