Live data from Hacker News

The Problem with LangChain

minimaxir.com

1–10 of 97 posts

Re: The Problem with LangChain

#3
I added a Python library API to my LLM CLI tool recently which offers a very lightweight way to call models: https://llm.datasette.io/en/stable/python-api.html

    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

#4
I 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 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

#5
Had the same frustrating experience. The system prompt being ignored when running an agent etc.

But as always I trust the OSS community to make it better or replace it with something else

Re: The Problem with LangChain

#6
I'm in the exact same spot as the author just a few days in instead of months.

Frankly 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

#7
post #4

I 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.

Re: The Problem with LangChain

#8
post #4

I 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 don't know, I'm 100% against tearing down other people's FOSS work, but I think it's okay to be more critical once VC money starts flowing. At that point, it's a product jointly owned by venture capitalists for return on investment, and less a labor of love.

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

#10
post #4

I 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.

A conspiracy seems far less likely to me than just people noticing they exist because they got funding.
Post reply on HN