feat!: providers use unified 'persistence' field

BREAKING CHANGE: Provider config field names changed for semantic clarity

- Rename kvstore → persistence for all providers
- Simple providers: flat persistence with backend reference
- Complex providers (agents): nested persistence.agent_state + persistence.responses
- Files provider: metadata_store → persistence
- Provider configs now clearly express 'how do I persist?' not 'what type of store?'

Example:
  # Before
  config:
    kvstore:
      backend: kvstore
      namespace: faiss

  # After
  config:
    persistence:
      backend: kvstore
      namespace: faiss

  # Agents (nested)
  config:
    persistence:
      agent_state:
        backend: kvstore
        namespace: agents
      responses:
        backend: sqlstore
        namespace: responses
This commit is contained in:
Ashwin Bharambe 2025-10-05 20:33:03 -07:00
parent 490110eba2
commit ea233c2134
34 changed files with 126 additions and 106 deletions

View file

@ -94,29 +94,29 @@ providers:
- provider_id: faiss
provider_type: inline::faiss
config:
kvstore:
backend: default
persistence:
backend: kvstore
namespace: faiss
- provider_id: sqlite-vec
provider_type: inline::sqlite-vec
config:
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/sqlite_vec.db
kvstore:
backend: default
persistence:
backend: kvstore
namespace: sqlite_vec
- provider_id: ${env.MILVUS_URL:+milvus}
provider_type: inline::milvus
config:
db_path: ${env.MILVUS_DB_PATH:=~/.llama/distributions/ci-tests}/milvus.db
kvstore:
backend: default
persistence:
backend: kvstore
namespace: milvus
- provider_id: ${env.CHROMADB_URL:+chromadb}
provider_type: remote::chromadb
config:
url: ${env.CHROMADB_URL:=}
kvstore:
backend: default
persistence:
backend: kvstore
namespace: chromadb
- provider_id: ${env.PGVECTOR_DB:+pgvector}
provider_type: remote::pgvector
@ -126,16 +126,16 @@ providers:
db: ${env.PGVECTOR_DB:=}
user: ${env.PGVECTOR_USER:=}
password: ${env.PGVECTOR_PASSWORD:=}
kvstore:
backend: default
persistence:
backend: kvstore
namespace: pgvector
files:
- provider_id: meta-reference-files
provider_type: inline::localfs
config:
storage_dir: ${env.FILES_STORAGE_DIR:=~/.llama/distributions/ci-tests/files}
metadata_store:
backend: default
persistence:
backend: sqlstore
namespace: files
safety:
- provider_id: llama-guard
@ -148,12 +148,13 @@ providers:
- provider_id: meta-reference
provider_type: inline::meta-reference
config:
persistence_store:
backend: default
namespace: agents
responses_store:
backend: default
namespace: responses
persistence:
agent_state:
backend: kvstore
namespace: agents
responses:
backend: sqlstore
namespace: responses
telemetry:
- provider_id: meta-reference
provider_type: inline::meta-reference
@ -171,21 +172,21 @@ providers:
- provider_id: meta-reference
provider_type: inline::meta-reference
config:
kvstore:
backend: default
persistence:
backend: kvstore
namespace: eval
datasetio:
- provider_id: huggingface
provider_type: remote::huggingface
config:
kvstore:
backend: default
persistence:
backend: kvstore
namespace: huggingface
- provider_id: localfs
provider_type: inline::localfs
config:
kvstore:
backend: default
persistence:
backend: kvstore
namespace: localfs_datasetio
scoring:
- provider_id: basic
@ -215,19 +216,22 @@ providers:
- provider_id: reference
provider_type: inline::reference
config:
kvstore:
backend: default
persistence:
backend: kvstore
namespace: batches
persistence:
backends:
default:
kvstore:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/store.db
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/kvstore.db
sqlstore:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/ci-tests}/sqlstore.db
stores:
metadata:
backend: default
backend: kvstore
inference:
backend: default
backend: sqlstore
models: []
shields:
- shield_id: llama-guard

View file

@ -73,7 +73,14 @@ providers:
provider_type: remote::model-context-protocol
persistence:
backends:
default:
kvstore:
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}
sqlstore:
type: postgres
host: ${env.POSTGRES_HOST:=localhost}
port: ${env.POSTGRES_PORT:=5432}
@ -82,9 +89,9 @@ persistence:
password: ${env.POSTGRES_PASSWORD:=llamastack}
stores:
metadata:
backend: default
backend: kvstore
inference:
backend: default
backend: sqlstore
models:
- metadata: {}
model_id: ${env.INFERENCE_MODEL}

View file

@ -220,14 +220,17 @@ providers:
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/starter}/batches.db
persistence:
backends:
default:
kvstore:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/starter}/store.db
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/starter}/kvstore.db
sqlstore:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/starter}/sqlstore.db
stores:
metadata:
backend: default
backend: kvstore
inference:
backend: default
backend: sqlstore
models: []
shields:
- shield_id: llama-guard

View file

@ -105,14 +105,17 @@ providers:
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/watsonx}/files_metadata.db
persistence:
backends:
default:
kvstore:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/watsonx}/store.db
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/watsonx}/kvstore.db
sqlstore:
type: sqlite
db_path: ${env.SQLITE_STORE_DIR:=~/.llama/distributions/watsonx}/sqlstore.db
stores:
metadata:
backend: default
backend: kvstore
inference:
backend: default
backend: sqlstore
models:
- metadata: {}
model_id: meta-llama/llama-3-3-70b-instruct