UCloud logo UCloud logo UCloud
v2026.7.0-k8s.18
  1. UCloud/Core
  2. 1. Introduction
  3. 2. Projects
  4. 3. API Tokens
    1. 3.1. Platform API Tokens
    2. 3.2. Provider API Tokens
  5. 4. Accounting
  6. 5. Orchestration
  7. 6. Frontend
  8. UCloud/IM for Slurm-based HPC
  9. 7. Installation
  10. 8. Architecture and Networking
  11. 9. User and Project Management
  12. 10. Filesystem Integration
    1. 10.1. Inter-provider file transfers
  13. 11. Slurm Integration
    1. 11.1. Application Management
    2. 11.2. Built-in Applications
  14. 12. Reference
    1. 12.1. Configuration
    2. 12.2. CLI
  15. 13. Appendix
    1. 13.1. Built-in Application Index
  16. UCloud/IM for Kubernetes
  17. 14. Installation
  18. 15. Architecture and Networking
  19. 16. Filesystem Integration
  20. 17. Compute Jobs
    1. 17.1. Networks
    2. 17.2. Public Links
    3. 17.3. Public IPs
    4. 17.4. License Servers
    5. 17.5. SSH Servers
    6. 17.6. Job Audit Log
    7. 17.7. Virtual machines
  21. 18. AI Inference
    1. 18.1. Architecture
    2. 18.2. Chat Middleware
    3. 18.3. Chat Playground
    4. 18.4. Model Discovery and Catalog
    5. 18.5. Dynamo Deployments
    6. 18.6. Usage and Accounting
    7. 18.7. Audit
    8. 18.8. Metrics
    9. 18.9. Security
  22. 19. Integrated applications
    1. 19.1. Syncthing
    2. 19.2. Integrated terminal
    3. 19.3. Kubernetes clusters
      1. 19.3.1. Architecture
      2. 19.3.2. Stacks
      3. 19.3.3. Creating a cluster
      4. 19.3.4. Cluster dashboard
      5. 19.3.5. Networking and storage
      6. 19.3.6. Maintenance and upgrades
      7. 19.3.7. Backup and recovery
      8. 19.3.8. Reference
  23. 20. UCX applications
    1. 20.1. Hello world
    2. 20.2. Data binding
    3. 20.3. UI events
    4. 20.4. Component reference
    5. 20.5. API reference
  24. 21. Reference
    1. 21.1. Configuration
    2. 21.2. CLI
  25. Style guidelines
  26. 22. Branding and identity for UCloud
  27. 23. Documentation
  28. H: Procedures
  29. 24. H: Procedures
  30. 25. H: Introduction
  31. 26. H: Auditing
  32. 27. H: Auditing scenario
  33. 28. H: GitHub actions
  34. 29. H: Deployment
  35. 30. H: 3rd party dependencies (risk assesment)
  36. Glossary
  37. 31. Glossary
  1. Links
  2. Source Code
  3. Releases

Architecture

In this article we describe the parts of the inference feature, the public surface, the backends, the lifecycle of one request, the limits, and the stored content.

Components

The feature lives in the Integration Module, and it uses the same storage and accounting systems as the other features.

flowchart TB
    clients["Clients"]:::diagram-external-user-group

    subgraph im["UCloud/IM"]
        middleware["Middleware<br/>Chat"]:::diagram-provider-cog-6-tooth
        playground["Application<br/>Chat playground"]:::diagram-provider-puzzle-piece
        discovery["Model discovery"]:::diagram-provider-magnifying-glass
        catalog["Database<br/>Model catalog"]:::diagram-provider-circle-stack
        drive["Filesystem<br/>Member files"]:::diagram-provider-folder
        observability["Monitoring<br/>Audit and metrics"]:::diagram-provider-document-text
    end

    backend["Backend server<br/>OpenAI compatible"]:::diagram-provider-server

    class im diagram-provider-ucloud

    clients -->|authenticated with API token|middleware
    playground --> middleware
    middleware --> catalog
    middleware --> drive
    middleware --> observability
    middleware --> backend
    discovery --> catalog
    discovery --> backend

The parts of UCloud/IM that serve inference, and the systems they touch. It does not show how a request is handled inside a part.

The components are described below:

ComponentPurpose
Model catalogHolds the model entries in the inference_model table of the Integration Module database.
Model discoveryPolls the backend for models, and creates or refreshes catalog entries.
Chat middlewareServes /v1/chat/completions and the chat call of the playground. It validates the request against the catalog, selects the endpoint, and streams the response.
Chat playgroundA UCX application with threads, attachments, and tools. Threads are stored in the member drive. See Chat Playground.
Provider API tokensTokens with the inference/use permission. Tokens created from the model page expire after 90 days. UCloud/Core creates job-scoped tokens for jobs.
AuditWrites audit records for chat, response, and conversation access.
MetricsExports Prometheus metrics for usage and latency.

Public surface

The Integration Module serves the inference API on the authority hostname. OpenAI clients reach it directly. The playground calls the shared chat middleware internally, without using this public HTTP endpoint.

RoutePurpose
/v1/modelsLists the models that the caller may use.
/v1/models/{name}Reports one model.
/v1/chat/completionsChat, with streaming and tool calls.
/v1/responsesThe Responses API, with /v1/responses/{id} and /v1/responses/{id}/cancel.
/v1/conversations/{id}Response conversations.

The request body must be JSON and it must stay under 16 MB. The chat middleware accepts the fields that the OpenAI-compatible APIs define, including messages, tools, response_format, reasoning_effort, temperature, top_p, and stream. A message may carry text, an image, a video, or audio, depending on the capabilities of the model.

Backends

The provider field selects how the Integration Module finds models and how it validates endpoints.

ProviderUseBehaviour
dynamoProductionDiscovery lists services in the configured namespace whose name ends with -frontend. Every model call must go to an in-cluster service address. See Dynamo Deployments.
developmentDevelopmentOne OpenAI-compatible backend, taken from development.server. A request must match that URL exactly, including the scheme, the host, and the path.

In development mode, development.provider: localai makes the Integration Module start a LocalAI backend and apply a small fallback model. Tools are disabled for that backend.

Request lifecycle

flowchart TB
    request["Request<br/>Chat, Responses, or playground"]:::diagram-external-chat-bubble-left-right
    admission["Capacity check<br/>Admission control"]:::diagram-provider-cog-6-tooth
    catalog["Catalog lookup<br/>Validation | visibility | price | options"]:::diagram-provider-circle-stack
    backend["Backend call<br/>Streaming to the client"]:::diagram-provider-server
    usage["Accounting<br/>Usage and billing | Credits"]:::diagram-external-calculator
    audit["Request record<br/>Audit"]:::diagram-provider-document-text

    request --> catalog
    catalog --> admission
    catalog -.-> audit
    admission --> audit
    admission --> backend
    backend --> usage
    backend -.-> audit

What happens to one inference request, step by step. It does not show the retries; see Reporting and retries.

  1. The Integration Module identifies the caller through API authentication or the playground session.
  2. The catalog lookup finds the model, checks access, reads the price, and validates the request options.
  3. Admission control checks capacity. When capacity is full, the request waits for capacity, cancellation, or the admission timeout.
  4. The Integration Module calls the backend endpoint of the model, and it relays the stream to the client.
  5. The Integration Module reports the token usage to the accounting system. The price of the model decides the cost.
  6. The Integration Module writes an audit record for the request.

Limits

LimitValue
Concurrent requests, all owners4096
Concurrent requests, one authenticated user64
Admission queue wait60 seconds
Request timeout30 minutes
Request body16 MB
Chat choices per request (n)8
Completion tokensThe limit of the model

Admission control uses the wallet owner as the limit key when the request has no authenticated username.

Storage

All persisted chat content lives in the member drive, next to the files that the user or the project already has. This includes messages, attachments, and stored responses, not catalog or accounting metadata. A user can inspect, back up, or delete this content with ordinary file operations.

<member drive>
└── Inference
    ├── Attachments
    │   └── <attachment id>
    ├── Chats
    │   └── 2026
    │       └── 10
    │           └── 19
    │               └── 20261019T073000.000Z-<thread id>.json
    └── Resources
        ├── Conversations
        │   └── <conversation id>.json
        └── Responses
            └── <response id>.json
  • Chats holds one JSON file per playground thread. The store partitions the files by the UTC creation date of the thread, so the directory does not grow flat. These threads live until the user manually deletes them.
  • Attachments holds one file per request attachment, up to 64 MB, and a converted Markdown copy when the request needs one. The Integration Module removes an attachment after 60 minutes without activity. A backend reads an attachment through a temporary download link, backed by a secure token.
  • Resources holds the state of the Responses API. The periodic drive scan deletes response and conversation files whose modification time is at least 30 days old.
Previous AI Inference
Next Chat Middleware