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
uv pip install git+https://github.com/lumiralabs/lumos
Start Server
docker-compose up
Python API
1. Structured Outputs
from lumos 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
```python
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
Release history Release notifications | RSS feed
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.1.tar.gz
(122.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file lumira_lumos-0.0.1.tar.gz.
File metadata
- Download URL: lumira_lumos-0.0.1.tar.gz
- Upload date:
- Size: 122.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f0904122adeb45a085cb51ff6522c88021af1c79967d9fd452547dc88b0529a
|
|
| MD5 |
52a9ff2fe9bcdf7360310a9d8e4b9cf2
|
|
| BLAKE2b-256 |
9b3b95197f13597ab0bc710542600e072d280b5e0351efcbc21b7330404be5ce
|
File details
Details for the file lumira_lumos-0.0.1-py3-none-any.whl.
File metadata
- Download URL: lumira_lumos-0.0.1-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7501da69edea5c4df31c7529932723babe69caa269a16eb41772db7d1f0e8ebb
|
|
| MD5 |
39cdb84ea3f94ff9ef77219a284b2064
|
|
| BLAKE2b-256 |
9bb8cb9450e5efc1925a6102adc4665016720ae98781aeb0e427d8b9b5042086
|