Rewrite it in Rust.#13
Conversation
04ec794 to
0533fe3
Compare
0533fe3 to
8130087
Compare
Pascal-Delange
left a comment
There was a problem hiding this comment.
I'll grant you this one, rusty crab !
| git clone https://huggingface.co/onnx-community/gliner_small-v2.1 model | ||
| cd model | ||
| git lfs pull | ||
| cd .. |
5cae9ea to
89ccd6f
Compare
89ccd6f to
f03f4e4
Compare
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (3)
📒 Files selected for processing (20)
📝 WalkthroughWalkthroughThis PR migrates the NER service from Python (FastAPI/Poetry) to Rust (Axum), replacing the entire API implementation, adding structured tracing-based logging, Rust-focused CI/CD workflows, and Rust multistage Docker builds. ChangesPython-to-Rust Service Migration
Sequence DiagramsequenceDiagram
participant Client
participant Axum as Axum Router
participant Auth as Auth Extractor
participant Trace as API Logger
participant Inference as Inference Engine
participant Model as GLiNER Model
Client->>Axum: POST /detect + Bearer Token
Axum->>Trace: Log request (timestamp, method, path)
Trace->>Auth: Forward request with headers
Auth->>Auth: Extract Bearer token from Authorization header
alt Token Valid
Auth->>Inference: Return Auth, pass to handler
Inference->>Model: Call infer(text)
Model->>Model: Lazy-load GLiNER + CUDA if enabled
Model-->>Inference: Return Vec<Vec<Span>>
Inference->>Inference: Map spans to Output { kind, text }
Inference-->>Axum: (StatusCode::OK, JSON array)
else Token Missing/Invalid
Auth-->>Axum: Reject (HTTP 401)
end
Axum->>Trace: Log response (status, latency, size)
Trace-->>Client: HTTP response with result
Estimated Code Review Effort🎯 4 (Complex) | ⏱️ ~45 minutes Suggested Labels
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary by CodeRabbit
New Features
Chores