Skip to main content

No project description provided

Project description

lumos

Simple utils for building AI apps. Available as python API and a server.

Local Dev

uv sync --dev && uv pip install -e .

Install

pip install lumira-lumos

Start Server

docker-compose up

Python API

1. Structured Outputs

import lumos
from pydantic import BaseModel


class Response(BaseModel):
    steps: list[str]
    final_answer: str


lumos.call_ai(
    messages=[
        {"role": "system", "content": "You are a mathematician."},
        {"role": "user", "content": "What is 100 * 100?"},
    ],
    response_format=Response,
    model="gpt-4o-mini",
)
# Response(steps=['Multiply 100 by 100.', '100 * 100 = 10000.'], final_answer='10000')

2. Embeddings API

lumos.get_embedding("hello world")
#[0.12, ..., ..., 0.34]

3. Book Parser

python -m lumos.book.parser path/to/book.pdf
from lumos import book_parser

book_parser.toc("path/to/book.pdf", level=2)
Table of Contents
├── Chapter 1. Introducing Asyncio (Pages: 1-8)
│   ├── The Restaurant of ThreadBots (Pages: 1-5)
│   ├── Epilogue (Pages: 6-5)
│   └── What Problem Is Asyncio Trying to Solve? (Pages: 6-8)
├── Chapter 2. The Truth About Threads (Pages: 9-20)
│   ├── Benefits of Threading (Pages: 10-10)
│   ├── Drawbacks of Threading (Pages: 11-13)
│   └── Case Study: Robots and Cutlery (Pages: 14-20)
├── Chapter 3. Asyncio Walk-Through (Pages: 21-74)
│   ├── Quickstart (Pages: 22-27)
│   ├── The Tower of Asyncio (Pages: 28-30)
│   ├── Coroutines (Pages: 31-36)
│   ├── Event Loop (Pages: 37-38)
│   ├── Tasks and Futures (Pages: 39-45)
│   ├── Async Context Managers: async with (Pages: 46-49)
│   ├── Async Iterators: async for (Pages: 50-52)
│   ├── Simpler Code with Async Generators (Pages: 53-54)
│   ├── Async Comprehensions (Pages: 55-56)
│   └── Starting Up and Shutting Down (Gracefully!) (Pages: 57-74)
├── Chapter 4. 20 Asyncio Libraries You Aren’t Using (But…Oh, Never Mind) (Pages: 75-128)
│   ├── Streams (Standard Library) (Pages: 76-87)
│   ├── Twisted (Pages: 88-90)
│   ├── The Janus Queue (Pages: 91-91)
│   ├── aiohttp (Pages: 92-97)
│   ├── ØMQ (ZeroMQ) (Pages: 98-109)
│   ├── asyncpg and Sanic (Pages: 110-125)
│   └── Other Libraries and Resources (Pages: 126-128)
└── Chapter 5. Concluding Thoughts (Pages: 129-130)

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

lumira_lumos-0.0.3.tar.gz (201.8 kB view details)

Uploaded Source

Built Distribution

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

lumira_lumos-0.0.3-py3-none-any.whl (35.4 kB view details)

Uploaded Python 3

File details

Details for the file lumira_lumos-0.0.3.tar.gz.

File metadata

  • Download URL: lumira_lumos-0.0.3.tar.gz
  • Upload date:
  • Size: 201.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.0

File hashes

Hashes for lumira_lumos-0.0.3.tar.gz
Algorithm Hash digest
SHA256 ff8cad2e2d4da11d4194d3cac5a104c08e8635273dfe77d308dcdf83b7126cff
MD5 ccb8fd0de1383379ae0c714e4f2595b8
BLAKE2b-256 8c27f043831e030e62f0ae5d3d4c7ee8887b72fdaadf14f6e1b75fdb4ea2d21e

See more details on using hashes here.

File details

Details for the file lumira_lumos-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for lumira_lumos-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1efebb4ced23cc3a93e65aa4e4ebc754f8211597a131546f4320e5e896e51394
MD5 7c50642b51d750aa4928279becadeaeb
BLAKE2b-256 a47ff967a51da158db4a8b7655219d27aeab6bde73d056a73f67f31ba9a7b9ab

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