Documentation Index
Fetch the complete documentation index at: https://mintlify.com/GingerlyData247/SOTeam4-P2/llms.txt
Use this file to discover all available pages before exploring further.
About This Endpoint
Based on the current codebase implementation, there is no separate
/artifact/ingest endpoint.The ingestion functionality is integrated into the main artifact creation endpoint:POST /artifact/modelWhen you create a model artifact using POST /artifact/model, the system automatically triggers the full ingestion pipeline described below.How Model Ingestion Works
When you create a model artifact viaPOST /artifact/model, the system automatically performs the following ingestion steps:
1. HuggingFace Model Normalization
The provided URL or model ID is normalized to a canonical HuggingFace identifier:https://huggingface.co/google-bert/bert-base-uncased→google-bert/bert-base-uncasedgoogle-bert/bert-base-uncased→google-bert/bert-base-uncased
2. License Extraction
The system fetches license information from the HuggingFace API:license field and normalizes it to lowercase SPDX format (e.g., apache-2.0, mit).
3. Trustworthiness Metrics Computation
The ingestion pipeline computes comprehensive trust metrics:Overall trustworthiness score (0.0 - 1.0)
Code review and peer validation scoreCritical: Models with reviewedness < 0.5 are rejected with HTTP 424
Reproducibility and documentation quality score
Ease of understanding and adoption
Project sustainability and contributor diversity
Validation of performance benchmarks
Quality of training data and code
Training dataset quality assessment
Code quality and maintainability
Dependency tree health score
4. Lineage Extraction
The system extracts parent model dependencies from:- Model card metadata
- HuggingFace API responses
- Repository configuration files
/artifact/model/{id}/lineage.
5. Reviewedness Gate
This ensures only well-reviewed, trustworthy models are accepted into the registry.6. Artifact Storage
After passing validation:- A minimal artifact ZIP is created containing
source_url.txt - The ZIP is uploaded to S3 at
artifacts/model/{id}.zip - A pre-signed download URL is generated (valid for limited time)
- The download URL is stored in artifact metadata
Usage
To trigger ingestion, use the standard artifact creation endpoint:Response
Successful ingestion returns HTTP 201 with full artifact details including computed metrics:GET /artifact/model/{id}/rate- View all trust metricsGET /artifacts/model/{id}- View artifact with embedded metadata
Error Codes
400- Invalid HuggingFace model ID or URL424- Reviewedness score below threshold (< 0.5)502- Unable to fetch HuggingFace model metadata500- Internal error during metric computation or storage
Implementation Details
The ingestion logic is implemented in/home/daytona/workspace/source/src/api/routers/models.py:322:
See Also
- Create Artifact - Main artifact creation endpoint
- Retrieve Artifact - Get artifact with metrics
- Rate Model - View computed trust metrics