Merge pull request #4442 from djliden/main

Updates Databricks provider docs
This commit is contained in:
Ishaan Jaff 2024-06-27 09:59:51 -07:00 committed by GitHub
commit 2376b7ac79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -27,7 +27,7 @@ import os
os.environ["DATABRICKS_API_KEY"] = "databricks key"
os.environ["DATABRICKS_API_BASE"] = "databricks base url" # e.g.: https://adb-3064715882934586.6.azuredatabricks.net/serving-endpoints
# predibase llama-3 call
# Databricks dbrx-instruct call
response = completion(
model="databricks/databricks-dbrx-instruct",
messages = [{ "content": "Hello, how are you?","role": "user"}]
@ -143,13 +143,13 @@ response = completion(
model_list:
- model_name: llama-3
litellm_params:
model: predibase/llama-3-8b-instruct
api_key: os.environ/PREDIBASE_API_KEY
model: databricks/databricks-meta-llama-3-70b-instruct
api_key: os.environ/DATABRICKS_API_KEY
max_tokens: 20
temperature: 0.5
```
## Passings Database specific params - 'instruction'
## Passings Databricks specific params - 'instruction'
For embedding models, databricks lets you pass in an additional param 'instruction'. [Full Spec](https://github.com/BerriAI/litellm/blob/43353c28b341df0d9992b45c6ce464222ebd7984/litellm/llms/databricks.py#L164)
@ -162,7 +162,7 @@ import os
os.environ["DATABRICKS_API_KEY"] = "databricks key"
os.environ["DATABRICKS_API_BASE"] = "databricks url"
# predibase llama3 call
# Databricks bge-large-en call
response = litellm.embedding(
model="databricks/databricks-bge-large-en",
input=["good morning from litellm"],
@ -184,7 +184,6 @@ response = litellm.embedding(
## Supported Databricks Chat Completion Models
Here's an example of using a Databricks models with LiteLLM
| Model Name | Command |
|----------------------------|------------------------------------------------------------------|
@ -196,8 +195,8 @@ Here's an example of using a Databricks models with LiteLLM
| databricks-mpt-7b-instruct | `completion(model='databricks/databricks-mpt-7b-instruct', messages=messages)` |
## Supported Databricks Embedding Models
Here's an example of using a databricks models with LiteLLM
| Model Name | Command |
|----------------------------|------------------------------------------------------------------|
| databricks-bge-large-en | `completion(model='databricks/databricks-bge-large-en', messages=messages)` |
| databricks-bge-large-en | `embedding(model='databricks/databricks-bge-large-en', messages=messages)` |
| databricks-gte-large-en | `embedding(model='databricks/databricks-gte-large-en', messages=messages)` |