Skip to content

Commit b412715

Browse files
committed
Bump to OGX 1.0.2
1 parent 5ccea9e commit b412715

73 files changed

Lines changed: 1936 additions & 6422 deletions

File tree

Some content is hidden

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

docs/devel_doc/openapi.json

Lines changed: 46 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1424,7 +1424,7 @@
14241424
"shields"
14251425
],
14261426
"summary": "Shields Endpoint Handler",
1427-
"description": "Handle requests to the /shields endpoint.\n\nProcess GET requests to the /shields endpoint, returning a list of available\nshields from the Llama Stack service.\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- auth: Authentication tuple from the auth dependency (used by middleware).\n\n### Raises:\n- HTTPException: with status 401 for unauthorized access.\n- HTTPException: with status 403 if permission is denied.\n- HTTPException: with status 500 and a detail object containing `response`\n and `cause` when service configuration is wrong or incomplete.\n- HTTPException: with status 503 and a detail object containing `response`\n and `cause` when unable to connect to Llama Stack.\n\n### Returns:\n- ShieldsResponse: An object containing the list of available shields.",
1427+
"description": "Handle requests to the /shields endpoint.\n\nProcess GET requests to the /shields endpoint, returning a list of available\nshields from Lightspeed Core Stack configuration.\n\n### Parameters:\n- request: The incoming HTTP request (used by middleware).\n- auth: Authentication tuple from the auth dependency (used by middleware).\n\n### Raises:\n- HTTPException: with status 401 for unauthorized access.\n- HTTPException: with status 403 if permission is denied.\n- HTTPException: with status 500 and a detail object containing `response`\n and `cause` when service configuration is wrong or incomplete.\n\n### Returns:\n- ShieldsResponse: An object containing the list of available shields.",
14281428
"operationId": "shields_endpoint_handler_v1_shields_get",
14291429
"responses": {
14301430
"200": {
@@ -1563,34 +1563,6 @@
15631563
}
15641564
}
15651565
}
1566-
},
1567-
"503": {
1568-
"description": "Service unavailable",
1569-
"content": {
1570-
"application/json": {
1571-
"schema": {
1572-
"$ref": "#/components/schemas/ServiceUnavailableResponse"
1573-
},
1574-
"examples": {
1575-
"ogx": {
1576-
"value": {
1577-
"detail": {
1578-
"cause": "Connection error while trying to reach backend service.",
1579-
"response": "Unable to connect to OGX"
1580-
}
1581-
}
1582-
},
1583-
"kubernetes api": {
1584-
"value": {
1585-
"detail": {
1586-
"cause": "Failed to connect to Kubernetes API: Service Unavailable (status 503)",
1587-
"response": "Unable to connect to Kubernetes API"
1588-
}
1589-
}
1590-
}
1591-
}
1592-
}
1593-
}
15941566
}
15951567
}
15961568
}
@@ -12269,6 +12241,14 @@
1226912241
"title": "Model Context Protocol Server and tools configuration",
1227012242
"description": "MCP (Model Context Protocol) servers provide tools and capabilities to the AI agents. These are configured in this section. Only MCP servers defined in the lightspeed-stack.yaml configuration are available to the agents. Tools configured in the llama-stack run.yaml are not accessible to lightspeed-core agents."
1227112243
},
12244+
"shields": {
12245+
"items": {
12246+
"$ref": "#/components/schemas/ShieldConfiguration"
12247+
},
12248+
"type": "array",
12249+
"title": "Shields configuration",
12250+
"description": "Safety shields owned by Lightspeed Core Stack. Mirrors the former Llama Stack registered_resources.shields entries. Configured shields are listed by the /shields endpoint and applied via LCORE capabilities (not the Llama Stack Safety API)."
12251+
},
1227212252
"authentication": {
1227312253
"$ref": "#/components/schemas/AuthenticationConfiguration",
1227412254
"title": "Authentication configuration",
@@ -19897,6 +19877,43 @@
1989719877
}
1989819878
]
1989919879
},
19880+
"ShieldConfiguration": {
19881+
"properties": {
19882+
"shield_id": {
19883+
"type": "string",
19884+
"minLength": 1,
19885+
"title": "Shield ID",
19886+
"description": "Static shield capability identifier. Supported values: lightspeed_pii_redaction, lightspeed_question_validity."
19887+
},
19888+
"provider_id": {
19889+
"type": "string",
19890+
"minLength": 1,
19891+
"title": "Provider ID",
19892+
"description": "Shield provider identification."
19893+
},
19894+
"provider_shield_id": {
19895+
"type": "string",
19896+
"minLength": 1,
19897+
"title": "Provider shield ID",
19898+
"description": "Provider-specific shield resource identifier. For 'lightspeed_question_validity' this is the model id used by the guardrail."
19899+
},
19900+
"params": {
19901+
"additionalProperties": true,
19902+
"type": "object",
19903+
"title": "Shield parameters",
19904+
"description": "Optional capability-specific shield parameters."
19905+
}
19906+
},
19907+
"additionalProperties": false,
19908+
"type": "object",
19909+
"required": [
19910+
"shield_id",
19911+
"provider_id",
19912+
"provider_shield_id"
19913+
],
19914+
"title": "ShieldConfiguration",
19915+
"description": "Shield resource configuration owned by Lightspeed Core Stack.\n\nMirrors the former Llama Stack / OGX ``registered_resources.shields``\nentry. Shields are configured in ``lightspeed-stack.yaml`` and consumed\nby LCORE Pydantic AI capabilities, not registered with the Llama Stack\nSafety API.\n\n``shield_id`` must be one of the supported capability IDs:\n``lightspeed_question_validity`` or ``lightspeed_pii_redaction``.\n\nAttributes:\n shield_id: Static capability identifier (see ``SUPPORTED_SHIELD_IDS``).\n provider_id: Shield provider identification (typically matches shield_id).\n provider_shield_id: Provider resource id; for question-validity this is\n the model id used by the guard.\n params: Capability-specific parameters (prompt overrides for question\n validity; ``rules`` / ``case_sensitive`` for PII redaction)."
19916+
},
1990019917
"ShieldsResponse": {
1990119918
"properties": {
1990219919
"shields": {

examples/azure-run.yaml

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
version: 2
2-
image_name: azure-configuration
32

43
apis:
54
- responses
65
- batches
76
- files
87
- inference
9-
- safety
108
- tool_runtime
119
- conversations
1210
- vector_io
@@ -36,11 +34,6 @@ providers:
3634
storage_dir: ~/.llama/storage/files
3735
provider_id: meta-reference-files
3836
provider_type: inline::localfs
39-
safety:
40-
- config:
41-
excluded_categories: []
42-
provider_id: llama-guard
43-
provider_type: inline::llama-guard
4437
tool_runtime:
4538
- config: {} # Enable the RAG tool
4639
provider_id: file-search
@@ -58,19 +51,16 @@ providers:
5851
responses:
5952
- config:
6053
persistence:
61-
agent_state:
62-
namespace: agents_state
63-
backend: kv_default
6454
responses:
6555
table_name: agents_responses
6656
backend: sql_default
6757
provider_id: builtin
6858
provider_type: inline::builtin
6959
batches:
7060
- config:
71-
kvstore:
72-
namespace: batches_store
73-
backend: kv_default
61+
sqlstore:
62+
table_name: batches
63+
backend: sql_default
7464
provider_id: reference
7565
provider_type: inline::reference
7666
server:
@@ -99,8 +89,11 @@ storage:
9989
table_name: openai_conversations
10090
backend: sql_default
10191
prompts:
102-
namespace: prompts
103-
backend: kv_default
92+
table_name: prompts
93+
backend: sql_default
94+
connectors:
95+
table_name: connectors
96+
backend: sql_default
10497
registered_resources:
10598
models:
10699
- model_id: gpt-4o-mini
@@ -113,10 +106,6 @@ registered_resources:
113106
provider_model_id: all-mpnet-base-v2
114107
metadata:
115108
embedding_dimension: 768
116-
shields:
117-
- shield_id: llama-guard
118-
provider_id: llama-guard
119-
provider_shield_id: openai/gpt-4o-mini
120109
vector_stores:
121110
- embedding_dimension: 768
122111
embedding_model: sentence-transformers/all-mpnet-base-v2
@@ -127,5 +116,4 @@ vector_stores:
127116
default_embedding_model:
128117
provider_id: sentence-transformers
129118
model_id: all-mpnet-base-v2
130-
safety:
131-
default_shield_id: llama-guard
119+
distro_name: azure-configuration

examples/bedrock-run.yaml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ apis:
55
- batches
66
- files
77
- inference
8-
- safety
98
- tool_runtime
109
- conversations
1110
- vector_io
1211

13-
image_name: starter
1412
# external_providers_dir: /opt/app-root/src/.llama/providers.d
1513

1614
providers:
@@ -35,11 +33,6 @@ providers:
3533
storage_dir: ${env.SQLITE_STORE_DIR:=~/.llama/storage/files}
3634
provider_id: meta-reference-files
3735
provider_type: inline::localfs
38-
safety:
39-
- config:
40-
excluded_categories: []
41-
provider_id: llama-guard
42-
provider_type: inline::llama-guard
4336
tool_runtime:
4437
- config: {} # Enable the RAG tool
4538
provider_id: file-search
@@ -57,19 +50,16 @@ providers:
5750
responses:
5851
- config:
5952
persistence:
60-
agent_state:
61-
namespace: agents_state
62-
backend: kv_default
6353
responses:
6454
table_name: agents_responses
6555
backend: sql_default
6656
provider_id: builtin
6757
provider_type: inline::builtin
6858
batches:
6959
- config:
70-
kvstore:
71-
namespace: batches_store
72-
backend: kv_default
60+
sqlstore:
61+
table_name: batches
62+
backend: sql_default
7363
provider_id: reference
7464
provider_type: inline::reference
7565
server:
@@ -95,8 +85,11 @@ storage:
9585
table_name: openai_conversations
9686
backend: sql_default
9787
prompts:
98-
namespace: prompts
99-
backend: kv_default
88+
table_name: prompts
89+
backend: sql_default
90+
connectors:
91+
table_name: connectors
92+
backend: sql_default
10093
registered_resources:
10194
models:
10295
- model_id: custom-bedrock-model
@@ -109,13 +102,10 @@ registered_resources:
109102
provider_model_id: all-mpnet-base-v2
110103
metadata:
111104
embedding_dimension: 768
112-
shields:
113-
- shield_id: llama-guard
114-
provider_id: llama-guard
115-
provider_shield_id: openai/gpt-4o-mini
116105
vector_stores: []
117106
vector_stores:
118107
default_provider_id: faiss
119108
default_embedding_model:
120109
provider_id: sentence-transformers
121110
model_id: all-mpnet-base-v2
111+
distro_name: starter
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Lightspeed Core Service (LCS)
2+
service:
3+
host: localhost
4+
port: 8080
5+
auth_enabled: false
6+
workers: 1
7+
color_log: true
8+
access_log: true
9+
llama_stack:
10+
use_as_library_client: false
11+
url: http://localhost:8321
12+
api_key: xyzzy
13+
user_data_collection:
14+
feedback_enabled: true
15+
feedback_storage: "/tmp/data/feedback"
16+
transcripts_enabled: true
17+
transcripts_storage: "/tmp/data/transcripts"
18+
authentication:
19+
module: "noop"
20+
# Shields are owned by LCORE. shield_id must be one of the supported capability IDs:
21+
# - lightspeed_question_validity
22+
# - lightspeed_pii_redaction
23+
shields:
24+
- shield_id: lightspeed_question_validity
25+
provider_id: lightspeed_question_validity
26+
# Model used by the question-validity guardrail
27+
provider_shield_id: gpt-4o-mini
28+
# Optional overrides (defaults come from constants):
29+
# params:
30+
# model_prompt: "..."
31+
# invalid_question_response: "..."
32+
- shield_id: lightspeed_pii_redaction
33+
provider_id: lightspeed_pii_redaction
34+
provider_shield_id: lightspeed_pii_redaction
35+
params:
36+
case_sensitive: false
37+
rules:
38+
- pattern: '[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}'
39+
replacement: '[REDACTED_EMAIL]'

examples/profiles/inline-faiss.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ apis:
3434
- tool_runtime
3535
- vector_io
3636

37-
image_name: starter
3837
external_providers_dir: ${env.EXTERNAL_PROVIDERS_DIR:=~/.llama/providers.d}
3938

4039
providers:
@@ -63,9 +62,6 @@ providers:
6362
responses:
6463
- config:
6564
persistence:
66-
agent_state:
67-
namespace: agents_state
68-
backend: kv_default
6965
responses:
7066
table_name: agents_responses
7167
backend: sql_default
@@ -93,12 +89,14 @@ storage:
9389
table_name: openai_conversations
9490
backend: sql_default
9591
prompts:
96-
namespace: prompts
97-
backend: kv_default
92+
table_name: prompts
93+
backend: sql_default
94+
connectors:
95+
table_name: connectors
96+
backend: sql_default
9897

9998
registered_resources:
10099
models: []
101-
shields: []
102100
vector_stores: []
103101

104102
# REQUIRED for file_search tool calls to work. Without it, llama-stack's
@@ -110,3 +108,4 @@ vector_stores:
110108
default_embedding_model:
111109
provider_id: sentence-transformers
112110
model_id: nomic-ai/nomic-embed-text-v1.5
111+
distro_name: starter

0 commit comments

Comments
 (0)