a1c00l commited on
Commit
3ee740e
·
verified ·
1 Parent(s): e68e858

Update docs/AI_SBOM_API_doc.md

Browse files
Files changed (1) hide show
  1. docs/AI_SBOM_API_doc.md +67 -14
docs/AI_SBOM_API_doc.md CHANGED
@@ -6,12 +6,17 @@ The AI SBOM Generator API provides a comprehensive solution for generating Cyclo
6
 
7
  ## Base URL
8
 
9
- When deployed on Hugging Face Spaces, the base URL will be:
10
  ```
11
  https://aetheris-ai-aibom-generator.hf.space
12
  ```
13
 
14
- Replace this with your actual deployment URL.
 
 
 
 
 
15
 
16
  ## API Endpoints
17
 
@@ -211,7 +216,7 @@ curl -X POST "https://aetheris-ai-aibom-generator.hf.space/generate" \
211
 
212
  The API also provides a web user interface for generating AI SBOMs without writing code:
213
 
214
- **URL**: `https://aetheris-ai-aibom-generator.hf.space/`
215
 
216
  The web UI allows you to:
217
  1. Enter a Hugging Face model ID
@@ -235,7 +240,7 @@ In the Field Checklist tab of the results page, you'll see a list of fields with
235
 
236
  ## Security Features
237
 
238
- The API includes several security features to protect against Denial of Service (DoS) attacks:
239
 
240
  1. **Rate Limiting**: Limits the number of requests a single IP address can make within a specific time window.
241
 
@@ -243,9 +248,6 @@ The API includes several security features to protect against Denial of Service
243
 
244
  3. **Request Size Limiting**: Prevents attackers from sending extremely large payloads that could consume memory or processing resources.
245
 
246
- 4. **API Key Authentication** (optional): When configured, requires an API key for accessing API endpoints, enabling tracking and control of API usage.
247
-
248
- 5. **CAPTCHA Verification** (optional): When configured for the web interface, helps ensure requests come from humans rather than bots.
249
 
250
  ## Notes on Using the API
251
 
@@ -274,15 +276,66 @@ Error responses include a detail message explaining the error:
274
 
275
  ## Completeness Score
276
 
277
- The completeness score is calculated based on the presence and quality of various fields in the AI SBOM. The score is broken down into sections:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
278
 
279
- 1. **Required Fields** (20 points): Basic required fields for a valid AI SBOM
280
- 2. **Metadata** (20 points): Information about the AI SBOM itself
281
- 3. **Component Basic Info** (20 points): Basic information about the AI model component
282
- 4. **Model Card** (30 points): Detailed model card information
283
- 5. **External References** (10 points): Links to external resources
284
 
285
- The total score is a weighted sum of these section scores, with a maximum of 100 points.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
286
 
287
  ## Enhancement Report
288
 
 
6
 
7
  ## Base URL
8
 
9
+ When deployed on Hugging Face Spaces, the base URL for API access will be:
10
  ```
11
  https://aetheris-ai-aibom-generator.hf.space
12
  ```
13
 
14
+ You can also access the web interface through:
15
+ ```
16
+ https://huggingface.co/spaces/aetheris-ai/aibom-generator
17
+ ```
18
+
19
+ Both URLs point to the same application, but the first format (hf.space) is preferred for API calls.
20
 
21
  ## API Endpoints
22
 
 
216
 
217
  The API also provides a web user interface for generating AI SBOMs without writing code:
218
 
219
+ **URL**: `https://huggingface.co/spaces/aetheris-ai/aibom-generator`
220
 
221
  The web UI allows you to:
222
  1. Enter a Hugging Face model ID
 
240
 
241
  ## Security Features
242
 
243
+ The API includes several security features to protect against Denial of Service (DoS) attacks and contain resources:
244
 
245
  1. **Rate Limiting**: Limits the number of requests a single IP address can make within a specific time window.
246
 
 
248
 
249
  3. **Request Size Limiting**: Prevents attackers from sending extremely large payloads that could consume memory or processing resources.
250
 
 
 
 
251
 
252
  ## Notes on Using the API
253
 
 
276
 
277
  ## Completeness Score
278
 
279
+ The completeness score evaluates the quality and completeness of the generated AI SBOM. Understanding how this score is calculated is important for interpreting API responses.
280
+
281
+ ### Scoring Formula
282
+
283
+ The total score is calculated using a **weighted normalization** approach:
284
+
285
+ ```
286
+ Total Score = Sum of (Section Score × Section Weight)
287
+ ```
288
+
289
+ Where:
290
+ - Section Score = Points earned in that section
291
+ - Section Weight = Section's maximum points ÷ Total possible points (100)
292
+
293
+ ### Scoring Categories
294
+
295
+ The score is divided into five weighted sections:
296
+
297
+ 1. **Required Fields** (20% weight): Basic required fields for a valid AI SBOM
298
+ 2. **Metadata** (20% weight): Information about the AI SBOM itself
299
+ 3. **Component Basic Info** (20% weight): Basic information about the AI model component
300
+ 4. **Model Card** (30% weight): Detailed model card information (higher weight as it contains critical AI information)
301
+ 5. **External References** (10% weight): Links to external resources
302
+
303
+ ### Example Calculation
304
+
305
+ For an SBOM with these section scores:
306
+ - Required Fields: 20 points × 0.20 weight = 4.0 points
307
+ - Metadata: 15 points × 0.20 weight = 3.0 points
308
+ - Component Basic: 10 points × 0.20 weight = 2.0 points
309
+ - Model Card: 10 points × 0.30 weight = 3.0 points
310
+ - External References: 5 points × 0.10 weight = 0.5 points
311
+
312
+ The total score would be 12.5 points, even though the raw section scores sum to 60 points.
313
+
314
+ **Note:** The total score is not the sum of section scores. Each section contributes proportionally to its weight in the final score.
315
 
316
+ ### Sample API Response
 
 
 
 
317
 
318
+ When using the score endpoint, you'll receive a response like this:
319
+
320
+ ```json
321
+ {
322
+ "total_score": 11.3,
323
+ "section_scores": {
324
+ "required_fields": 20,
325
+ "metadata": 11.7,
326
+ "component_basic": 15.6,
327
+ "component_model_card": 2.7,
328
+ "external_references": 10
329
+ },
330
+ "max_scores": {
331
+ "required_fields": 20,
332
+ "metadata": 20,
333
+ "component_basic": 20,
334
+ "component_model_card": 30,
335
+ "external_references": 10
336
+ }
337
+ }
338
+ ```
339
 
340
  ## Enhancement Report
341