Application Details
Information about the platform's technical infrastructure and API endpoints.
API Endpoints
The platform provides the following RESTful API endpoints:
- GET /models
- GET /models/{id}
- GET /models/{id}/score
- POST /admin/scan
Static Analysis Rules
Our static analysis engine looks for specific patterns in model files:
- Usage of dangerous functions (e.g., eval, exec).
- Insecure deserialization (e.g., use of pickle).
- Code that makes outbound network calls.
- Suspicious file system operations.
Database Schema
The system uses the following basic schema to store model and score data:
CREATE TABLE models (
id TEXT PRIMARY KEY,
name TEXT,
owner TEXT,
hf_url TEXT,
license TEXT,
last_updated TIMESTAMP
);
CREATE TABLE scores (
model_id TEXT REFERENCES models(id),
computed_at TIMESTAMP DEFAULT now(),
overall_score NUMERIC(5,2),
PRIMARY KEY (model_id, computed_at)
);
Scoring Function (Example)
The overall score is calculated by taking a weighted average of different metrics:
def compute_overall_score(metrics):
weights = {
"provenance": 20, "usage": 20, "maintenance": 15,
"evaluation": 20, "safety": 15, "code_quality": 10
}
weighted_sum = 0
total_weight = sum(weights.values())
for k, w in weights.items():
v = metrics.get(k, 0)
weighted_sum += v * w
return round(weighted_sum / total_weight, 2)
Dynamic Tests (Expanded)
Dynamic analysis uses various inputs to test the model behavior.