Skip to content

Commit 310cce1

Browse files
Merge pull request #17 from llamastack/optimize-api-docs-parallel-generation
Optimize API docs generation with parallel processing
2 parents c186b2f + ab7d63c commit 310cce1

File tree

293 files changed

+1018
-1784
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+1018
-1784
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ permissions:
2626
jobs:
2727
build:
2828
if: ${{ github.event.inputs.action != 'deploy-only' }}
29-
runs-on: ubuntu-latest
29+
runs-on: ubuntu-latest-8-core
3030

3131
steps:
3232
- name: Checkout this repository
@@ -285,33 +285,59 @@ jobs:
285285
run: |
286286
cd "${{ env.TEMP_DIR }}/llama-stack/docs"
287287
288-
# Generate API docs selectively based on cache status
289-
echo "🔄 Generating API docs..."
288+
# Generate API docs in parallel for better performance
289+
echo "🔄 Generating API docs in parallel..."
290+
291+
# Start background processes for each API docs generation
292+
PIDS=()
290293
291294
# Generate stable API docs if not cached
292295
if [ "${{ steps.cache-api-stable.outputs.cache-hit }}" != 'true' ]; then
293-
echo " 📄 Generating stable API docs (cache miss)..."
294-
npm run gen-api-docs stable
296+
echo " 📄 Starting stable API docs generation (cache miss)..."
297+
npm run gen-api-docs stable &
298+
STABLE_PID=$!
299+
PIDS+=($STABLE_PID)
300+
echo " 🔄 Stable API docs generation started (PID: $STABLE_PID)"
295301
else
296302
echo " ⚡ Using cached stable API docs"
297303
fi
298304
299305
# Generate experimental API docs if not cached
300306
if [ "${{ steps.cache-api-experimental.outputs.cache-hit }}" != 'true' ]; then
301-
echo " 📄 Generating experimental API docs (cache miss)..."
302-
npm run gen-api-docs experimental
307+
echo " 📄 Starting experimental API docs generation (cache miss)..."
308+
npm run gen-api-docs experimental &
309+
EXPERIMENTAL_PID=$!
310+
PIDS+=($EXPERIMENTAL_PID)
311+
echo " 🔄 Experimental API docs generation started (PID: $EXPERIMENTAL_PID)"
303312
else
304313
echo " ⚡ Using cached experimental API docs"
305314
fi
306315
307316
# Generate deprecated API docs if not cached
308317
if [ "${{ steps.cache-api-deprecated.outputs.cache-hit }}" != 'true' ]; then
309-
echo " 📄 Generating deprecated API docs (cache miss)..."
310-
npm run gen-api-docs deprecated
318+
echo " 📄 Starting deprecated API docs generation (cache miss)..."
319+
npm run gen-api-docs deprecated &
320+
DEPRECATED_PID=$!
321+
PIDS+=($DEPRECATED_PID)
322+
echo " 🔄 Deprecated API docs generation started (PID: $DEPRECATED_PID)"
311323
else
312324
echo " ⚡ Using cached deprecated API docs"
313325
fi
314326
327+
# Wait for all parallel processes to complete
328+
if [ ${#PIDS[@]} -gt 0 ]; then
329+
echo " ⏳ Waiting for ${#PIDS[@]} API docs generation processes to complete..."
330+
for pid in "${PIDS[@]}"; do
331+
echo " ⏳ Waiting for process $pid..."
332+
if wait $pid; then
333+
echo " ✅ Process $pid completed successfully"
334+
else
335+
echo " ❌ Process $pid failed"
336+
exit 1
337+
fi
338+
done
339+
fi
340+
315341
echo "✅ API docs generation completed"
316342
317343
# Create version if not latest (after content is ready)
@@ -540,7 +566,7 @@ jobs:
540566

541567
deploy-only:
542568
if: ${{ github.event.inputs.action == 'deploy-only' }}
543-
runs-on: ubuntu-latest
569+
runs-on: ubuntu-latest-8-core
544570
permissions:
545571
contents: read
546572
pages: write

versioned_docs/version-v0.4.2/api-deprecated/benchmarks.tag.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
1717
1818
<DocCardList items={useCurrentSidebarCategory().items}/>
1919
```
20-

versioned_docs/version-v0.4.2/api-deprecated/datasets.tag.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
1717
1818
<DocCardList items={useCurrentSidebarCategory().items}/>
1919
```
20-

versioned_docs/version-v0.4.2/api-deprecated/get-benchmark-v-1-alpha-eval-benchmarks-benchmark-id-get.api.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Heading from "@theme/Heading";
3131
path={"/v1alpha/eval/benchmarks/{benchmark_id}"}
3232
context={"endpoint"}
3333
>
34-
34+
3535
</MethodEndpoint>
3636

3737

@@ -49,23 +49,20 @@ Get a benchmark by its ID.
4949
<ParamsDetails
5050
parameters={[{"name":"benchmark_id","in":"path","required":true,"schema":{"type":"string","description":"The ID of the benchmark to get.","title":"Benchmark Id"},"description":"The ID of the benchmark to get."}]}
5151
>
52-
52+
5353
</ParamsDetails>
5454

5555
<RequestSchema
5656
title={"Body"}
5757
body={undefined}
5858
>
59-
59+
6060
</RequestSchema>
6161

6262
<StatusCodes
6363
id={undefined}
6464
label={undefined}
6565
responses={{"200":{"description":"A Benchmark.","content":{"application/json":{"schema":{"properties":{"identifier":{"type":"string","title":"Identifier","description":"Unique identifier for this resource in llama stack"},"provider_resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Unique identifier for this resource in the provider"},"provider_id":{"type":"string","title":"Provider Id","description":"ID of the provider that owns this resource"},"type":{"type":"string","const":"benchmark","title":"Type","description":"The resource type, always benchmark.","default":"benchmark"},"dataset_id":{"type":"string","title":"Dataset Id","description":"Identifier of the dataset to use for the benchmark evaluation."},"scoring_functions":{"items":{"type":"string"},"type":"array","title":"Scoring Functions","description":"List of scoring function identifiers to apply during evaluation."},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Metadata for this evaluation task."}},"type":"object","required":["identifier","provider_id","dataset_id","scoring_functions"],"title":"Benchmark","description":"A benchmark resource for evaluating model performance."}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":400,"title":"Bad Request","detail":"The request was invalid or malformed"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":429,"title":"Too Many Requests","detail":"You have exceeded the rate limit. Please try again later."}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":500,"title":"Internal Server Error","detail":"An unexpected error occurred"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"}}}}}}
6666
>
67-
68-
</StatusCodes>
69-
7067

71-
68+
</StatusCodes>

versioned_docs/version-v0.4.2/api-deprecated/get-dataset-v-1-beta-datasets-dataset-id-get.api.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Heading from "@theme/Heading";
3131
path={"/v1beta/datasets/{dataset_id}"}
3232
context={"endpoint"}
3333
>
34-
34+
3535
</MethodEndpoint>
3636

3737

@@ -49,23 +49,20 @@ Get a dataset by its ID.
4949
<ParamsDetails
5050
parameters={[{"name":"dataset_id","in":"path","required":true,"schema":{"type":"string","description":"The ID of the dataset to get.","title":"Dataset Id"},"description":"The ID of the dataset to get."}]}
5151
>
52-
52+
5353
</ParamsDetails>
5454

5555
<RequestSchema
5656
title={"Body"}
5757
body={undefined}
5858
>
59-
59+
6060
</RequestSchema>
6161

6262
<StatusCodes
6363
id={undefined}
6464
label={undefined}
6565
responses={{"200":{"description":"The dataset object.","content":{"application/json":{"schema":{"properties":{"identifier":{"type":"string","title":"Identifier","description":"Unique identifier for this resource in llama stack"},"provider_resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Unique identifier for this resource in the provider"},"provider_id":{"type":"string","title":"Provider Id","description":"ID of the provider that owns this resource"},"type":{"type":"string","const":"dataset","title":"Type","description":"Type of resource, always 'dataset' for datasets","default":"dataset"},"purpose":{"description":"Purpose of the dataset indicating its intended use","type":"string","enum":["post-training/messages","eval/question-answer","eval/messages-answer"],"title":"DatasetPurpose"},"source":{"oneOf":[{"title":"URIDataSource","properties":{"type":{"type":"string","const":"uri","title":"Type","description":"The type of data source.","default":"uri"},"uri":{"type":"string","title":"Uri","description":"The dataset can be obtained from a URI. E.g. \"https://mywebsite.com/mydata.jsonl\", \"lsfs://mydata.jsonl\", \"data:csv;base64,{base64_content}\""}},"type":"object","required":["uri"],"description":"A dataset that can be obtained from a URI."},{"title":"RowsDataSource","properties":{"type":{"type":"string","const":"rows","title":"Type","description":"The type of data source.","default":"rows"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"The dataset is stored in rows. E.g. [{\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]}]"}},"type":"object","required":["rows"],"description":"A dataset stored in rows."}],"title":"URIDataSource | RowsDataSource","description":"Data source configuration for the dataset","discriminator":{"propertyName":"type","mapping":{"rows":{"properties":{"type":{"type":"string","const":"rows","title":"Type","description":"The type of data source.","default":"rows"},"rows":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Rows","description":"The dataset is stored in rows. E.g. [{\"messages\": [{\"role\": \"user\", \"content\": \"Hello, world!\"}, {\"role\": \"assistant\", \"content\": \"Hello, world!\"}]}]"}},"type":"object","required":["rows"],"title":"RowsDataSource","description":"A dataset stored in rows."},"uri":{"properties":{"type":{"type":"string","const":"uri","title":"Type","description":"The type of data source.","default":"uri"},"uri":{"type":"string","title":"Uri","description":"The dataset can be obtained from a URI. E.g. \"https://mywebsite.com/mydata.jsonl\", \"lsfs://mydata.jsonl\", \"data:csv;base64,{base64_content}\""}},"type":"object","required":["uri"],"title":"URIDataSource","description":"A dataset that can be obtained from a URI."}}}},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Any additional metadata for this dataset"}},"type":"object","required":["identifier","provider_id","purpose","source"],"title":"Dataset","description":"Dataset resource for storing and accessing training or evaluation data."}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":400,"title":"Bad Request","detail":"The request was invalid or malformed"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":429,"title":"Too Many Requests","detail":"You have exceeded the rate limit. Please try again later."}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":500,"title":"Internal Server Error","detail":"An unexpected error occurred"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"}}}}}}
6666
>
67-
68-
</StatusCodes>
69-
7067

71-
68+
</StatusCodes>

versioned_docs/version-v0.4.2/api-deprecated/get-model-v-1-models-model-id-get.api.mdx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Heading from "@theme/Heading";
3131
path={"/v1/models/{model_id}"}
3232
context={"endpoint"}
3333
>
34-
34+
3535
</MethodEndpoint>
3636

3737

@@ -51,23 +51,20 @@ Get a model by its identifier.
5151
<ParamsDetails
5252
parameters={[{"name":"model_id","in":"path","required":true,"schema":{"type":"string"},"description":"Path parameter: model_id"}]}
5353
>
54-
54+
5555
</ParamsDetails>
5656

5757
<RequestSchema
5858
title={"Body"}
5959
body={undefined}
6060
>
61-
61+
6262
</RequestSchema>
6363

6464
<StatusCodes
6565
id={undefined}
6666
label={undefined}
6767
responses={{"200":{"description":"A Model.","content":{"application/json":{"schema":{"properties":{"identifier":{"type":"string","title":"Identifier","description":"Unique identifier for this resource in llama stack"},"provider_resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Unique identifier for this resource in the provider"},"provider_id":{"type":"string","title":"Provider Id","description":"ID of the provider that owns this resource"},"type":{"type":"string","const":"model","title":"Type","default":"model"},"metadata":{"additionalProperties":true,"type":"object","title":"Metadata","description":"Any additional metadata for this model"},"model_type":{"default":"llm","type":"string","enum":["llm","embedding","rerank"],"title":"ModelType","description":"Enumeration of supported model types in Llama Stack."}},"type":"object","required":["identifier","provider_id"],"title":"Model","description":"A model resource representing an AI model registered in Llama Stack."}}}},"400":{"description":"Bad Request","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":400,"title":"Bad Request","detail":"The request was invalid or malformed"}}}},"429":{"description":"Too Many Requests","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":429,"title":"Too Many Requests","detail":"You have exceeded the rate limit. Please try again later."}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"},"example":{"status":500,"title":"Internal Server Error","detail":"An unexpected error occurred"}}}},"default":{"description":"Default Response","content":{"application/json":{"schema":{"description":"Error response from the API. Roughly follows RFC 7807.","properties":{"status":{"title":"Status","type":"integer"},"title":{"title":"Title","type":"string"},"detail":{"title":"Detail","type":"string"},"instance":{"anyOf":[{"type":"string"},{"type":"null"}],"nullable":true}},"required":["status","title","detail"],"title":"Error","type":"object"}}}}}}
6868
>
69-
70-
</StatusCodes>
71-
7269

73-
70+
</StatusCodes>

0 commit comments

Comments
 (0)