Project files

Configure

Use the side menu to jump: a short worked example, then every common YAML field for preset/catalog, runtime config, and env.

Overview & example

Required: qllm.preset.yaml + qllm.catalog.yaml. Optional: qllm.config.yaml, qllm.env.yaml, qllm.access.yaml. Secrets are names of env vars (*Env), never the secret text in YAML.

my-project/
  qllm.preset.yaml
  qllm.catalog.yaml
  qllm.config.yaml    # optional
  qllm.env.yaml       # optional (local)
  qllm.access.yaml    # optional (per-app keys)
./qllm validate --config-dir ./my-project
./qllm serve --http --config-dir ./my-project

Worked example: warehouse DB + stock API

Postgres holds product master data; a REST inventory service exposes GET /v1/stock. You only publish the fields the agent may see.

# qllm.preset.yaml (excerpt)
protocolVersion: "0.2.0"
project: warehouse
limits:
  maxSyncMs: 15000      # ms  (~15 s total)
  maxSourceMs: 12000    # ms  (~12 s per source)
  defaultLimit: 100     # rows
  maxLimit: 1000        # rows
  readOnly: true
sources:
  - id: warehouse_pg
    type: postgres
    connection:
      hostEnv: QLLM_PG_HOST
      port: 5432
      database: warehouse
      userEnv: QLLM_PG_USER
      passwordEnv: QLLM_PG_PASSWORD
      sslMode: require

  - id: stock_api
    type: rest
    connection:
      baseUrlEnv: QLLM_STOCK_API_BASE
      auth:
        type: bearer
        tokenEnv: QLLM_STOCK_API_TOKEN
    options:
      timeoutMs: 10000   # ms
      resources:
        stock:
          list:
            method: GET
            path: /v1/stock
            queryParams: [sku, warehouse_id, limit, offset]
            itemsKey: data
          getById:
            method: GET
            path: /v1/stock/{sku}
            itemsKey: data
# qllm.catalog.yaml (excerpt)
protocolVersion: "0.2.0"
project: warehouse
entities:
  - name: products
    source: warehouse_pg
    binding: { kind: table, schema: warehouse, table: products }
    fields:
      - { name: sku, physical: sku, type: string }
      - { name: title, physical: title, type: string }
      - { name: weight_kg, physical: weight_kg, type: number }

  - name: stock_levels
    source: stock_api
    binding: { kind: rest_resource, resource: stock }
    fields:
      - { name: sku, physical: sku, type: string }
      - { name: qty, physical: qty, type: number }
      - name: location
        physical: location
        type: json
        shape: "{aisle, bin}"
      - name: tags
        physical: tags
        type: json
        shape: "string[]"
      - name: warehouse_id
        physical: warehouse_id
        type: string
        fromFilter: true
  • json Nested objects/arrays: one top-level field with type: json + optional shape (decision D22). REST does not resolve dotted paths like location.aisle.
  • fromFilter API takes a filter key but omits it in the body → set fromFilter: true (decision D20). Needs a top-level eq or the query is INVALID_IR.
  • itemsKey When the body is { "data": [ … ] }, set itemsKey: data on the REST operation.

Draft helpers: catalog introspect (SQL) and catalog from-openapi (REST). Always review before serve.