Skip to content

Commit 1abc704

Browse files
authored
ci(docs): add new column detailing how to enable a provider (#58)
# What does this PR do? Make it easier for users to enable providers they desire ## Summary by CodeRabbit - Documentation - Expanded the distribution table with a new “How to enable” column. - Added per-entry guidance on enabling providers, including clear environment variable instructions where applicable. - Clarified the relationship between default status and enablement steps for each provider. - Improved readability and discoverability of setup information across providers. Approved-by: cdoern Approved-by: kelbrown20
2 parents e33ccd5 + 9ebf50c commit 1abc704

File tree

2 files changed

+51
-33
lines changed

2 files changed

+51
-33
lines changed

distribution/README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,28 @@ The image is currently shipping with upstream Llama Stack version [0.2.22](https
88

99
You can see an overview of the APIs and Providers the image ships with in the table below.
1010

11-
| API | Provider | Enabled by default? |
12-
|-----|----------|---------------------|
13-
| agents | inline::meta-reference | Yes |
14-
| datasetio | inline::localfs | Yes |
15-
| datasetio | remote::huggingface | Yes |
16-
| eval | remote::trustyai_lmeval | Yes |
17-
| files | inline::localfs | Yes |
18-
| inference | inline::sentence-transformers | Yes |
19-
| inference | remote::azure | No |
20-
| inference | remote::bedrock | No |
21-
| inference | remote::openai | No |
22-
| inference | remote::vertexai | No |
23-
| inference | remote::vllm | No |
24-
| inference | remote::watsonx | No |
25-
| safety | remote::trustyai_fms | Yes |
26-
| scoring | inline::basic | Yes |
27-
| scoring | inline::braintrust | Yes |
28-
| scoring | inline::llm-as-judge | Yes |
29-
| telemetry | inline::meta-reference | Yes |
30-
| tool_runtime | inline::rag-runtime | Yes |
31-
| tool_runtime | remote::brave-search | Yes |
32-
| tool_runtime | remote::model-context-protocol | Yes |
33-
| tool_runtime | remote::tavily-search | Yes |
34-
| vector_io | inline::milvus | Yes |
35-
| vector_io | remote::milvus | No |
11+
| API | Provider | Enabled by default? | How to enable |
12+
|-----|----------|---------------------|---------------|
13+
| agents | inline::meta-reference | Yes | N/A |
14+
| datasetio | inline::localfs | Yes | N/A |
15+
| datasetio | remote::huggingface | Yes | N/A |
16+
| eval | remote::trustyai_lmeval | Yes | N/A |
17+
| files | inline::localfs | Yes | N/A |
18+
| inference | inline::sentence-transformers | Yes | N/A |
19+
| inference | remote::azure | No | Set the `AZURE_API_KEY` environment variable |
20+
| inference | remote::bedrock | No | Set the `AWS_ACCESS_KEY_ID` environment variable |
21+
| inference | remote::openai | No | Set the `OPENAI_API_KEY` environment variable |
22+
| inference | remote::vertexai | No | Set the `VERTEX_AI_PROJECT` environment variable |
23+
| inference | remote::vllm | No | Set the `VLLM_URL` environment variable |
24+
| inference | remote::watsonx | No | Set the `WATSONX_API_KEY` environment variable |
25+
| safety | remote::trustyai_fms | Yes | N/A |
26+
| scoring | inline::basic | Yes | N/A |
27+
| scoring | inline::braintrust | Yes | N/A |
28+
| scoring | inline::llm-as-judge | Yes | N/A |
29+
| telemetry | inline::meta-reference | Yes | N/A |
30+
| tool_runtime | inline::rag-runtime | Yes | N/A |
31+
| tool_runtime | remote::brave-search | Yes | N/A |
32+
| tool_runtime | remote::model-context-protocol | Yes | N/A |
33+
| tool_runtime | remote::tavily-search | Yes | N/A |
34+
| vector_io | inline::milvus | Yes | N/A |
35+
| vector_io | remote::milvus | No | Set the `MILVUS_ENDPOINT` environment variable |

scripts/gen_distro_docs.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def extract_llama_stack_version():
3939
def gen_distro_table(providers_data):
4040
# Start with table header
4141
table_lines = [
42-
"| API | Provider | Enabled by default? |",
43-
"|-----|----------|---------------------|",
42+
"| API | Provider | Enabled by default? | How to enable |",
43+
"|-----|----------|---------------------|---------------|",
4444
]
4545

4646
# Create a list to collect all API-Provider pairs for sorting
@@ -56,21 +56,39 @@ def gen_distro_table(providers_data):
5656

5757
# Check if provider_id contains the conditional syntax ${<something>:+<something>}
5858
# This regex matches the pattern ${...} containing :+
59-
is_conditional = bool(
60-
re.search(r"\$\{[^}]*:\+[^}]*\}", str(provider_id))
59+
conditional_match = re.search(
60+
r"\$\{([^}]*:\+[^}]*)\}", str(provider_id)
6161
)
62-
enabled_by_default = "No" if is_conditional else "Yes"
62+
63+
if conditional_match:
64+
enabled_by_default = "No"
65+
# Extract the environment variable name (part before :+)
66+
env_var = conditional_match.group(1).split(":+")[0]
67+
# Remove "env." prefix if present
68+
if env_var.startswith("env."):
69+
env_var = env_var[4:]
70+
how_to_enable = f"Set the `{env_var}` environment variable"
71+
else:
72+
enabled_by_default = "Yes"
73+
how_to_enable = "N/A"
6374

6475
api_provider_pairs.append(
65-
(api_name, provider_type, enabled_by_default)
76+
(api_name, provider_type, enabled_by_default, how_to_enable)
6677
)
6778

6879
# Sort first by API name, then by provider type
6980
api_provider_pairs.sort(key=lambda x: (x[0], x[1]))
7081

7182
# Add sorted pairs to table
72-
for api_name, provider_type, enabled_by_default in api_provider_pairs:
73-
table_lines.append(f"| {api_name} | {provider_type} | {enabled_by_default} |")
83+
for (
84+
api_name,
85+
provider_type,
86+
enabled_by_default,
87+
how_to_enable,
88+
) in api_provider_pairs:
89+
table_lines.append(
90+
f"| {api_name} | {provider_type} | {enabled_by_default} | {how_to_enable} |"
91+
)
7492

7593
return "\n".join(table_lines)
7694

0 commit comments

Comments
 (0)