Databricks Lakehouse Platform은 데이터, 분석 및 AI를 하나의 플랫폼에 통합합니다.이 가이드는 Databricks LLM models 시작하기에 대한 간단한 개요를 제공합니다. 모든 기능과 구성에 대한 자세한 문서는 API reference를 참조하세요.
Overview
Databricks LLM class는 다음 두 가지 endpoint 유형 중 하나로 호스팅되는 completion endpoint를 래핑합니다:
- Databricks Model Serving, 프로덕션 및 개발에 권장됨,
- Cluster driver proxy app, 대화형 개발에 권장됨.
Limitations
Databricks LLM class는 레거시 구현이며 기능 호환성에 몇 가지 제한 사항이 있습니다.
- 동기 호출만 지원합니다. Streaming 또는 async API는 지원되지 않습니다.
batchAPI는 지원되지 않습니다.
ChatDatabricks는 streaming, async, batch 등을 포함한 ChatModel의 모든 API를 지원합니다.
Setup
Databricks model에 액세스하려면 Databricks 계정을 생성하고, 자격 증명을 설정하고(Databricks workspace 외부에 있는 경우에만), 필요한 패키지를 설치해야 합니다.Credentials (Databricks 외부에 있는 경우에만)
Databricks 내부에서 LangChain 앱을 실행하는 경우 이 단계를 건너뛸 수 있습니다. 그렇지 않은 경우, Databricks workspace hostname과 personal access token을 각각DATABRICKS_HOST 및 DATABRICKS_TOKEN 환경 변수에 수동으로 설정해야 합니다. access token을 얻는 방법은 Authentication Documentation을 참조하세요.
Databricks class를 초기화할 때 이러한 매개변수를 전달할 수 있습니다.
Installation
LangChain Databricks integration은langchain-community 패키지에 포함되어 있습니다. 또한 이 notebook의 코드를 실행하려면 mlflow >= 2.9가 필요합니다.
Wrapping Model Serving Endpoint
Prerequisites
- LLM이 등록되고 Databricks serving endpoint에 배포되었습니다.
- endpoint에 대한 “Can Query” permission이 있습니다.
- inputs:
[{"name": "prompt", "type": "string"}, {"name": "stop", "type": "list[string]"}] - outputs:
[{"type": "string"}]
Invocation
Transform Input and Output
때때로 호환되지 않는 model signature를 가진 serving endpoint를 래핑하거나 추가 config를 삽입하고 싶을 수 있습니다.transform_input_fn 및 transform_output_fn 인수를 사용하여 추가 전처리/후처리를 정의할 수 있습니다.
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.