Metadata-Version: 2.5
Name: piramid
Version: 0.2.0
Summary: Python client for Piramid, an inference engine for retrieval systems.
Project-URL: Homepage, https://piramiddb.com
Project-URL: Documentation, https://piramiddb.com/docs/python
Project-URL: Source, https://github.com/ashworks1706/piramid
Project-URL: Issues, https://github.com/ashworks1706/piramid/issues
License-Expression: MIT
License-File: LICENSE
Keywords: inference,llm,piramid,rag,retrieval
Classifier: Programming Language :: Python :: 3
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Requires-Dist: typing-extensions>=4.7
Provides-Extra: test
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# piramid

Python client for [Piramid](https://piramiddb.com), an inference engine for retrieval systems.

```bash
pip install piramid
```

```python
from piramid import Piramid

with Piramid("http://127.0.0.1:6333") as db:   # key from api_key= or PIRAMID_API_KEY
    db.embed("docs", ["Compaction rewrites the record store without deleted documents."])

    answer = db.generate(
        messages=[{"role": "user", "content": "What happens to deleted documents?"}],
        collection="docs",
        k=2,
    )
    print(answer["text"], answer["retrieval"]["passages"])

    for event in db.stream(prompt="Piramid is", max_new_tokens=32):
        if event["event"] == "token":
            print(event["data"]["text"], end="")
```

Collections: `collections`, `create_collection`, `collection`, `delete_collection`, `count`,
`compact`. Documents: `embed`, `insert`, `upsert`, `get`, `list`, `delete`. Search: `search` (by
vectors), `search_text` (embedded by the server), both with a metadata `filter` such as
`{"topic": {"eq": "storage"}}`. Server: `health`, `version`, `model`.

A refused request raises `PiramidError` with the server's `message` and HTTP `status`.
`/v1/chat/completions` is OpenAI-compatible, so the `openai` package works against it directly.

Server docs: https://piramiddb.com/docs. MIT licensed.
