Benchmarking GLiNER2 guard models for content moderation serving:
# Clone
git clone https://github.com/Stepan5024/gliner-guard-experiment.git
cd gliner-guard-experiment
# Install GLiNER2
cd GLiNER2
pip install -e .
pip install scipy
# Run accuracy benchmark (GPU recommended)
python benchmarks/benchmark_accuracy_vs_labels.py
# Run latency benchmark
python benchmarks/benchmark_label_scaling.py
# Run tests
pytest tests/ -k "not slow" -v
GLiNER2/ # GLiNER2 fork with bi-encoder support
├── gliner2/
│ ├── model.py # Extractor with bi-encoder layers
│ ├── processor.py # Sequence length guard
│ ├── inference/
│ │ ├── engine.py # GLiNER2 main class
│ │ └── schema_registry.py # Dynamic label registry
│ └── eval/
│ └── evaluate.py # F1/P/R evaluation harness
├── benchmarks/
│ ├── benchmark_accuracy_vs_labels.py
│ ├── benchmark_label_scaling.py
│ └── benchmark_batching.py
└── tests/
gliner-guard-serve/ # Ray Serve deployment + load testing
├── ray-serve/ # Ray Serve app (REST + gRPC)
├── litserve-baseline/ # LitServe baseline
├── test-script/ # Locust load tests + datasets
├── scripts/ # Automation scripts
├── results/ # Benchmark outputs
├── docker-compose.yml # 3 profiles: litserve, ray-serve, ray-serve-grpc
└── Makefile # 22 automation targets
7 commits
HTML
95.2%
Python
4.3%
Benchmarking GLiNER2 guard models for content moderation serving:
# Clone
git clone https://github.com/Stepan5024/gliner-guard-experiment.git
cd gliner-guard-experiment
# Install GLiNER2
cd GLiNER2
pip install -e .
pip install scipy
# Run accuracy benchmark (GPU recommended)
python benchmarks/benchmark_accuracy_vs_labels.py
# Run latency benchmark
python benchmarks/benchmark_label_scaling.py
# Run tests
pytest tests/ -k "not slow" -v
GLiNER2/ # GLiNER2 fork with bi-encoder support
├── gliner2/
│ ├── model.py # Extractor with bi-encoder layers
│ ├── processor.py # Sequence length guard
│ ├── inference/
│ │ ├── engine.py # GLiNER2 main class
│ │ └── schema_registry.py # Dynamic label registry
│ └── eval/
│ └── evaluate.py # F1/P/R evaluation harness
├── benchmarks/
│ ├── benchmark_accuracy_vs_labels.py
│ ├── benchmark_label_scaling.py
│ └── benchmark_batching.py
└── tests/
gliner-guard-serve/ # Ray Serve deployment + load testing
├── ray-serve/ # Ray Serve app (REST + gRPC)
├── litserve-baseline/ # LitServe baseline
├── test-script/ # Locust load tests + datasets
├── scripts/ # Automation scripts
├── results/ # Benchmark outputs
├── docker-compose.yml # 3 profiles: litserve, ray-serve, ray-serve-grpc
└── Makefile # 22 automation targets
7 commits
HTML
95.2%
Python
4.3%