Skip to main content

The web framework for building LLM microservices

Project description

lanarky-logo-light-mode

The web framework for building LLM microservices.

Stars License Twitter Discord

Python Coverage Version Stats

Lanarky is a python (3.9+) web framework for developers who want to build microservices using LLMs. Here are some of its key features:

  • LLM-first: Unlike other web frameworks, lanarky is built specifically for LLM developers. It's unopinionated in terms of how you build your microservices and guarantees zero vendor lock-in with any LLM tooling frameworks or cloud providers
  • Fast & Modern: Built on top of FastAPI, lanarky offers all the FastAPI features you know and love. If you are new to FastAPI, visit fastapi.tiangolo.com to learn more
  • Streaming: Streaming is essential for many real-time LLM applications, like chatbots. Lanarky has got you covered with built-in streaming support over HTTP and WebSockets.
  • Open-source: Lanarky is open-source and free to use. Forever.

To learn more about lanarky and get started, you can find the full documentation on lanarky.ajndkr.com

Installation

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

pip install lanarky

Getting Started

Lanarky provides a powerful abstraction layer to allow developers to build simple LLM microservices in just a few lines of code.

Here's an example to build a simple microservice that uses OpenAI's ChatCompletion service:

from lanarky import Lanarky
from lanarky.adapters.openai.resources import ChatCompletionResource
from lanarky.adapters.openai.routing import OpenAIAPIRouter

app = Lanarky()
router = OpenAIAPIRouter()


@router.post("/chat")
def chat(stream: bool = True) -> ChatCompletionResource:
    system = "You are a sassy assistant"
    return ChatCompletionResource(stream=stream, system=system)


app.include_router(router)

Visit Getting Started for the full tutorial on building and testing your first LLM microservice with Lanarky.

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.

Project details


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.8.6.tar.gz (15.8 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.8.6-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lanarky-0.8.6.tar.gz
  • Upload date:
  • Size: 15.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.9.18 Linux/6.5.0-1016-azure

File hashes

Hashes for lanarky-0.8.6.tar.gz
Algorithm Hash digest
SHA256 26bbe62d75251beac8ac29364a1fb475013975b8e15d3b88e6b28c801030a777
MD5 61f0f88bb1248daf0bd0878ca587049a
BLAKE2b-256 2deaa397652be44ab9c3093ac0b4b70f821941e58f67a6a81e028803050270fb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: lanarky-0.8.6-py3-none-any.whl
  • Upload date:
  • Size: 23.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.9.18 Linux/6.5.0-1016-azure

File hashes

Hashes for lanarky-0.8.6-py3-none-any.whl
Algorithm Hash digest
SHA256 36de5b43cc7773272fec9bbe304860398c577b7bc46ff28adeca747477328887
MD5 73b55e78680d13c8e1039a28f32d6631
BLAKE2b-256 123adfc96d5dd58fe2aede3322464dfff45228bf209f93e49c9a4a094bdb5f04

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