Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Containerfile.add_llama_to_lightspeed
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ RUN python3.12 -m pip install sqlalchemy

RUN python3.12 -m pip install mcp

RUN python3.12 -m pip install psycopg2-binary

# Patch llama-stack with an important fix
RUN microdnf install -y patch
RUN cd /app-root/llama-stack && \
Expand Down
2 changes: 1 addition & 1 deletion Containerfile.assisted-chat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM quay.io/lightspeed-core/lightspeed-stack:dev-20250728-f6cc203

RUN python3 -m ensurepip --default-pip && pip install --upgrade pip

RUN python3 -m pip install pyyaml pyaml litellm sqlalchemy mcp
RUN python3 -m pip install pyyaml pyaml litellm sqlalchemy mcp psycopg2-binary

# Patch llama-stack with an important fix
USER root
Expand Down
26 changes: 26 additions & 0 deletions assisted-chat-pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ spec:
env:
- name: GEMINI_API_KEY
value: ${GEMINI_API_KEY}
- name: LLAMA_STACK_POSTGRES_HOST
value: localhost
- name: LLAMA_STACK_POSTGRES_PORT
value: "5432"
- name: LLAMA_STACK_POSTGRES_USER
value: llamastack
- name: LLAMA_STACK_POSTGRES_PASSWORD
value: llamastack
- name: LLAMA_STACK_POSTGRES_NAME
value: llamastack
ports:
- containerPort: 8090
hostPort: 8090
Expand Down Expand Up @@ -62,8 +72,24 @@ spec:
- mountPath: /systemprompt.txt
name: config
subPath: systemprompt.txt
- name: postgres
image: registry.redhat.io/rhel9/postgresql-16:latest
env:
- name: POSTGRESQL_USER
value: llamastack
- name: POSTGRESQL_PASSWORD
value: llamastack
- name: POSTGRESQL_DATABASE
value: llamastack
ports:
- containerPort: 5432
volumeMounts:
- name: pgdata
mountPath: /var/lib/pgsql/data
volumes:
- name: config
hostPath:
path: ./config
type: Directory
- name: pgdata
emptyDir: {}
34 changes: 25 additions & 9 deletions config/llama_stack_client_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,19 @@ providers:
provider_type: inline::meta-reference
config:
persistence_store:
type: sqlite
namespace: null
db_path: ${env.SQLITE_STORE_DIR:=/tmp/.llama/distributions/starter}/agents_store.db
type: postgres
host: ${env.POSTGRES_HOST:=localhost}
port: ${env.POSTGRES_PORT:=5432}
db: ${env.POSTGRES_DB:=llamastack}
user: ${env.POSTGRES_USER:=llamastack}
password: ${env.POSTGRES_PASSWORD:=llamastack}
responses_store:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=/tmp/.llama/distributions/starter}/responses_store.db
type: postgres
host: ${env.POSTGRES_HOST:=localhost}
port: ${env.POSTGRES_PORT:=5432}
db: ${env.POSTGRES_DB:=llamastack}
user: ${env.POSTGRES_USER:=llamastack}
password: ${env.POSTGRES_PASSWORD:=llamastack}
telemetry:
- provider_id: meta-reference
provider_type: inline::meta-reference
Expand All @@ -55,11 +62,20 @@ providers:
provider_type: remote::model-context-protocol
config: {}
metadata_store:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=/tmp/.llama/distributions/starter}/registry.db
type: postgres
host: ${env.POSTGRES_HOST:=localhost}
port: ${env.POSTGRES_PORT:=5432}
db: ${env.POSTGRES_DB:=llamastack}
user: ${env.POSTGRES_USER:=llamastack}
password: ${env.POSTGRES_PASSWORD:=llamastack}
table_name: llamastack_kvstore
inference_store:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=/tmp/.llama/distributions/starter}/inference_store.db
type: postgres
host: ${env.POSTGRES_HOST:=localhost}
port: ${env.POSTGRES_PORT:=5432}
db: ${env.POSTGRES_DB:=llamastack}
user: ${env.POSTGRES_USER:=llamastack}
password: ${env.POSTGRES_PASSWORD:=llamastack}
models:
- metadata: {}
model_id: gemini/gemini-2.0-flash
Expand Down
68 changes: 59 additions & 9 deletions template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ parameters:
- name: LLAMA_STACK_SERVER_PORT
value: "8321"
description: "Port number for the embedded Llama Stack server"
- name: LLAMA_STACK_DB_SECRET_NAME
value: "llama-stack-db"
description: "Name of the Kubernetes secret containing the llama-stack database credentials"
- name: SSO_BASE_URL
value: "https://sso.redhat.com/auth/realms/redhat-external"
description: "SSO Base URL"
Expand Down Expand Up @@ -238,12 +241,19 @@ objects:
provider_type: inline::meta-reference
config:
persistence_store:
type: sqlite
namespace: null
db_path: ${STORAGE_MOUNT_PATH}/sqlite/agents_store.db
type: postgres
host: ${env.LLAMA_STACK_POSTGRES_HOST}
port: ${env.LLAMA_STACK_POSTGRES_PORT}
db: ${env.LLAMA_STACK_POSTGRES_NAME}
user: ${env.LLAMA_STACK_POSTGRES_USER}
password: ${env.LLAMA_STACK_POSTGRES_PASSWORD}
responses_store:
type: sqlite
db_path: ${STORAGE_MOUNT_PATH}/sqlite/responses_store.db
type: postgres
host: ${env.LLAMA_STACK_POSTGRES_HOST}
port: ${env.LLAMA_STACK_POSTGRES_PORT}
db: ${env.LLAMA_STACK_POSTGRES_NAME}
user: ${env.LLAMA_STACK_POSTGRES_USER}
password: ${env.LLAMA_STACK_POSTGRES_PASSWORD}
telemetry:
- provider_id: meta-reference
provider_type: inline::meta-reference
Expand All @@ -268,11 +278,20 @@ objects:
provider_type: remote::model-context-protocol
config: {}
metadata_store:
type: sqlite
db_path: ${STORAGE_MOUNT_PATH}/sqlite/registry.db
type: postgres
host: ${env.LLAMA_STACK_POSTGRES_HOST}
port: ${env.LLAMA_STACK_POSTGRES_PORT}
db: ${env.LLAMA_STACK_POSTGRES_NAME}
user: ${env.LLAMA_STACK_POSTGRES_USER}
password: ${env.LLAMA_STACK_POSTGRES_PASSWORD}
table_name: llamastack_kvstore
inference_store:
type: sqlite
db_path: ${STORAGE_MOUNT_PATH}/sqlite/inference_store.db
type: postgres
host: ${env.LLAMA_STACK_POSTGRES_HOST}
port: ${env.LLAMA_STACK_POSTGRES_PORT}
db: ${env.LLAMA_STACK_POSTGRES_NAME}
user: ${env.LLAMA_STACK_POSTGRES_USER}
password: ${env.LLAMA_STACK_POSTGRES_PASSWORD}
models:
- metadata: {}
model_id: ${LLAMA_STACK_DEFAULT_MODEL}
Expand Down Expand Up @@ -335,6 +354,37 @@ objects:
value: ${LLAMA_STACK_OTEL_SERVICE_NAME}
- name: LLAMA_STACK_TELEMETRY_SINKS
value: ${LLAMA_STACK_TELEMETRY_SINKS}
- name: LLAMA_STACK_POSTGRES_HOST
valueFrom:
secretKeyRef:
name: ${LLAMA_STACK_DB_SECRET_NAME}
key: db.host
- name: LLAMA_STACK_POSTGRES_PORT
valueFrom:
secretKeyRef:
name: ${LLAMA_STACK_DB_SECRET_NAME}
key: db.port
- name: LLAMA_STACK_POSTGRES_NAME
valueFrom:
secretKeyRef:
name: ${LLAMA_STACK_DB_SECRET_NAME}
key: db.name
- name: LLAMA_STACK_POSTGRES_USER
valueFrom:
secretKeyRef:
name: ${LLAMA_STACK_DB_SECRET_NAME}
key: db.user
- name: LLAMA_STACK_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: ${LLAMA_STACK_DB_SECRET_NAME}
key: db.password
- name: LLAMA_STACK_POSTGRES_CA_CERT
valueFrom:
secretKeyRef:
name: ${LLAMA_STACK_DB_SECRET_NAME}
key: db.ca_cert
optional: true
resources:
limits:
memory: ${MEMORY_LIMIT}
Expand Down