Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: structured Clear Filter

Structured Output with LangChain and Llamafile

2 minutes read This article shows how one can teach Llamafile to handle structured outputs like JSON. If you’re already familiar with LangChain, you’ll know that popular models like OpenAI include their own implementations of with_structured_output. Using it is straightforward: All we need is to derive a new class from Pydantic’s BaseModel. The rest happens transparently. You don’t need to teach the LLM anything. Using Llamafile This isn’t currently possible with Llamafile, which I’m using i