Skip to content

Use PrimeCut for all new SDK integrations.

python
from poma import PrimeCut

client = PrimeCut()
result = client.ingest("example.pdf", show_progress=True)

print(f"chunks: {len(result.chunks)}")
print(f"chunksets: {len(result.chunksets)}")
print(result.chunksets[0].to_embed)

PrimeCut.ingest(...) submits the file, collects the job result, downloads the .poma archive, and returns a typed PomaResult. Internally, the client prefers SSE status streaming and falls back to polling when needed.

Save the archive locally

python
from poma import PrimeCut

client = PrimeCut()
result = client.ingest(
    "example.pdf",
    download_dir="store",
    filename="example.poma",
    show_progress=True,
)

This still returns PomaResult. It also saves the downloaded .poma archive to store/example.poma.

Use the lower-level flow

python
from poma import PrimeCut

client = PrimeCut()
job_id = client.submit("example.pdf")
result = client.collect(job_id, show_progress=True)

For asyncio apps, use AsyncPrimeCut with the same submit(...) and collect(...) pattern.

Continue with ingestion, results and archives, and AsyncPrimeCut.