Skip to main content
lanarky-logo

Lanarky

stars License: MIT PyPI version Python 3.9 Code Coverage

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

🔥 Deploy a simple Langchain application in under 20 lines of code

from dotenv import load_dotenv
from fastapi import FastAPI
from langchain import ConversationChain
from langchain.chat_models import ChatOpenAI
from pydantic import BaseModel
from lanarky.responses import StreamingResponse

load_dotenv()
app = FastAPI()

class Request(BaseModel):
    query: str

@app.post("/chat")
async def chat(request: Request) -> StreamingResponse:
    chain = ConversationChain(llm=ChatOpenAI(temperature=0, streaming=True), verbose=True)
    return StreamingResponse.from_chain(chain, request.query, media_type="text/event-stream")

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

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

⚖️ License

The library is released under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lanarky-0.6.3.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lanarky-0.6.3-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file lanarky-0.6.3.tar.gz.

File metadata

  • Download URL: lanarky-0.6.3.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.9.16 Linux/5.15.0-1037-azure

File hashes

Hashes for lanarky-0.6.3.tar.gz
Algorithm Hash digest
SHA256 9b41eb15a493b280b9e467c7584f4a61b510a2f9274cf2b5c2ae549667f18620
MD5 10c55308cc79bc8da7d70c586c285b31
BLAKE2b-256 7611f76e43795e352798e661de32e6670a92ac1110111080b6d541242f9f57a6

See more details on using hashes here.

File details

Details for the file lanarky-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: lanarky-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.0 CPython/3.9.16 Linux/5.15.0-1037-azure

File hashes

Hashes for lanarky-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 48194a1fba471cb3f2cc664d4692ca7b8bf8361f343708c136c32fbbe442fea1
MD5 3a17ae17b7537257c18fb1dea2c56da6
BLAKE2b-256 e94c568eaee4bb7f2ee321264cdd31ad6fe0fc1191a9f0b1de1b10737467fb8b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page