Skip to main content

cvxtract

Crates.io Docs.rs License

LLM-powered structured extraction from CVs and resumes.

cvxtract loads a CV/resume in any common format (PDF, DOCX, HTML, plain text), sends the text to an LLM of your choice, and deserialises the response directly into typed Rust structs — no regex, no hand-written parsers.

Quick start

use cvxtract::{Extractor, Model};

#[tokio::main]
async fn main() {
    // No API key needed — model is downloaded automatically on first run.
    let mut extractor = Extractor::new(Some(Model::from_local()));

    match extractor.extract_resume("resume.pdf".into()).await {
        Ok(resume) => {
            println!("Name:  {}", resume.name);
            println!("Email: {}", resume.email.as_deref().unwrap_or("-"));
            println!("Jobs:  {}", resume.experience.len());
        }
        Err(e) => eprintln!("Extraction failed: {e}"),
    }
}

Installation

[dependencies]
cvxtract = "0.1"
tokio = { version = "1", features = ["full"] }

Providers

Constructor Backend Auth
Model::from_local() llama-cpp-2 on-device (Qwen3.5-2B) none — model auto-downloaded
Model::from_openai() OpenAI API OPENAI_API_KEY
Model::from_openrouter() OpenRouter OPENROUTER_API_KEY
Model::from_ollama() Local Ollama Ollama running on localhost:11434
Model::from_openai_compatible() Any OpenAI-compatible endpoint explicit key + URL
Model::from_copilot() GitHub Copilot COPILOT_TOKEN
// OpenAI
let model = Model::from_openai("gpt-4o-mini");

// Ollama (local)
let model = Model::from_ollama("llama3.2");

// Any OpenAI-compatible endpoint
let model = Model::from_openai_compatible(
    "https://api.my-provider.com/v1",
    std::env::var("MY_API_KEY").unwrap(),
    "my-model-name",
);

Supported input formats

Format Extension
PDF .pdf
Word .docx
HTML .html, .htm
Plain text .txt

Built-in Resume type

extract_resume() populates a comprehensive Resume struct:

pub struct Resume {
    pub name:           String,
    pub email:          Option<String>,
    pub phone:          Option<String>,
    pub location:       Option<String>,
    pub linkedin:       Option<String>,
    pub github:         Option<String>,
    pub website:        Option<String>,
    pub summary:        Option<String>,
    pub experience:     Vec<Experience>,   // company, role, dates, highlights
    pub education:      Vec<Education>,    // institution, degree, field, dates
    pub skills:         Vec<SkillGroup>,   // grouped or flat skill lists
    pub projects:       Vec<Project>,      // name, tech stack, URL
    pub certifications: Vec<Certification>,
    pub languages:      Vec<Language>,
    pub awards:         Vec<Award>,
}

Custom types

Extract any shape by deriving serde::Deserialize and schemars::JsonSchema:

use cvxtract::{Extractor, Model};
use schemars::JsonSchema;
use serde::Deserialize;

#[derive(Debug, Deserialize, JsonSchema)]
struct ContactInfo {
    name:  String,
    email: Option<String>,
    phone: Option<String>,
}

#[tokio::main]
async fn main() {
    let mut extractor = Extractor::new(Some(Model::from_openai("gpt-4o-mini")));
    let info: ContactInfo = extractor
        .extract::<ContactInfo>("resume.pdf".into())
        .await
        .unwrap();
    println!("{info:#?}");
}

GPU acceleration (local model)

When using Model::from_local(), compile with a feature flag to offload layers to your GPU. llama.cpp auto-fits what it can into VRAM and falls back to CPU for the remainder — this is safe even on GPUs with limited memory.

# NVIDIA CUDA
cargo build --release --features cuda

# Apple Silicon (Metal)
cargo build --release --features metal

# AMD / Intel Vulkan
cargo build --release --features vulkan
# Cargo.toml
[dependencies]
cvxtract = { version = "0.1", features = ["cuda"] }

Error handling

All async methods return Result<T, ExtractionError>:

use cvxtract::ExtractionError;

match extractor.extract_resume(path).await {
    Ok(resume) => { /* use resume */ }
    Err(ExtractionError::LoadError(e))  => eprintln!("Could not load file: {e}"),
    Err(ExtractionError::ModelError(m)) => eprintln!("LLM error: {m}"),
    Err(ExtractionError::ParseError(e)) => eprintln!("JSON parse error: {e}"),
}

Raw document loading

Use UnstructuredLoader to extract plain text from a file without any LLM call:

use cvxtract::UnstructuredLoader;

let loader = UnstructuredLoader::new();
let doc = loader.load("resume.pdf")?;
println!("{} characters extracted", doc.content.len());

License

Licensed under either of MIT license.

Metadata

Release files for cvxtract 0.3.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cvxtract 0.3.3
File Size Uploaded
cvxtract-0.3.3.tar.gz 47.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for cvxtract 0.3.3
File
cvxtract-0.3.3-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details
cvxtract-0.3.3-cp39-abi3-manylinux_2_34_x86_64.whl CPython 3.9 abi3 Linux glibc 2.34+ x86-64 Details
cvxtract-0.3.3-cp39-abi3-manylinux_2_34_aarch64.whl CPython 3.9 abi3 Linux glibc 2.34+ ARM64 Details
cvxtract-0.3.3-cp39-abi3-macosx_11_0_x86_64.whl CPython 3.9 abi3 macOS 11.0+ x86-64 Details
cvxtract-0.3.3-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details

Total release size: 22.6 MB

Release files / cvxtract-0.3.3.tar.gz

Download URL cvxtract-0.3.3.tar.gz
Size 47.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5e23520a753a7dcdfcfabc68094df9be30788c120bf69df0ad2f21d4faee2630
BLAKE2b-256 checksum
How to use checksums
31d37d6caaf37d9ac97a794135bc0d0c469a78a42c18604af4a83f7974256dc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.

Transparency log

Release files / cvxtract-0.3.3-cp39-abi3-win_amd64.whl

Download URL cvxtract-0.3.3-cp39-abi3-win_amd64.whl
Size 4.0 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
61f22078503fd027b2931ebe8e977829ca66ca68e0b65903d17946aaf9520904
BLAKE2b-256 checksum
How to use checksums
acd2a3ef86907792ae668c7c6e89d6732ad886329e7607b50f7af8b60234880b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.

Transparency log

Release files / cvxtract-0.3.3-cp39-abi3-manylinux_2_34_x86_64.whl

Download URL cvxtract-0.3.3-cp39-abi3-manylinux_2_34_x86_64.whl
Size 4.9 MB
Tags CPython 3.9 Linux glibc 2.34+ x86-64 abi3
SHA-256 checksum
How to use checksums
f912a4ebca0e20d8fa980a7af4121b1f9d8a5b7887805935b41aa42c79b0e45c
BLAKE2b-256 checksum
How to use checksums
edfdeea694fa5d0e6c2da98eacf9777b83352b38148b11fc21e2d1c85921381a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.

Transparency log

Release files / cvxtract-0.3.3-cp39-abi3-manylinux_2_34_aarch64.whl

Download URL cvxtract-0.3.3-cp39-abi3-manylinux_2_34_aarch64.whl
Size 4.8 MB
Tags CPython 3.9 Linux glibc 2.34+ ARM64 abi3
SHA-256 checksum
How to use checksums
a9d1c7ecac176b1cc365852502fabb2e223a8e3ef988765dba29ffae70cf8ce5
BLAKE2b-256 checksum
How to use checksums
cb53a460cc01e3006707c215d3257f368fddd00ceca10479742154d6ee9c3d30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.

Transparency log

Release files / cvxtract-0.3.3-cp39-abi3-macosx_11_0_x86_64.whl

Download URL cvxtract-0.3.3-cp39-abi3-macosx_11_0_x86_64.whl
Size 4.5 MB
Tags CPython 3.9 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
e97ea41eeb8df8fac6f0539f8bbf8f4022aef21f7ad87dc95097726f902557a5
BLAKE2b-256 checksum
How to use checksums
7d407bcb646615cbb5fb4951144f189fe67ca03391d11147cd639a8cef0d092d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.

Transparency log

Release files / cvxtract-0.3.3-cp39-abi3-macosx_11_0_arm64.whl

Download URL cvxtract-0.3.3-cp39-abi3-macosx_11_0_arm64.whl
Size 4.3 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
3e8f9578cd7693e95d26fff6c24a9314710216360a9ba9a365b9abf9d8cd4ab8
BLAKE2b-256 checksum
How to use checksums
ce73d1078f0dec6607684c3b362b75ff75417bf4253077c820d67c798f2eabe8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.3 This release

6 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page