Classifast is a web application that provides easy classification of any text input according to international product and service standards like UNSPSC, NAICS, ISIC, ETIM, HS, CN. Built with FastAPI and modern web technologies, it offers fast, accurate semantic search capabilities for automated yet intelligent categorization.
- Fast Classification: Semantic search using advanced embedding models
- High Accuracy: Confidence scores for each classification result
- Multiple Standards: Support for UNSPSC, ETIM, and NAICS classification standards
- Modern Interface: Clean, responsive design built with Tailwind CSS
- SEO Optimized: Structured data, meta tags, and performance optimized
- Global standard for product and service categorization
- Improves spend analytics and procurement processes
- Version: UNv260801 (August 14, 2023)
- B2B open standard for technical product classification
- Specialized for electrical and technical products
- Version: 10.0 (2024-12-10)
- Industry classification for business activities
- Essential for government contracting and reporting
- Backend: FastAPI with Python
- Frontend: TypeScript, Tailwind CSS, HTMX
- Vector Database: Qdrant for semantic search
- Embedding Models: Qwen embeddings served through OpenRouter
- Deployment: Docker containerized
Visit the working instance at classifast.com to try.
- Clone the repository
- Install Python dependencies:
pip install -r requirements.txt - Install frontend dependencies:
npm install - Set environment variables for embedding inference, API keys, and payments/quota behavior
- Run frontend watchers and the app:
npm run dev
Query embeddings and reranking are both served by OpenRouter with
OPENROUTER_API_KEY. Without that key, public pages still serve but
classification and /health are unavailable.
Relevant embedding environment variables:
OPENROUTER_EMBEDDING_PROVIDERdefaults toauto, which lets OpenRouter route each request to the lowest-latency provider. Any other value is a provider name, such asdeepinfra, that serves every request with no fallback to other providers.OPENROUTER_EMBEDDING_MODELdefaults toqwen/qwen3-embedding-8bOPENROUTER_EMBEDDING_TIMEOUT_SECONDSdefaults to20EMBEDDING_DIMSdefaults to2048
Relevant reranking environment variables:
OPENROUTER_RERANK_MODELdefaults tovoyageai/rerank-3-liteOPENROUTER_RERANK_TIMEOUT_SECONDSdefaults to30
Embeddings are sent to OpenRouter's /api/v1/embeddings endpoint and
reranking to its /api/v1/rerank endpoint.
The classifier page also has an off-by-default Expand query beta switch.
When enabled, anthropic/claude-haiku-5.5 adds a short description after the
original query for embedding and reranking. The embedding input keeps the
Qwen3 Instruct: …\nQuery:… template with the description inside the query
part; the reranker input puts the rerank instruction after the semantic text.
Exact ID matches skip the model call. Code-like queries also skip it after an
exact miss. The original text stays in the input, result heading, URL, and ID
lookup. If OpenRouter is unavailable or the API key is absent, classification
uses the original text and the ordinary instruction-first format. Provider
failures are not cached. Shared
beta searches use ?enhance_query=1 in the URL.
Relevant Qdrant environment variables:
QDRANT_URLis preferred when set. Full HTTP(S) URLs are preserved; a bare hostname is treated as HTTPS.QDRANT_HOSTandQDRANT_PORT(defaultlocalhost:6333) are the fallback whenQDRANT_URLis unset.QDRANT_API_KEYis optional for unprotected local Qdrant deployments.
Relevant payment and quota environment variables:
POLAR_ACCESS_TOKENPOLAR_WEBHOOK_SECRETPOLAR_PRO_PRODUCT_IDQUOTA_FAIL_OPENdefaults totrueCHECKOUT_GRACE_TTLdefaults to300
Frontend JS/CSS files under app/static/ are build artifacts. They are generated from app/assets/ and are intentionally not committed to git.
For production, deploy from the repo root with the provided Dockerfile. The image builds the frontend assets in a Node/npm builder stage and copies only the compiled files into the final Python runtime image.
For Coolify, use:
- Source directory: repo root
- Build pack: Dockerfile
- Dockerfile path:
./Dockerfile - Include Source Commit in Build: disabled
docker-compose.yaml can still be used for local or manual container runs, but the recommended Coolify production path is the Dockerfile build directly.
Application startup validates every configured Qdrant collection, vector size, and required payload index without modifying Qdrant. Startup fails when the schema contract is invalid. Prepare and verify Qdrant explicitly before a deployment:
source .venv/bin/activate
python utilities/sync_payload_indexes.py apply
python utilities/sync_payload_indexes.py checkapply is a live migration operation: it backfills normalized ID payloads and
creates or replaces payload indexes. check is read-only. Run apply from a
controlled maintenance environment, verify the resolved Qdrant target before
confirming the operation, then deploy only after check succeeds. The utility
loads the repository .env; values already exported by the shell or supplied
by the container take precedence. A Qdrant client cleanup failure is reported
as an operational failure and makes the command exit nonzero.
Synchronous classification stages run on one dedicated background worker per
application process. Each process admits one active classification and up to
four waiting classifications. When the queue is full, fragment and RapidAPI
requests receive HTTP 503. Fragment callers already over quota receive the
paywall instead, without taking a queue slot. Server-rendered pages still return
200 to visitors and load results in the browser, while verified Google crawlers
receive HTTP 503 with Retry-After. An active classification retains its turn
through query enhancement and every synchronous stage. This bounds queued work
and keeps health checks, webhooks, and cached-page handling responsive.
GET /HomepageGET /{classifier_type}Classification page (unspsc, etim, naics)POST /{classifier_type}Submit classification requestGET /healthHealth check endpoint
Automated backend tests live under tests/ and use pytest as the test runner.
The existing tests retain their unittest.TestCase-compatible structure.
- Run the backend suite:
pytest - Run the frontend typecheck:
npm run typecheck - Run the Python typecheck:
python -m mypy
utilities/test_*.py scripts are manual smoke/debug helpers for live integrations and are intentionally separate from the main regression suite.
- Structured data markup (JSON-LD)
- FAQ schema for common questions
- Optimized meta descriptions and titles
- Breadcrumb navigation
- Semantic HTML structure
- Performance optimized loading