Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(adapters): Adding Huggingface adapter #527

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

bassamsdata
Copy link
Contributor

Description

New adapter for the HuggingFace serverless inference API. It is somewhat OpenAI API-compatible, but not fully.

Related Issue(s)

related: #517 (reply in thread)

Thank you

Checklist

  • I've read the CONTRIBUTING guidelines and have adhered to them in this PR
  • I've updated the README and ran the make docs command

@bassamsdata bassamsdata changed the title Adding Huggingface adapter feat(adapters): Adding Huggingface adapter Dec 12, 2024
@olimorris
Copy link
Owner

Thanks so much for this. I've added a couple of comments.

Also, can we reuse the OpenAI adapter for the handlers? Like what I've done with copilot and openai_compatible adapters? It may prevent us requiring an additional test and will make the adapter logic that much easier.

@bassamsdata
Copy link
Contributor Author

can we reuse the OpenAI adapter for the handlers?

Sure, I actually started with that approach following the xAI adapter, but for some reason, it didn’t work. I might have had something else interfering with the code at the time. Now, everything runs using the OpenAI adapter.

@bassamsdata
Copy link
Contributor Author

One more thing: I resolved the conversations for the two reviews. I’m not sure if that’s the correct approach or if it’s something you’re supposed do the resolve conversation. Apologies if I overstepped, I don’t have much experience with PRs.

@olimorris
Copy link
Owner

Looks fantastic, thank you. Feel free to drop the test as we have it all covered with the OpenAI one.

@bassamsdata
Copy link
Contributor Author

done, tests dropped.

@olimorris olimorris merged commit 48747c4 into olimorris:main Dec 13, 2024
3 checks passed
@olimorris
Copy link
Owner

Thanks so much for this. Feels great to have this in CodeCompanion finally.

@bassamsdata bassamsdata deleted the huggingface branch December 13, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants