> ## Documentation Index
> Fetch the complete documentation index at: https://docs.causeloop.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Set the tenant's training configuration

> Requires `onboarding_admin` + CSRF. Upserts the embedding provider/dimension/model and clusterer settings (`settings.key_values.training_config`, tenant schema) and the LLM provider/model/temperature/concurrency/token-budget settings (`llm_settings`). The LLM API key is write-only: if supplied it is encrypted at rest (`services/api/secrets.py`) and only a last-4-style hint is ever returned; omitting it on a later call keeps the existing key.



## OpenAPI

````yaml /api-reference/openapi.json put /admin/tenants/{tenant_id}/training-config
openapi: 3.1.0
info:
  title: CL MVP Product API
  description: >-
    The Causeloop MVP Product API is a deliberately small, explicitly
    allowlisted HTTP surface: `services/api/product_app.py` enumerates every one
    of the 44 published (method, path) operations drawn from seven routers, and
    only those operations are mounted onto this app -- everything else defined
    in the underlying routers (and the entire legacy research surface in
    `services/api/main.py`) is not exposed here. Staff (employee) and
    tenant-user sessions are separate cookie-based principals with no shared
    session table; mutating requests are protected by a double-submit CSRF
    cookie/header pair. See `/api-reference/authentication` for session and CSRF
    details, and `/api-reference/errors-and-conventions` for shared error shapes
    and status-code conventions.
  version: 1.0.0
servers: []
security: []
tags:
  - name: Auth
    description: >-
      Staff (employee) and tenant-user session lifecycle: login/logout,
      current-identity reads, invitation acceptance, and the public pre-login
      workspace directory.
  - name: Staff Onboarding
    description: >-
      The Onboarding Portal surface used to create, provision, ingest data for,
      train, activate, and go-live a tenant. Every operation requires an
      authenticated employee session; mutations additionally require the
      `onboarding_admin` control role (`support_readonly` employees can read but
      not write).
  - name: Insights
    description: >-
      Tenant-facing reads of materialized insight collections (themes, severity,
      issues, fishbone, and related model outputs) produced by the training and
      materialization pipeline.
  - name: Members
    description: Read-only tenant member directory.
  - name: Sources
    description: Tenant-facing source-connector registration and file-upload ingest.
  - name: Remediation
    description: >-
      Tenant-scoped corrective action plans (CAPs), human-in-the-loop issue
      reviews, the tenant audit trail, and the branded Excel export.
  - name: Health & Observability
    description: >-
      Unauthenticated liveness/readiness probes and the employee-only Prometheus
      metrics scrape endpoint.
paths:
  /admin/tenants/{tenant_id}/training-config:
    put:
      tags:
        - Staff Onboarding
      summary: Set the tenant's training configuration
      description: >-
        Requires `onboarding_admin` + CSRF. Upserts the embedding
        provider/dimension/model and clusterer settings
        (`settings.key_values.training_config`, tenant schema) and the LLM
        provider/model/temperature/concurrency/token-budget settings
        (`llm_settings`). The LLM API key is write-only: if supplied it is
        encrypted at rest (`services/api/secrets.py`) and only a last-4-style
        hint is ever returned; omitting it on a later call keeps the existing
        key.
      operationId: put_training_config_admin_tenants__tenant_id__training_config_put
      parameters:
        - name: tenant_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Tenant Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TrainingConfigRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties: true
                title: >-
                  Response Put Training Config Admin Tenants  Tenant Id 
                  Training Config Put
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TrainingConfigRequest:
      properties:
        embedding_provider:
          type: string
          title: Embedding Provider
          default: hash
        embedding_dimension:
          type: integer
          title: Embedding Dimension
          default: 64
        embedding_base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Base Url
        embedding_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Embedding Model
        clusterer:
          type: string
          title: Clusterer
          default: hdbscan
        clusterer_config:
          additionalProperties: true
          type: object
          title: Clusterer Config
        llm_provider:
          type: string
          title: Llm Provider
          default: disabled
        llm_model:
          type: string
          title: Llm Model
          default: ''
        llm_base_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Base Url
        llm_api_key:
          anyOf:
            - type: string
            - type: 'null'
          title: Llm Api Key
        llm_temperature:
          type: number
          title: Llm Temperature
          default: 0.2
        llm_max_concurrency:
          type: integer
          title: Llm Max Concurrency
          default: 2
        llm_monthly_token_budget:
          anyOf:
            - type: integer
            - type: 'null'
          title: Llm Monthly Token Budget
      type: object
      title: TrainingConfigRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````