Skip to content

Partners LLM: First Meta's Llama API integration #31084

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

Closed
wants to merge 4 commits into from

Conversation

seyeong-han
Copy link

Add Llama API support

This PR adds support for the Llama API through a new ChatLlama model class.

Key features:

  • Built upon BaseChatOpenAI class using Llama's OpenAI-compatible endpoint (https://api.llama.com/compat/v1/)
  • Supports chat completion and streaming
  • Implements structured output via the "json_schema" method

Current limitations:

  • Tool calling is not yet stable in the Llama API, so it's not supported in this implementation
  • Modified unit tests to only test the "json_schema" structured output format

We plan to add support for tool calling in a future update once the API stabilizes.

Copy link

vercel bot commented Apr 30, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview May 5, 2025 7:36am

@dosubot dosubot bot added the size:XL label Apr 30, 2025
@ccurme ccurme self-assigned this May 1, 2025
@seyeong-han
Copy link
Author

Hi @ccurme !

I would like to know why this PR hasn't been merged yet.
Is there anything else we need to do?

@aviadr1
Copy link

aviadr1 commented May 13, 2025

if this PR works, please merge it 🙏

@ccurme
Copy link
Collaborator

ccurme commented May 13, 2025

Hi @seyeong-han, we haven't had the bandwidth to prioritize reviewing, setting up CI for releases + integration tests, etc. (this is the reason I suggested managing this in a repo you control, as we do in langchain-google, langchain-aws, and others).

I will take a look this week.

@aviadr1
Copy link

aviadr1 commented May 13, 2025

I would like to know why this PR hasn't been merged yet. Is there anything else we need to do?

hey @seyeong-han ! I am not a maintainer here, just a person who also wants to use this.
however without language_calling structured outputs I cant use it ... my pydantic classes arent supported as json_schema ...

@seyeong-han
Copy link
Author

I would like to know why this PR hasn't been merged yet. Is there anything else we need to do?

hey @seyeong-han ! I am not a maintainer here, just a person who also wants to use this. however without language_calling structured outputs I cant use it ... my pydantic classes arent supported as json_schema ...

Hi Aviadr1,

Would it be possible to share your example code about the issue? Thank you for your interest!

@ccurme
Copy link
Collaborator

ccurme commented May 14, 2025

@seyeong-han I've made some minor adjustments and merged in your implementation here: https://github.com/langchain-ai/langchain-meta

@ccurme ccurme closed this May 14, 2025
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.

3 participants