langcorn  by msoedov

API server for serving LangChain apps/agents via FastAPI

created 2 years ago
931 stars

Top 40.1% on sourcepulse

GitHubView on GitHub
Project Summary

Langcorn provides a streamlined way to deploy LangChain LLM applications and agents as robust, high-performance APIs using FastAPI. It targets developers and MLOps engineers looking to easily serve and manage their language models, offering features like automatic API generation, authentication, and support for complex conversational memory.

How It Works

Langcorn acts as a wrapper around LangChain components, automatically generating RESTful API endpoints for defined chains, agents, or custom run functions. It leverages FastAPI's asynchronous capabilities for efficient request handling and supports passing LLM parameters and conversational history directly through API requests or headers, simplifying the integration of LangChain into larger applications.

Quick Start & Requirements

  • Install via pip: pip install langcorn
  • Requires Python and an OpenAI API key (or other LLM provider configured for LangChain).
  • Serve a LangChain chain: langcorn server examples.ex1:chain
  • Official documentation: [Not explicitly linked, but implied by "official documentation"]

Highlighted Details

  • Automatic API generation for LangChain models and pipelines.
  • Built-in static API token authentication.
  • Supports custom LLM parameters (temperature, max tokens, model name) via request headers.
  • Handles conversational memory by accepting and returning structured history.

Maintenance & Community

  • The repository is maintained by msoedov.
  • Contributions are welcomed via pull requests.

Licensing & Compatibility

  • MIT License.
  • Compatible with commercial use and closed-source applications.

Limitations & Caveats

The project appears to be actively developed, with examples for agents and conversational models, but specific details on production readiness or extensive community support are not detailed in the README. The primary dependency is LangChain, which itself has evolving APIs.

Health Check
Last commit

1 year ago

Responsiveness

Inactive

Pull Requests (30d)
0
Issues (30d)
0
Star History
9 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.