-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 74ed308
Showing
1 changed file
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<div align="center"> | ||
|
||
<img src="https://raw.githubusercontent.com/ajndkr/lanarky/main/assets/logo.png" alt="lanarky-logo" width="150"> | ||
|
||
<h1> Lanarky </h1> | ||
|
||
[](https://github.com/ajndkr/lanarky/stargazers) | ||
[](https://github.com/ajndkr/lanarky/blob/main/LICENSE) | ||
[](https://pypi.org/project/lanarky/) | ||
[](https://www.python.org/downloads/release/python-3916/) | ||
[](https://coveralls.io/github/ajndkr/lanarky?branch=main) | ||
[](https://lanarky.readthedocs.io/en/latest/) | ||
|
||
</div> | ||
|
||
Lanarky is an open-source framework to deploy LLM applications in production. It is built on top of [FastAPI](https://github.com/tiangolo/fastapi) | ||
and comes with batteries included. | ||
|
||
## 🚀 Features | ||
|
||
- supports [LangChain](https://github.com/hwchase17/langchain) | ||
- simple gradio chatbot UI for fast prototyping | ||
|
||
See [Roadmap](#-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`. | ||
|
||
```bash | ||
pip install lanarky | ||
``` | ||
|
||
You can find the full documentation at [https://lanarky.readthedocs.io/en/latest/](https://lanarky.readthedocs.io/en/latest/). | ||
|
||
## 🔥 Deploy a simple Langchain application in under 20 lines of code | ||
|
||
```python | ||
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/`](https://github.com/ajndkr/lanarky/blob/main/examples/README.md) 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. | ||
|
||
 | ||
|
||
## 📍 Roadmap | ||
|
||
- [x] Add support for [LangChain](https://github.com/hwchase17/langchain) | ||
- [x] Add [Gradio](https://github.com/gradio-app/gradio) UI for fast prototyping | ||
- [ ] Add SQL database integration | ||
- [ ] Add support for [Guardrails](https://github.com/ShreyaR/guardrails) | ||
- [ ] Add support for [LlamaIndex](https://github.com/jerryjliu/llama_index) | ||
- [ ] Add [GPTCache](https://github.com/zilliztech/GPTCache) integration | ||
|
||
## 🤝 Contributing | ||
|
||
[](https://github.com/ajndkr/lanarky/actions/workflows/code-check.yaml) | ||
[](https://github.com/ajndkr/lanarky/actions/workflows/publish.yaml) | ||
|
||
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](https://github.com/ajndkr/lanarky). | ||
|
||
See [CONTRIBUTING.md](https://github.com/ajndkr/lanarky/blob/main/CONTRIBUTING.md) for more information. | ||
|
||
## ⚖️ License | ||
|
||
The library is released under the [MIT License](https://github.com/ajndkr/lanarky/blob/main/LICENSE). |