@croma-ai/parse
v0.1.3
Published
Parse documents effortlessly.
Readme
@croma-ai/parse
Parse documents effortlessly.
Installation
pnpm add @croma-ai/parseQuick Start
Set CROMA_API_KEY in your environment, then:
import { croma, parse } from "@croma-ai/parse";
const result = await parse({
model: croma("mistral-ocr"),
url: "https://example.com/document.pdf",
});
result.outputs?.markdown; // extracted text
result.stats; // { time, cost, tokens, pages }Parse from File
import { croma, parse } from "@croma-ai/parse";
const file = new File([buffer], "document.pdf", { type: "application/pdf" });
const result = await parse({
model: croma("mistral-ocr"),
file,
});
result.outputs?.markdown; // extracted text
result.outputs?.json?.blocks; // structured blocks with bboxes
result.stats; // { time, cost, tokens }Available Models
| Model ID | Provider | Category |
| ----------------- | ----------- | --------------- |
| mistral-ocr | Mistral | Document Parser |
| llamaparse | LlamaIndex | Document Parser |
| datalab-marker | Datalab | Document Parser |
| gpt-4o | OpenAI | Vision LLM |
| claude-sonnet-4 | Anthropic | Vision LLM |
| gemini-2-flash | Google | Vision LLM |
Configuration
const croma = createParse({
apiKey: process.env.CROMA_API_KEY, // or set CROMA_API_KEY env var
baseURL: "https://parse.croma.run", // default
});Types
All types are exported:
import type {
ParseResult,
ParseOutputs,
ParseStats,
ParseBlock,
BBox,
ParseModel,
ParseProvider,
} from "@croma-ai/parse";License
MIT
