Commit 275ef90d authored by Your Name's avatar Your Name

Skip API key for HuggingFace models in litellm

- When using HuggingFace inference endpoints, set api_key to None to avoid auth errors
parent a93b69cf
......@@ -404,6 +404,12 @@ class LiteLLMBackend:
# Store tool_parser for post-processing
self.tool_parser = tool_parser
# For HuggingFace models, set API key to None to skip auth
# This allows using HF inference endpoints without authentication
if use_model and 'huggingface' in use_model.lower():
litellm.api_key = None
print("DEBUG litellm: HuggingFace model - skipping API key")
# Convert tools to coderai schema format if tools provided
if tools:
self.tools_schema = {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment