Skip to content

3.0

Choose a tag to compare

@andresribeiro andresribeiro released this 23 May 01:00
· 15 commits to main since this release

⚠️ Breaking changes

  • Route changed/single/multipart-form and /multiple/multipart-form are gone. Use POST /classify instead.
  • Input format changed — Multipart form data replaced with raw application/octet-stream (send image bytes directly).
  • Multiple images per request no longer supported — The batch /multiple/multipart-form endpoint has been removed. Classify each image individually with separate API calls.

What's new

  • Simplified API — Switched from /single/multipart-form and /multiple/multipart-form (multipart) to a single POST on /classify endpoint accepting raw application/octet-stream. No more form parsing overhead.
  • Structured logging — Added @logtape/logtape with ANSI color output. Server logs classification duration and request size at info/debug levels.
  • AGENTS.md — Agent instructions for AI coding assistants (Bun/Hono/Biome stack, Docker commands, conventions).

What's better

  • Faster inference — Image processing pipeline now resizes directly to 224×224 raw RGB tensor without an intermediate JPEG re-encode. Sharp cache disabled for lower memory usage.
  • Memory safety — Tensor disposal is guaranteed via try/finally, preventing GPU/CPU memory leaks even when model.classify throws.
  • Raw binary transport — Accepts application/octet-stream instead of multipart form data, avoiding multipart parsing and base64 overhead.
  • Dependencies bumped — Hono 4.11.94.12.22, NSFWJS 4.2.14.3.0, TypeScript 5 6, Biome 2.4.22.4.15, @types/bun pinned.
  • Updated tsconfig — Added "types": ["bun"] for proper Bun type resolution.
  • README rewrite — New table of contents, performance deep-dive (SIMD, jemalloc, pipeline details), usage examples in JS/Python/httpie/curl, local dev instructions, license section. Badges added.
  • editorconfig / .gitignore — Added .zed to gitignore.