Skip to content
pubscout

langchain

0.9.0, released 3 months ago by langchaindart.dev

A Dart/Flutter library for building LLM‑powered applications with LangChain patterns.

WASM-ready
$ flutter pub add langchain
Source repository

What it does

Provides unified APIs for LLM providers, retrieval, agents, and chaining components. Includes core abstractions and higher‑level chains to simplify building chatbots, RAG, and other generative AI use cases.

AI-written summary of version 0.9.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to integrate multiple LLM providers in a Flutter app
  • You want a composable, chain‑based architecture for AI features
  • You require retrieval‑augmented generation or agent tooling

Skip it when

  • You only need a single, lightweight LLM client without extra abstractions
  • You prefer a minimal pure‑http wrapper instead of a full framework

Strengths

  • Comprehensive LangChain‑style API for Dart
  • Modular design lets you import only needed parts
  • Supports many providers and retrieval/agent patterns

Weaknesses

  • Adds a learning curve compared to simple HTTP clients
  • Potentially larger bundle size for full feature set
  • Breaking changes between major versions may require migration

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
6

Add the package to pubspec.yaml; optionally include integration packages (e.g., langchain_openai). No special permissions required beyond network access.

import 'package:langchain/langchain.dart';

final llm = OpenAIChatModel(apiKey: 'YOUR_KEY');
final chain = LLMChain(promptTemplate: PromptTemplate.fromTemplate('Summarize: {text}'), llm: llm);
final result = await chain.run({'text': 'Long article content...'});
print(result);

Alternatives

Packages that do the same job and could replace langchain.

  • llamadart

    A lightweight Dart client for LLaMA models, suitable if you only need a single LLM backend

  • firebase_ai

    Provides Firebase‑hosted AI services with tighter integration to other Firebase features

  • gpt_markdown

    Simpler wrapper focused on OpenAI GPT and markdown generation, less overhead than full LangChain

Works with

Packages commonly used together with langchain: ones it builds on, ones built on it, and its own family.