# Fish Speech S2 Pro high-concurrency single-GPU deploy config.
#
# Stage0 SlowAR and Stage1 DAC share GPU0. This config keeps the optimized
# Fish runtime path explicit instead of changing the default
# fish_qwen3_omni.yaml deployment.
async_chunk: true
enable_chunked_prefill: false

connectors:
  connector_of_shared_memory:
    name: SharedMemoryConnector
    extra:
      shm_threshold_bytes: 65536
      codec_streaming: true
      connector_get_sleep_s: 0.001
      connector_get_max_wait_first_chunk: 3000
      connector_get_max_wait: 300
      fish_speech_tensor_codes: true
      fish_speech_single_initial_chunk: true
      fish_speech_backlog_codec_chunk_frames: 50
      fish_speech_backlog_load_threshold: 0.75
      codec_chunk_frames: 25
      codec_left_context_frames: 25
      initial_codec_chunk_frames: 4
      fish_speech_dac_dtype: fp16
      fish_speech_dac_max_padded_frames: 256
      fish_speech_dac_max_batch: 0

stages:
  - stage_id: 0
    max_num_seqs: 64
    gpu_memory_utilization: 0.72
    enforce_eager: false
    trust_remote_code: true
    enable_prefix_caching: false
    async_scheduling: false
    max_num_batched_tokens: 16384
    max_model_len: 16384
    devices: "0"
    output_connectors:
      to_stage_1: connector_of_shared_memory
    default_sampling_params:
      temperature: 0.8
      top_k: 30
      top_p: 0.9
      max_tokens: 2048
      seed: 42
      repetition_penalty: 1.0

  - stage_id: 1
    max_num_seqs: 64
    gpu_memory_utilization: 0.18
    enforce_eager: true
    trust_remote_code: true
    enable_prefix_caching: false
    async_scheduling: false
    max_num_batched_tokens: 16384
    max_model_len: 16384
    devices: "0"
    input_connectors:
      from_stage_0: connector_of_shared_memory
    default_sampling_params:
      temperature: 0.0
      top_p: 1.0
      top_k: -1
      max_tokens: 65536
      seed: 42
      repetition_penalty: 1.0
