langchain-zerogpu repository on GitHub and the package on PyPI.
In this notebook, youβll explore:
- LangChain: The framework for building applications with LLMs and agents. Its
langchain-zerogpupackage exposes ZeroGPUβs small and nano models as first-class tools, so you can drop entity extraction, PII redaction, and zero-shot classification straight into a pipeline without writing any HTTP code. - ZeroGPU: An ultra-fast, compute-efficient inference provider for apps and agents. We run purpose-built small and nano language models across an edge-powered network for the high-volume, purpose-specific tasks your app or agent runs constantly. Plug in our OpenAI-compatible API and youβre live - zero GPU infrastructure, serverless, auto-scaling by default.
π₯ Watch the Video Guide
π¦ Installation
First, install thelangchain-zerogpu package, which ships the ZeroGPU tools. Youβll also install pypdf to pull the text out of an uploaded PDF resume (this pipeline is text-only, no OCR):
π Setting Up API Keys
Youβll need to set up your ZeroGPU credentials so the tools can reach the inference API securely. This ensures every tool call is authenticated without re-prompting. You can go to here to get an API key and Project ID from ZeroGPU. The key starts withzgpu-api- and the Project ID (UUID) is on the project settings page.
Python
ZEROGPU_API_KEY and ZEROGPU_PROJECT_ID from the environment when you construct it with no arguments. The key is held as a SecretStr and is never logged.
The example outputs throughout this notebook are illustrative placeholders that show the shape of each result. Rerun the cells with your own credentials and resume to capture live values.
π Upload a Resume
Upload a single PDF resume straight from your machine, then read its text withpypdf. Everything downstream runs on resume_text.
Python
π·οΈ Extract Candidate Entities with ZeroGPU
ZeroGPU is an ultra-fast, compute-efficient inference provider for apps and agents. We run purpose-built small and nano language models across an edge-powered network for the high-volume, purpose-specific tasks your app or agent runs constantly. Plug in our OpenAI-compatible API and youβre live - zero GPU infrastructure, serverless, auto-scaling by default. In this section, we will extract skills, job titles, companies, and locations from the resume as a structured candidate card.ZeroGPUExtractEntitiesTool runs custom-label named-entity recognition on gliner2-base-v1. You pass the entity types you care about as labels, and it returns the matched spans grouped by label.
Python
Python
π Redact PII Before Sharing
Before the resume goes into a dashboard, an applicant-tracking system, or a shared review channel, the personal data has to come out.ZeroGPURedactPIITool masks PII inline on gliner-multi-pii-v1, replacing each match with an uppercase [LABEL] placeholder and returning the redacted text.
Python
redacted_text holds the masked copy, and an entities list records every span that was detected and replaced. Parse it with json.loads(anonymized_resume)["redacted_text"] when you just want the masked text.
Names, emails, phone numbers, addresses, and even company names come back masked, while skills and the rest of the prose pass through, so the redacted copy is still useful for review with the identifying details gone. This is the version that is safe to store or share.
π ZeroGPU strips the personal data out of the resume in a single call, giving you a compliant, shareable copy without touching the rest of the content!
π§ Route the Candidate with Zero-Shot Classification
With the signal extracted and the PII gone, the last step is routing: which team should review this candidate?ZeroGPUClassifyZeroShotTool scores the resume against a flat list of labels on deberta-v3-small and returns a score per label, so you can pick the best match.
Python
max(routing, key=routing.get) gives you the top team. Swap the labels list for your own org chart to route against any set of teams.
π ZeroGPU classifies the resume against your own team labels in one call, turning unstructured text into a routing decision!
π€ Run the Full Screening Pipeline
Now chain the three tools into one function that takes a resume and returns a structured candidate card, an anonymized copy, and a routing label. This is the end-to-end pipeline youβd wire into a real screening flow.Python
π Highlights
This notebook has guided you through setting up and running a LangChain workflow with ZeroGPU for privacy-aware resume screening. You can adapt and expand this example for various other scenarios requiring structured extraction and compliant handling of sensitive documents. Key tools utilized in this notebook include:- LangChain: The framework for building applications with LLMs and agents. Its
langchain-zerogpupackage exposes ZeroGPUβs small and nano models as first-class tools, so you can drop entity extraction, PII redaction, and zero-shot classification straight into a pipeline without writing any HTTP code. - ZeroGPU: An ultra-fast, compute-efficient inference provider for apps and agents. We run purpose-built small and nano language models across an edge-powered network for the high-volume, purpose-specific tasks your app or agent runs constantly. Plug in our OpenAI-compatible API and youβre live - zero GPU infrastructure, serverless, auto-scaling by default.
langchain-zerogpu repository, the PyPI page, and the ZeroGPU documentation.
