Structured Output with LangChain and Llamafile
blog.brakmic.com
Structured Output with LangChain and Llamafile
1–10 of 22 posts
Re: Structured Output with LangChain and Llamafile
#2People still use langchain?
Re: Structured Output with LangChain and Llamafile
#3People still use langchain?
No
Re: Structured Output with LangChain and Llamafile
#4The use case in the article is relatively simple. For more complex structures, BAML (https://www.boundaryml.com/) is a better option.
Re: Structured Output with LangChain and Llamafile
#5```
try:
answer = chain.invoke(question)
# print(answer) # raw JSON output
display_answer(answer)
except Exception as e: print(f"An error occurred: {e}")
chain_no_parser = prompt | llm
raw_output = chain_no_parser.invoke(question)
print(f"Raw output:\n\n{raw_output}")
```Wait, are you calling LLM again if parsing fails just to get what LLM has sent to you already?
The whole thing is not difficult to do if you directly call API without Lang chain, it'd also help you avoid such inefficiency.
Re: Structured Output with LangChain and Llamafile
#6People still use langchain?
[deleted]
Re: Structured Output with LangChain and Llamafile
#7People still use langchain?
Its good for quickly developing something but for production, I do not think so.We used it for a RAG application I built last year with a client, ended up removing it piece by piece, and found our app responded faster.
But orgs think its some sort of flagbearer of LLMs.As I am interviewing for other roles now, HRs from other companies still ask for how many years of exp I have with Langchain and Agentic AI.
Re: Structured Output with LangChain and Llamafile
#8People still use langchain?
What should be used instead?
Re: Structured Output with LangChain and Llamafile
#9People still use langchain?
i do because i don't know any better since i'm new to the AI space.
Re: Structured Output with LangChain and Llamafile
#10People still use langchain?
What should be used instead?
I gave up after it didn't let me see the prompt that went into the LLM, without using their proprietary service.
I'd recommend just using the API directly. They're very simple.
There might be some simpler wrapper library if you want all the providers and can't be bothered to implement the support for each. Vercel's ai-sdk seems decent for JS.