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

Chat Playground

The chat playground is a UCX application in the web interface, at /app/inference/playground. It is a chat client with threads, attachments, and tools.

The playground calls the chat middleware of the Integration Module directly, so a chat in the playground uses the same models, the same prices, and the same limits as a call to the API.

flowchart TB
    browser["Browser<br/>Chat page"]:::diagram-external-window

    subgraph im["UCloud/IM"]
        playground["Application<br/>Chat playground"]:::diagram-provider-puzzle-piece
        middleware["Middleware<br/>Chat"]:::diagram-provider-cog-6-tooth
        files["Filesystem<br/>Member files"]:::diagram-provider-folder
        sandbox["Inference sandbox<br/>bash and web fetch"]:::diagram-provider-cube
    end

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

    class im diagram-provider-ucloud

    browser -->|"chat, attachments"| playground
    playground -->|"chat call"| middleware
    playground -->|"threads, attachments"| files
    playground -->|"tool calls"| sandbox
    middleware -->|"chat requests"| backend
    backend -.->|"media download"| files

How a chat in the playground reaches a model, and where the threads, the attachments, and the tools live. The backend reads an image, a video, or an audio file through the download link. It does not show the steps inside the chat middleware.

The playground keeps its content in the member drive, as files of the user or of the project. See Storage for the layout of the files.

Threads

A thread is one conversation: a title, the messages, the model, and the token usage. A thread also remembers whether the inference sandbox may use the internet.

The playground creates a thread when the user sends the first message, and it holds the thread in memory while the browser session is open. It writes the thread to the member drive at most every five seconds while the session is open, and once when the session ends. A write replaces the file of the thread.

A thread holds at most 8 MB of JSON, and the title is cut at 80 characters. A user can delete a thread, and the platform then removes its file. Threads stay until the user deletes them.

Attachments

A user can add a file to a message. The playground sends the file in chunks of at most 8 MB, and the file must stay under 64 MB. A copy stays in the member drive, so that the user and the model can read it again later.

ContentHow it reaches the model
TextThe playground puts the text into the prompt, in an attachment block that names the file. A text attachment must stay under 128 KB.
Image, video, audioThe file becomes a message part with a URL, and the model reads it through the download link.
A documentThe playground converts the file to Markdown, and the Markdown becomes the text of the message.

The playground converts the formats PDF, PowerPoint, Word, Excel, EPUB, and ZIP. A conversion runs as a background task on the Kubernetes cluster of the provider, with a limit of 120 seconds. The playground stops waiting after 125 seconds, and it reports an error when the task does not finish.

A backend reads an image, a video, or an audio file through a download link with an unguessable token, because a backend has no UCloud credentials. The link works while the file stays in the member drive.

The platform removes an attachment after 60 minutes without activity, and a user can delete an attachment earlier. The cleanup runs every 15 minutes, and it removes the Markdown copy of a converted document too.

Tools

The playground offers these tools to a model:

ToolPurpose
bashRuns one non-interactive shell command, for example a calculation. The command starts in /.
web_fetchReads one public URL, or one document from the sandbox cache. A cached document expires after 10 minutes.
request_internet_accessAsks the user for internet access for the thread.

A thread has no internet access until the user grants it. When the user grants the request, the sandbox receives internet access, and the playground remembers the answer on the thread.

A shell command runs for 60 seconds by default and for 2 minutes at most. A web fetch has 15 seconds by default and 30 seconds at most.

The playground gives the model at most ten rounds of tool calls in one turn. It then asks for a final answer without tools. An answer can carry a large tool result. When the conversation approaches the context window of the model, the playground replaces an old result with a short note that the output is omitted, and it cuts the text of an error at 512 characters.

The inference sandbox

UCloud/IM runs the sandbox as a job on the Kubernetes cluster of the provider. It starts the sandbox on demand, and it stops the sandbox after 15 minutes without a call. Each user and each project has its own sandbox, and the sandbox belongs to the wallet of the playground session.

The sandbox does not mount a drive of the workspace, so a tool cannot read the files of the user. The platform mounts the tools in a read-only directory at /mnt/exe. Files that a tool writes stay in the sandbox, and the platform removes them with the sandbox.

The sandbox always reaches the cluster DNS. It reaches the internet on the ports 80 and 443 after the user grants access. The grant covers the sandbox, so it applies to every thread of the same workspace.

A provider can turn the tools off for a model with chatSettings.disableTools. See Values applied by discovery.

Previous Chat Middleware
Next Model Discovery and Catalog