langchain-ai/langserve

LangServe 🦜️🏓

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 54 minutes ago
Added to GitGenius on June 20th, 2024
Created on September 29th, 2023
Open Issues & Pull Requests: 139 (+0)
Number of forks: 272
Total Stargazers: 2,330 (+0)
Total Subscribers: 21 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 4.4 days
Mean response time: 45.0 days
90th percentile: 174.9 days
Tracked items: 92

How this project is maintained

75% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Three people close 76% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 118
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 690 days
Stale 30+ days: 118
Stale 90+ days: 118

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (20)
  • playground (20)
  • enhancement (11)
  • investigate (5)
  • streaming (5)
  • confirmed (4)
  • help wanted (2)
  • question (2)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

LangServe is a library developed by LangChain AI that enables developers to deploy LangChain runnables and chains as REST APIs. Built on FastAPI and Pydantic, it provides a streamlined way to expose language model applications through HTTP endpoints. The repository will continue to accept community bug fixes but will not accept new feature contributions going forward.

The core functionality of LangServe centers on converting LangChain objects into production-ready API services. The library automatically infers input and output schemas from LangChain objects and enforces these schemas on every API call with detailed error messages. It provides multiple endpoint types to handle different use cases: the /invoke endpoint for single requests, /batch for processing multiple inputs concurrently, and /stream for streaming responses. Additionally, the /stream_log endpoint allows streaming of intermediate steps from chains and agents, while the /stream_events endpoint, added in version 0.0.40, simplifies streaming without requiring output parsing. The library includes a built-in playground page accessible at /playground/ that displays streaming output and intermediate processing steps, along with optional tracing integration to LangSmith for monitoring and debugging.

LangServe is constructed using battle-tested open-source Python libraries including FastAPI, Pydantic, uvloop, and asyncio. The library provides client SDKs that allow developers to interact with deployed LangServe servers as if they were local Runnables, with a JavaScript client available through LangChain.js. API documentation is automatically generated with JSONSchema and Swagger support, reducing manual documentation overhead.

The library has some documented limitations. Client callbacks for server-originated events are not yet supported. A security vulnerability affecting versions 0.0.13 through 0.0.15 allowed the playground endpoint to access arbitrary files on the server, which was resolved in version 0.0.16.

LangServe is designed primarily for deploying simple Runnables and working with well-known primitives in langchain-core. For applications using LangGraph, the documentation recommends using LangGraph Cloud instead, as it is better suited for that use case. The project provides setup guidance through the LangChain CLI for bootstrapping new projects, uses Poetry for dependency management, and includes an examples directory to help developers get started quickly.