Skip to content

Support local .databrickscfg for Databricks #521

Closed

Description

@blairj09

Databricks client unified authentication is an established way for managing Databricks authentication that includes support for Databricks configuration profiles. Ellmer should support profiles defined in these config files. Currently, if I authenticate using the Databricks CLI (databricks auth login) and name the resulting profile DEFAULT, I get a ~/.databrickscfg file that contains:

[DEFAULT]
host      = <DATABRICKS-HOST>
auth_type = databricks-cli

This profile can be correctly used by other tools that rely on Databricks client unified authentication (like the Databricks Python SDK). However, ellmer doesn't currently pick up on this file or the profiles defined and instead falls back on interactive browser authentication:

> chat <- ellmer::chat_databricks(model = "databricks-claude-3-7-sonnet")
Error in `databricks_workspace()`:
! Can't find env var `DATABRICKS_HOST`.
Show Traceback

This is a difference compared to chatlas, which "just works" with the defined DEFAULT profile:

>>> import chatlas
... chat = chatlas.ChatDatabricks(model = "databricks-claude-3-7-sonnet")
... chat.chat("Who are you?")
[05/21/25 09:51:13] INFO     chatlas - Provider 'Databricks' generated a response of 101 tokens  [_tokens.py](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#):[30](vscode-file://vscode-app/Applications/Positron.app/Contents/Resources/app/out/vs/code/electron-sandbox/workbench/workbench.html#)
                             from an input of 11 tokens.                                                      
                                                                                                              
I'm Claude, an AI assistant created by Anthropic to be helpful, harmless, and honest. I can have              
conversations, answer questions, assist with various tasks like writing and analysis, and generate different  
kinds of content. I aim to be thoughtful, ethical, and provide balanced perspectives. I have certain          
limitations - I don't have the ability to access the internet, run code, or interact with other systems unless
specifically enabled to do so. How can I help you today?

Activity

  1. self-assigned this
    on May 21, 2025
  2. added a commit that references this issue on May 22, 2025
    d46ad00
  3. added a commit that references this issue on May 27, 2025
    9acb3d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions