The Problem with LangChain
minimaxir.com
The Problem with LangChain
1–10 of 97 posts
Re: The Problem with LangChain
#2Re: The Problem with LangChain
#3 import llm
model = llm.get_model("gpt-3.5-turbo")
model.key = 'YOUR_API_KEY_HERE'
response = model.prompt(
"Five surprising names for a pet pelican"
)
print(response.text())
Or you can stream the responses like this: response = model.prompt(
"Five diabolical names for a pet goat"
)
for chunk in response:
print(chunk, end="")
It works with other models too, installed via plugins - including models that can run directly on your machine: pip install llm-gpt4all
Then: model = llm.get_model("ggml-vicuna-7b-1")
print(model.prompt(
"What is the capital of France?"
).text())
It also handles conversations, where each prompt needs to include the previous context of the conversation: c = model.conversation()
print(c.prompt("Capital of France?").text())
print(c.prompt("what language do they speak?").text())
I wrote more about the new plugin system for adding extra models here: https://simonwillison.net/2023/Jul/12/llm/Re: The Problem with LangChain
#4I mean, it starts by giving the full name of the original author… calls using his free software a waste of time… destroys the design as if tearing down someone’s work who made bad decisions at every turn when making a brand-new thing that is FOSS.
Did anyone else find that a bit strange? Did I miss the light-hearted tone buried somewhere?
That said, strangely… useful examples and up-to-date detailed technical analysis that I like. I just don’t get why this sector gets so nasty between people… fight the robots, guys! ;)
Re: The Problem with LangChain
#5But as always I trust the OSS community to make it better or replace it with something else
Re: The Problem with LangChain
#6Frankly I could see langchain is garbage software just by looking at the code.
It still helps me get shit done fast to figure out how things are supposed to work. Sort of a cookbook of AI recepies. Once I have an approach narrowed down I'll rewrite everything on top of stuff langchain is supposedly wrapping. For now it's faster than tracking down individual libraries and learning the apis. It will stay in notebooks basically.
Re: The Problem with LangChain
#7I generally agree, but why so polemic? I mean, it starts by giving the full name of the original author… calls using his free software a waste of time… destroys the design as if tearing down someone’s work who made bad decisions at every turn when making a brand-new thing that is FOSS. Did anyone else find that a bit strange? Did I miss the light-hearted tone buried somewhere? That said, strangely… useful examples an…
Re: The Problem with LangChain
#8I generally agree, but why so polemic? I mean, it starts by giving the full name of the original author… calls using his free software a waste of time… destroys the design as if tearing down someone’s work who made bad decisions at every turn when making a brand-new thing that is FOSS. Did anyone else find that a bit strange? Did I miss the light-hearted tone buried somewhere? That said, strangely… useful examples an…
Anyway, for those of us who've used LangChain a bit, I don't think anything in the article is revelatory, the codebase is structured as a first mover project, with all of the copy+paste and poor abstractions that come with it. It's absolutely great for prototyping and simple scripts, but I don't think I would use it in a production codebase, I found it very difficult to work around the bugs and wonky abstractions.
Re: The Problem with LangChain
#9Re: The Problem with LangChain
#10I generally agree, but why so polemic? I mean, it starts by giving the full name of the original author… calls using his free software a waste of time… destroys the design as if tearing down someone’s work who made bad decisions at every turn when making a brand-new thing that is FOSS. Did anyone else find that a bit strange? Did I miss the light-hearted tone buried somewhere? That said, strangely… useful examples an…
I noticed the sentiment toward LangChain make an abrupt 180 as soon as they announced their funding. I don't think it's a conspiracy to ruin their value, more like HN readers were first interested in a cool open source project exploring this new field of generative AI, but now that they have millions the expectations change and they find themselves under more scrutiny.