Skip to content
forked from ajndkr/lanarky

🚢 Ship production-ready LLM projects with FastAPI

License

Notifications You must be signed in to change notification settings

5x5x5x5/lanarky

 
 

Repository files navigation

lanarky-logo

Lanarky

Open in a VS Code Dev Container

stars Documentation PyPI version Supported Python Versions Code Coverage License: MIT

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

🚀 Features

  • supports LangChain
  • simple gradio chatbot UI for fast prototyping

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

  • Add support for LangChain
  • Add Gradio UI for fast prototyping
  • Add support for in-memory, Redis and GPTCache LLM caching
  • Add support for LlamaIndex
  • Add SQL database integration
  • Add support for Rebuff

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

About

🚢 Ship production-ready LLM projects with FastAPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 98.5%
  • Makefile 1.5%