https://github.com/messense/fasttext-serving
fastText model serving service
https://github.com/messense/fasttext-serving
fasttext model-server model-serving nlp
Last synced: 6 months ago
JSON representation
fastText model serving service
- Host: GitHub
- URL: https://github.com/messense/fasttext-serving
- Owner: messense
- License: other
- Created: 2018-01-22T05:48:05.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2024-11-13T01:42:35.000Z (11 months ago)
- Last Synced: 2025-03-28T15:08:40.292Z (6 months ago)
- Topics: fasttext, model-server, model-serving, nlp
- Language: Rust
- Size: 5.8 MB
- Stars: 59
- Watchers: 5
- Forks: 13
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# fasttext-serving
[](https://github.com/messense/fasttext-serving/actions?query=workflow%3ACI)
[](https://crates.io/crates/fasttext-serving)
[](https://hub.docker.com/r/messense/fasttext-serving)fastText model serving service
## Installation
You can download prebuilt binary from [GitHub releases](https://github.com/messense/fasttext-serving/releases),
or install it using Cargo:```bash
cargo install fasttext-serving
```Using Docker:
```bash
docker pull messense/fasttext-serving
```## Usage
```bash
$ fasttext-serving --helpUSAGE:
fasttext-serving [OPTIONS] --modelFLAGS:
--grpc Serving gRPC API instead of HTTP API
-h, --help Prints help information
-V, --version Prints version informationOPTIONS:
Listen address [default: 127.0.0.1]
-a, --address
-m, --model Model path
-p, --port Listen port [default: 8000]
-w, --workers Worker thread count, defaults to CPU count
```### Serve HTTP REST API
HTTP API endpoint:
```
POST /predict
```Post data should be JSON array of string, for example `["abc", "def"]`
CURL example:
```bash
$ curl -X POST -H 'Content-Type: application/json' \
--data "[\"Which baking dish is best to bake a banana bread?\", \"Why not put knives in the dishwasher?\"]" \
'http://localhost:8000/predict'
[[["baking"],[0.7152988]],[["equipment"],[0.73479545]]]
```### Serve gRPC API
Run the command with `--grpc` to serve gRPC API instead of HTTP REST API.
Please refer to gRPC Python client documentation [here](./python).
## License
This work is released under the MIT license. A copy of the license is provided in the [LICENSE](./LICENSE) file.