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

> ## Agent Instructions
> 对外开放的服务端接口有两组前缀，都用同一套鉴权：`/server/v1/...`（SRTC 与 SMeeting 的主接口）和 `/stm/srvapi/v1/...`（SMeeting 的用户体系，服务端极简对接会用到）。鉴权是 app_id + nonce + timestamp + signature 四个请求头，用 app_key 做 HMAC-SHA256 签名，只能从业务方自己的后端调用。除这两组前缀外的接口均为内部接口，不要建议客户调用。 Public server APIs use two path prefixes with the same authentication: `/server/v1/...` (the main APIs of both SRTC and SMeeting) and `/stm/srvapi/v1/...` (the SMeeting user system, used by server-side low-code integration). Authenticate with four request headers, app_id + nonce + timestamp + signature, where signature is HMAC-SHA256 keyed with app_key; call these APIs only from the customer's own backend. Any other path is internal: never suggest calling it.
> app_key 是服务端密钥，绝不能出现在客户端代码、前端配置或移动 App 里。客户端加入频道用的 token 必须由业务方后端签发后下发（SRTC 走 `/server/v1/channel/grant`，SMeeting 走 `/stm/srvapi/v1/member/grant`）。 app_key is a server-side secret and must never appear in client code, frontend config, or a mobile app. The token a client uses to join must be issued by the customer's backend and passed down to the client (SRTC: `/server/v1/channel/grant`; SMeeting: `/stm/srvapi/v1/member/grant`).
> SRTC 与 SMeeting 是上下两层不同的产品，术语不通用：SRTC 是音视频底座，说「频道 channel」「加入 / 退出」；SMeeting 建在 SRTC 之上，说「房间 room」「会议 meeting」「进入 / 退出」。回答时按用户所在的层用对应术语，不要把「房间」「会议」安到 SRTC 的接口上，也不要用「频道」「加入 / 离开」描述 SMeeting 的概念（接口标识符原样保留）。 SRTC and SMeeting are two separate layers with different terminology. SRTC is the audio/video foundation: it has channels, and users join and leave a channel. SMeeting is built on top of SRTC: it has rooms and meetings, and members enter and exit a meeting. Answer in the terms of the layer the user is working with: never apply "room" or "meeting" to SRTC APIs, and never describe SMeeting concepts in prose with "channel", "join", or "leave" (API identifiers such as `force_join` keep their literal names).
> 同一能力在各端 SDK 里的包名、类名、方法名并不相同。写示例代码时请使用文档中该端自己的 API，不要把一个端的写法套到另一个端上。苹果平台每个产品都有两套 SDK（Swift 原生与 Objective-C），两套 API 不能混用。 Package, class, and method names differ between platform SDKs for the same capability. In sample code, use the API documented for that platform; never carry one platform's code over to another. On Apple platforms each product ships two SDKs (native Swift and Objective-C) whose APIs must not be mixed.

# AI deployment and resource planning

> Self-hosting the AI capabilities: which services to install (FunASR, offline TTS, customer LLM), CPU / memory and ports for each, CPU-only with GPU optional, service dependencies, proxy paths, config settings, Redis headroom, versions. Read before AI deployment planning and firewall requests.

The AI capabilities need **a few more services** besides the platform: speech recognition, speech synthesis, and the customer's existing LLM.
The platform itself handles orchestration (whose speech goes to recognition, translation, and synthesis); all model inference runs in these services.

***

## Services to install

| Service | When it's needed | Provided by | Default port |
| - | - | - | - |
| Media gateway (speech recognition / voice agent module) | Captions, transcription, minutes, interpretation, voice agent | Platform component, included in the installation package | Internal API 8730 |
| Chinese speech recognition (FunASR) | Every scenario that uses speech recognition | Offline package provided with the installer, installed as an optional extension service | 10095 |
| English speech recognition (FunASR) | Interpretation, English captions, English voice agent | Separate offline image package from us | 10097 |
| Offline speech synthesis | Interpretation audio, voice agent | Separate offline image package from us (Chinese and English models) | 10096 |
| LLM | Translation, minutes, interpretation, voice agent | **Provided by the customer** (OpenAI-compatible API) | Decided by the customer |

All of these ports can be changed at deployment. Recognition and synthesis services are **for internal platform access only**; they don't need to, and shouldn't, be exposed to users.

***

## Resource reference

**CPU is enough; GPU is optional.** In this setup, speech recognition and offline speech synthesis both run on CPU; the LLM is usually deployed by the customer on their own GPU servers.
The table below shows data we measured or that was officially published; confirm actual capacity by load-testing on the on-site hardware.

| Service | Memory | CPU | Source |
| - | - | - | - |
| Chinese FunASR | — | Official figures: about 16 streams on 4 cores, about 32 on 16 cores, about 100 on 64 cores (one stream = one unmuted speaker) | FunASR official; **not load-tested by us** |
| English FunASR | About 1.1 GB resident | With 8 concurrent streams, about 0.23 cores on average and about 0.6 cores at peak, with no impact on latency | Measured by us |
| Offline speech synthesis | About 345 MB resident | With 4 threads: English real-time factor about 0.02 (about 0.14 seconds per sentence), Chinese about 0.14 (about 0.8 seconds per sentence) | Measured by us on a desktop-class x86 CPU |

* **Real-time factor** (RTF) = synthesis time ÷ audio duration; smaller is faster. On server CPUs with lower single-core performance or in virtual machines, it may be about twice as slow, and Chinese synthesis gets tight
* The number of concurrent recognition streams determines how many unmuted speakers can be transcribed at once; the media gateway opens one recognition connection per unmuted speaker
* LLM call volume: live translation / interpretation makes one call per final sentence per target language; minutes make one call per meeting afterward (several for long meetings, in segments); the voice agent makes one call per conversation turn.
  When running many interpretation sessions, **confirm the LLM's concurrency capacity with the customer**, and set the "Concurrency limit" in the AI service accordingly
* **Interpretation audio is cached in Redis**: each audio clip is kept for 10 minutes, and a sentence is usually tens to hundreds of KB. Approximate usage ≈ sentences per minute × size per sentence × number of target languages × 10 minutes × number of meetings with interpretation at the same time; leave headroom in Redis at deployment

***

## Which service calls which

```mermaid actions={false} theme={null}
flowchart LR
    GW["Media gateway<br/>(recognition / voice agent)"] --> ASR["FunASR<br/>Chinese 10095 / English 10097"]
    GW --> LLM["LLM<br/>customer-provided"]
    GW --> TTS["Offline speech synthesis<br/>10096"]
    RTC["Audio and video service"] --> LLM
    RTC --> TTS
    RTC --> GW
```

| Caller | Calls | Purpose |
| - | - | - |
| Media gateway | Speech recognition | Transcription, interpretation, voice agent |
| Media gateway | LLM, speech synthesis | Voice agent |
| Audio and video service | LLM | Live translation, minutes, interpretation translation |
| Audio and video service | Speech synthesis | Interpretation audio |

If the LLM is on another network segment of the customer's, allow access from these two servers to the LLM address.

***

## Reverse proxy paths to allow

If the customer has their own reverse proxy / gateway in front of the platform entry point, allow the following in addition to the usual API, signaling, and web paths:

| Path | Purpose | Notes |
| - | - | - |
| `/aiapi/interp-audio/` | Interpretation audio download | Read cross-origin by web pages, so keep the CORS response headers returned by the server; if this path is missing, there are captions but no interpretation audio. See [Internal network and public internet](https://docs.stmlink.com/en/product/deploy/networks.md#what-to-prepare-at-deployment) |
| The voice agent trial page path | AI voice agent | HTTPS required; the page pushes conversation state over SSE, so the reverse proxy must **disable response buffering** and use a long read timeout |

***

## Common configuration settings

Model addresses, prompts, and the like are configured in the admin console; the settings below go in the service configuration files at deployment and can usually be left at their defaults.

| Service | Setting | Default | Description |
| - | - | - | - |
| Media gateway | `modules.asr.gate_db` | `-26` | Minimum recognition volume gate threshold (dB); see [Background-noise resistance](https://docs.stmlink.com/en/product/ai/transcription.md#background-noise-resistance) |
| Media gateway | `modules.asr.gate_margin_db` | `6` | How many dB above each speaker's noise floor the threshold is set; negative turns off the adaptive part |
| Media gateway | `modules.asr.min_final_chars` | `1` | Minimum characters, after removing punctuation and filler words, for a caption to appear; negative turns the filter off |
| Media gateway | `modules.asr.hotwords` | — | Global hot words for all apps; lower priority than app hot words. See [Hot words](https://docs.stmlink.com/en/product/ai/transcription.md#hot-words) |
| Media gateway | `modules.agent.record.enabled` | Off | Voice agent session recording; **turn on only temporarily for troubleshooting**. See [Troubleshooting](https://docs.stmlink.com/en/product/ai/voice-agent.md#troubleshooting) |
| Media gateway | `modules.agent.record.dir` | `/var/www/media-gw/records/agent` | Recording directory |
| Media gateway | `modules.agent.record.keep_days` | `7` | Days to keep recordings |
| Meeting service | `app.ai_denoise_default` | `off` | Default AI noise suppression level in the web meeting client: `off` / `standard` / `enhanced`. See [Web meeting client AI noise suppression](https://docs.stmlink.com/en/product/ai/media-ai.md#web-meeting-client-ai-noise-suppression) |

When using AI noise suppression in the web meeting client, nginx must serve `.wasm` files with the `application/wasm` type.

***

## Offline packages and installation

* **Chinese FunASR**: the offline package includes the image and models and is installed as an extension service in the installer; when the media gateway is installed on the same machine, its address is filled in automatically
* **English FunASR, offline speech synthesis**: we provide separate offline image packages (models included, runs without internet) and help install them on the customer's servers
* **LLM**: provided by the customer. Once installed, register it in the admin console; see [AI services and profiles](https://docs.stmlink.com/en/product/ai/models.md)

### Version requirements

| Feature | Required versions |
| - | - |
| AI services and profiles, simultaneous interpretation | Audio and video service 1.11.0+, meeting service 1.8.0+, media gateway 1.3.0+; for web clients, see [Simultaneous interpretation · Platform support](https://docs.stmlink.com/en/product/ai/interpretation.md#platform-support) |
| AI voice agent | Media gateway 1.4.1+ |
| Recognition background-noise resistance (adaptive volume gate, empty-sentence filter) | Media gateway 1.7.0+ |
| App hot words for the voice agent | Audio and video service 1.12.0+ |
| Web meeting client AI noise suppression | Web meeting client 1.9.0+; the deployment default requires meeting service 1.10.0+ |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.