Add Authentication local LLM#16
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Description
This PR adds support for API Token authentication (Bearer Token) for the LM Studio provider.
Previously, if LM Studio had "Require Authentication" enabled, the tool would fail with a
401 Unauthorizederror because there was no way to provide or pass an API key in the headers.Changes:
setupwizard to prompt for an API Key when LM Studio is selected.lmstudio_api_keyto the configuration schema andconfig.toml.Embedderandindexerlogic to include theAuthorization: Bearer <token>header in requests to the LM Studio API.searchandindexcommands to correctly pass the token to the backend.Motivation and Context
Fixes an issue where users couldn't use the tool with secured LM Studio instances.
Error addressed:
httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'http://localhost:1234/v1/embeddings'How Has This Been Tested?
obsidian-notes-rag setupand provided the API Key.obsidian-notes-rag index.obsidian-notes-rag search "query".