clockfly / lanarky

Open-source framework to deploy LLM applications in production. Built on top of FastAPI

Home Page:https://lanarky.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lanarky-logo

Lanarky

stars Documentation Code Coverage License: MIT Twitter

PyPI version PyPI stats Supported Python Versions

Lanarky is an open-source framework to deploy LLM applications in production. It is built on top of FastAPI and comes with batteries included.

Table of Contents

πŸš€ Features

  • 🌐 multi-mode token streaming
  • πŸ’¬ simple gradio chatbot UI for fast prototyping
  • πŸ”— supports LangChain applications
  • πŸ—„οΈ multiple LLM caching strategies

See Roadmap for upcoming features.

❓ Why?

There are great low-code/no-code solutions in the open source to deploy your LLM projects. However, most of them are opinionated in terms of cloud or deployment code. This project aims to provide users with a cloud-agnostic and deployment-agnostic solution which can be easily integrated into existing backend infrastructures.

πŸ’Ύ Installation

The library is available on PyPI and can be installed via pip.

pip install lanarky

You can find the full documentation at https://lanarky.readthedocs.io/en/latest/.

πŸ”₯ Build your first Langchain app

from dotenv import load_dotenv
from fastapi import FastAPI
from langchain import ConversationChain
from langchain.chat_models import ChatOpenAI

from lanarky import LangchainRouter

load_dotenv()
app = FastAPI()

langchain_router = LangchainRouter(
    langchain_url="/chat",
    langchain_object=ConversationChain(
        llm=ChatOpenAI(temperature=0), verbose=True
    ),
    streaming_mode=0
  )
app.include_router(langchain_router)

See examples/ for list of available demo examples.

Create a .env file using .env.sample and add your OpenAI API key to it before running the examples.

demo

πŸ“ Roadmap

🀩 Stargazers

Leave a ⭐ if you find this project useful.

Star History Chart

🀝 Contributing

Code check Publish

Contributions are more than welcome! If you have an idea for a new feature or want to help improve lanarky, please create an issue or submit a pull request on GitHub.

See CONTRIBUTING.md for more information.

Contributors

βš–οΈ License

The library is released under the MIT License.

✨ Want to build LLM applications with us?

Are you interested in building LLM applications with us? We would love to hear from you! Reach out to us on Twitter @lanarky_io.

Let's connect and explore the possibilities of working together to create amazing LLM applications with Lanarky!

About

Open-source framework to deploy LLM applications in production. Built on top of FastAPI

https://lanarky.readthedocs.io/en/latest/

License:MIT License


Languages

Language:Python 98.9%Language:Makefile 1.1%