Skip to main content

High-performance AI classification — <200ms latency, up to 100x cheaper, beats GPT-5 mini accuracy

Project description

exit

classer

High-performance AI classification

<200ms latency · up to 100x cheaper · beats GPT-5 mini accuracy · self-calibrating accuracy · no prompt engineering

Installation

pip install classer

Quick Start

import classer

# Single-label classification
result = classer.classify(
    text="I can't log in and need a password reset.",
    labels=["billing", "technical_support", "sales", "spam"]
)
print(result.label)      # "technical_support"
print(result.confidence) # 0.94

# With descriptions for better accuracy
lead = classer.classify(
    text="We need a solution for 500 users, what's your enterprise pricing?",
    labels=["hot", "warm", "cold"],
    descriptions={
        "hot": "Ready to buy, asking for pricing or demo",
        "warm": "Interested but exploring options",
        "cold": "Just browsing, no clear intent"
    }
)
print(lead.label)  # "hot"

# Multi-label tagging
result = classer.tag(
    text="Breaking: Tech stocks surge amid AI boom",
    labels=["politics", "technology", "finance", "sports"],
    threshold=0.3
)
for t in result.labels:
    print(f"{t.label}: {t.confidence}")
# technology: 0.92
# finance: 0.78

Configuration

No API key is needed to get started. To unlock higher rate limits, get an API key from classer.ai/api-keys.

export CLASSER_API_KEY=your-api-key

Or configure programmatically:

from classer import ClasserClient

client = ClasserClient(
    api_key="your-api-key"
)

API Reference

classify(text, labels=None, classifier=None, descriptions=None, speed=None, cache=None)

Classify text into exactly one of the provided labels.

result = classer.classify(
    text="Text to classify",
    labels=["label1", "label2"],  # 1-200 possible labels
    descriptions={"label1": "Description for better accuracy"},
    speed="standard",   # "standard" (default, <1s) or "fast" (<200ms)
    cache=True          # Set to False to bypass cache. Default: True
)

result.label        # Selected label
result.confidence   # 0-1 confidence score
result.tokens       # Total tokens used
result.latency_ms   # Processing time in ms
result.cached       # Whether served from cache

tag(text, labels=None, classifier=None, descriptions=None, threshold=None, speed=None, cache=None)

Multi-label tagging — returns all labels above a confidence threshold.

result = classer.tag(
    text="Text to tag",
    labels=["label1", "label2"],  # 1-200 possible labels
    descriptions={"label1": "Description"},
    threshold=0.3,  # Default: 0.3
    speed="standard",  # "standard" (default, <1s) or "fast" (<200ms)
    cache=True      # Set to False to bypass cache. Default: True
)

for t in result.labels:
    print(f"{t.label}: {t.confidence}")

result.tokens       # Total tokens used
result.latency_ms   # Processing time in ms
result.cached       # Whether served from cache

Error Handling

from classer import ClasserError

try:
    result = classer.classify(text="hello", labels=["a", "b"])
except ClasserError as e:
    print(e.status)  # HTTP status code
    print(e.detail)  # Error detail from API

Documentation

Full API reference and guides at docs.classer.ai.

GitHub

github.com/classer-ai/classer-python

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

classer-0.0.3.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

classer-0.0.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file classer-0.0.3.tar.gz.

File metadata

  • Download URL: classer-0.0.3.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for classer-0.0.3.tar.gz
Algorithm Hash digest
SHA256 1b0173a5fc6a124f5f7a83d9f8bdf9126736222e84fabf07986cee11cd2b7c3c
MD5 20ab02bc7efeb01c8027b1bc5df34964
BLAKE2b-256 64bb7c7dd40d7dd90d386d6c072e70b6c51ad983b435ef1e5439c501da1b3e7e

See more details on using hashes here.

File details

Details for the file classer-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: classer-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.12

File hashes

Hashes for classer-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 599c0eb497aaa7c272dcc4c4384a68f82eee617b2bd37d7ed94e0830928ae35c
MD5 9ab41f727c376fd287f3c0476bf76300
BLAKE2b-256 a677148205d352a317eef439cd0207da8965816306b79705b39649de0d7f8dc7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page