One simple SDK. Any modality. Bring your own labels and get predictions in milliseconds—no training, no infrastructure, no complexity. Process single items or batches effortlessly.
Powered by Google Gemma 3-27B under the hood.
Test our simple SDK with different classification tasks—single texts, multiple texts, or images
💡 Tip: Separate multiple texts with double line breaks to classify them all at once
Images are converted to base64 and sent as an array in the images
field.
Separate labels with commas
Results will appear here after classification
Choose your preferred integration method - SDK for simplicity, API for flexibility
npm install zerolabel
INFERENCE_API_KEY
from inference.netimport { classify } from 'zerolabel';
const results = await classify({
apiKey: process.env.INFERENCE_API_KEY,
texts: ["The product arrived on time and the packaging was adequate. It functions as described, though I expected slightly better build quality for the price point. Customer service was responsive when I had questions."],
labels: ["Positive","Negative","Neutral","Mixed"]
});
console.log(results[0].predicted_label);
console.log(results[0].confidence);
Process multiple items efficiently in a single request
const reviews = [
"Great product!",
"Not satisfied",
"Good value for money"
];
const results = await classify({
texts: reviews,
labels: ['positive', 'negative', 'neutral'],
apiKey: process.env.INFERENCE_API_KEY
});
Combine text and visual information for richer classification
const results = await classify({
texts: ["Check out this cute pet!"],
images: [imageBase64],
labels: ['cute dog', 'cute cat', 'other'],
apiKey: process.env.INFERENCE_API_KEY
});
Add specific instructions to improve classification accuracy
const results = await classify({
texts: ["The ML model shows promising results"],
labels: ['technical', 'non-technical'],
criteria: 'Focus on technical complexity',
additionalInstructions: 'Consider jargon and expertise',
apiKey: process.env.INFERENCE_API_KEY
});
Use our API with requests or your favorite HTTP client
import requests
response = requests.post(
'https://www.zerolabel.dev/api/classify',
json={
'texts': ['Amazing service!'],
'labels': ['positive', 'negative']
}
)
results = response.json()['results']
Everything you need to know about zerolabel.dev text & image classification API
Zero-shot classification lets you categorise data without training a task-specific model first. You simply send your payload (text, image or both) together with the labels you care about and our SDK returns the most likely label with confidences.
Install with `npm install zerolabel`, get your API key from inference.net, and set it as `INFERENCE_API_KEY` environment variable. Then import and use: `import { classify } from 'zerolabel'`. That's it!
Absolutely! Batch processing is one of our key features. Just pass an array of texts or images instead of a single item. Process thousands of items efficiently in a single API call—it's faster and more cost-effective than individual requests.
Yes. The same simple SDK works for images. Include an `images` array of base64-encoded files in your request. Common formats like PNG, JPEG, GIF, and WebP are supported up to 1MB per image.
Send both a `texts` and an `images` array in the same request. Our SDK handles the complexity—the model will jointly reason over the text and the image before deciding on the best label.
Classification typically takes milliseconds to a few seconds depending on batch size. We use optimized inference infrastructure to ensure low latency. Batch processing is particularly efficient for multiple items.
Email triage (urgent/normal/spam), content moderation (safe/nsfw), support ticket routing (bug/feature/question), document classification (invoice/receipt/contract), sentiment analysis of reviews, and many more. Any categorization task works!
At minimum include a `labels` array with your categories. Add either `texts` (string array), `images` (base64 array), or both. Optional fields include `verbose` for detailed probabilities and `criteria` for custom instructions.
Each input returns `{ predicted_label, confidence, probabilities }` with the predicted category, confidence percentage, and probability distribution across all labels. Results are returned as an array matching your input order.
Traditional ML requires weeks of data collection, hours of training, and complex infrastructure. zerolabel works instantly with any labels you define—no training, no infrastructure, no complexity. Just install and classify.
Yes! Full TypeScript definitions are included with proper typing for all inputs and outputs. Import types like `ClassificationInput`, `ClassificationResult`, and `ZeroLabelConfig` for complete type safety.
Pricing follows your inference.net plan. The free tier allows limited requests, while paid plans offer much higher rate limits. You pay per API request, making it cost-effective compared to maintaining ML infrastructure.
The SDK includes built-in error handling and retry logic. Common issues include invalid base64 images, missing API keys, or rate limit exceeded. All errors include descriptive messages to help you debug quickly.
100+ languages including English, Spanish, French, German, Chinese, Japanese, Arabic and more. Images support PNG, JPEG, GIF, WebP up to 1MB. No extra configuration needed for either.
Our SDK uses Google Gemma 3-27B optimized for classification tasks via inference.net infrastructure. This ensures high accuracy comparable to fine-tuned models while maintaining fast response times.
We log requests for monitoring and abuse prevention. Logs are retained securely and never shared externally. For data deletion requests or privacy concerns, please email contact@zerolabel.dev.
Rate limits depend on your inference.net plan. Free tier has basic limits, while API key holders get much higher allowances. Batch processing helps maximize efficiency within your rate limits.
Try the live demo above to see it in action! Then: 1) `npm install zerolabel`, 2) Get API key from inference.net, 3) Set `INFERENCE_API_KEY` environment variable, 4) Copy the generated code from our demo. You'll be classifying in under 5 minutes.
Join thousands of developers using our simple SDK for multimodal classification