{
  "schema_version": "transcribe-intake-v1",
  "family": "moonshine",
  "hf_repo": "UsefulSensors/moonshine-tiny",
  "hf_revision": "390624ed33d594443aa4aa221f5b9f283b545b5a",
  "sources": {
    "config": {
      "kind": "hf_file",
      "path": "config.json",
      "status": "found"
    },
    "preprocessor": {
      "kind": "hf_file",
      "path": "preprocessor_config.json",
      "status": "found"
    },
    "tokenizer_config": {
      "kind": "hf_file",
      "path": "tokenizer_config.json",
      "status": "missing",
      "detail": "no tokenizer_config.json on the repo; tokenizer.json + generation_config.json carry the special-token IDs"
    },
    "tokenizer_json": {
      "kind": "hf_file",
      "path": "tokenizer.json",
      "status": "found"
    },
    "generation_config": {
      "kind": "hf_file",
      "path": "generation_config.json",
      "status": "found"
    },
    "safetensors_metadata": {
      "kind": "hf_api",
      "path": "HfApi.get_safetensors_metadata",
      "status": "found",
      "detail": "header-only floating dtype distribution; no tensor payloads downloaded"
    },
    "model_card": {
      "kind": "hf_api",
      "path": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "status": "found",
      "detail": "language list, capability flags, license (MIT), and LibriSpeech/Common-Voice/Earnings22/etc. WER scores read from the model card"
    },
    "reference_modeling_code": {
      "kind": "reference_code",
      "path": "transformers.models.moonshine (MoonshineForConditionalGeneration, AutoProcessor wrapping Wav2Vec2FeatureExtractor + PreTrainedTokenizerFast); cross-check refs/mlx/mlx-audio/mlx_audio/stt/models/moonshine/",
      "status": "found",
      "detail": "Transformers is the canonical class the HF model card points at (MoonshineForConditionalGeneration). mlx-audio is a clean Python cross-read."
    }
  },
  "variants": [
    {
      "name": "moonshine-tiny",
      "memory_gb": null,
      "files": []
    }
  ],
  "config": {
    "architecture_candidates": [
      "encoder-decoder"
    ],
    "key_fields": {
      "architectures": [
        "MoonshineForConditionalGeneration"
      ],
      "model_type": "moonshine",
      "is_encoder_decoder": true,
      "hidden_size": 288,
      "intermediate_size": 1152,
      "encoder_num_hidden_layers": 6,
      "decoder_num_hidden_layers": 6,
      "encoder_num_attention_heads": 8,
      "decoder_num_attention_heads": 8,
      "encoder_num_key_value_heads": 8,
      "decoder_num_key_value_heads": 8,
      "encoder_hidden_act": "gelu",
      "decoder_hidden_act": "silu",
      "max_position_embeddings": 194,
      "partial_rotary_factor": 0.9,
      "rope_theta": 10000.0,
      "attention_bias": false,
      "pad_head_dim_to_multiple_of": 8,
      "vocab_size": 32768
    },
    "varying_across_variants": [
      "hidden_size",
      "intermediate_size",
      "encoder_num_hidden_layers",
      "decoder_num_hidden_layers",
      "encoder_num_attention_heads",
      "decoder_num_attention_heads"
    ]
  },
  "dtype": {
    "expected": "float32",
    "source": "config",
    "evidence": "config torch_dtype=float32; safetensors header distribution F32=160 (100%)",
    "details": {
      "config_declared": "float32",
      "header_distribution": {
        "F32": 160
      }
    }
  },
  "frontend": {
    "sample_rate": 16000,
    "n_mels": 1,
    "hop_length": null,
    "fft_size": null,
    "window": null,
    "normalization": "none",
    "preemphasis": null,
    "dither": null,
    "center": null,
    "padding_mode": null,
    "mel_filterbank_norm": null
  },
  "tokenizer": {
    "type": "bpe",
    "vocab_size": 32768,
    "special_tokens": {
      "bos": 1,
      "eos": 2,
      "pad": 2,
      "decoder_start": 1
    },
    "has_language_tokens": false,
    "vocab_sha256": "167ef33e0aa23978fd1bfa643785768b75ad36ff247f06d7f3c5e4e506453a80"
  },
  "capabilities": {
    "languages": ["en"],
    "language_detection": false,
    "translation": false,
    "timestamps": [],
    "streaming": false,
    "speaker_diarization": false
  },
  "upstream_benchmarks": [
    {
      "dataset": "LibriSpeech test-clean",
      "language": "en",
      "metric": "wer",
      "score": 4.55,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card."
    },
    {
      "dataset": "LibriSpeech test-other",
      "language": "en",
      "metric": "wer",
      "score": 11.68,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card."
    },
    {
      "dataset": "Common Voice (mean)",
      "language": "en",
      "metric": "wer",
      "score": 12.65,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card; reported as a multi-version Common Voice mean."
    },
    {
      "dataset": "TED-LIUM",
      "language": "en",
      "metric": "wer",
      "score": 5.69,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card."
    },
    {
      "dataset": "GigaSpeech",
      "language": "en",
      "metric": "wer",
      "score": 14.21,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card."
    },
    {
      "dataset": "AMI",
      "language": "en",
      "metric": "wer",
      "score": 22.84,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card."
    },
    {
      "dataset": "Earnings22",
      "language": "en",
      "metric": "wer",
      "score": 20.73,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card."
    },
    {
      "dataset": "SPGISpeech",
      "language": "en",
      "metric": "wer",
      "score": 7.43,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card."
    },
    {
      "dataset": "VoxPopuli",
      "language": "en",
      "metric": "wer",
      "score": 14.11,
      "score_unit": "percent",
      "source": "https://huggingface.co/UsefulSensors/moonshine-tiny",
      "notes": "Model card."
    }
  ],
  "reference_framework": "transformers",
  "reference_rationale": "The UsefulSensors/moonshine-tiny model card demonstrates direct use of `MoonshineForConditionalGeneration` + `AutoProcessor` from mainline `transformers` (no `trust_remote_code`). The Moonshine classes have been first-party in transformers since 4.48 and carry the publisher-maintained generation config, tokenizer, and feature extractor — they are the canonical instrumentable reference. `refs/mlx/mlx-audio/mlx_audio/stt/models/moonshine/` is a useful clean Python cross-read but is not the published entrypoint.",
  "architecture_pattern": "encoder-decoder",
  "known_risks": [
    "Frontend is a learned 3-layer Conv1d stack on raw 16 kHz waveform — no STFT, no log-mel, no normalization. Conv1: kernel 127, stride 64, no bias, then tanh + GroupNorm(num_groups=1). Conv2: kernel 7, stride 3, GELU. Conv3: kernel 3, stride 2, GELU. Total temporal stride 64*3*2 = 384, so encoder seq_len ≈ floor((audio_samples - 127)/64 - 6)/3 - 2)/2 with no padding. This is novel for our pipeline (whisper/parakeet/cohere/qwen3 all consume mel) and Gate A's frontend cross-check will see feature_size=1 from the Wav2Vec2FeatureExtractor — that is the conv input channel, not a mel bin count.",
    "Variable-length input: unlike whisper's pad-or-trim to 30s, moonshine processes raw audio of arbitrary duration directly. The HF AutoProcessor right-pads with 0.0 across a batch but does not enforce a fixed input length. `max_position_embeddings=194` constrains the decoder's output context, not the encoder.",
    "Partial RoPE: `partial_rotary_factor=0.9` rotates only the first int(head_dim * 0.9) dims (rounded to even) and leaves the trailing dims unrotated. Applied to encoder self-attn AND decoder self-attn; cross-attn is not rotated (encoder K/V is computed once and cached, no position_ids). Cohere also uses partial RoPE — borrow patterns from `src/arch/cohere/`.",
    "Encoder MLP and decoder MLP are different shapes. Encoder uses GELU (fc1: hidden→inter, fc2: inter→hidden). Decoder uses SwiGLU (fc1: hidden→2*inter, split into [x, gate], fc2(silu(gate) * x): inter→hidden). Two distinct MLP code paths in one model.",
    "Tied word embeddings: `tie_word_embeddings=true` (per MLX config default; HF config does not override). `decoder.embed_tokens` is reused as `proj_out`; there is no separate `lm_head` weight in the safetensors. Converter must not duplicate the tensor.",
    "Cross-attention KV cache differs from self-attention cache: cross-attn K/V is computed once from encoder_hidden_states and reused unchanged across all decoder steps; self-attn K/V grows by one each step. Cache management must distinguish the two.",
    "Hallucination throttling: model card warns the model can generate text not present in audio, especially on short clips, and recommends throttling to 6.5 tokens/s plus EOS-based termination. Reference generation respects EOS and `generation_config.max_length=194`. Acceptance / WER runs should not loop past EOS.",
    "Tokenizer ships only as `tokenizer.json` (no `tokenizer_config.json`, no `vocab.json`/`merges.txt`). It is a `PreTrainedTokenizerFast` BPE. Converter must read `tokenizer.json` directly; preflight Gate A's tokenizer_class lookup will be empty.",
    "`pad_head_dim_to_multiple_of=8` is set in HF config (head_dim is already 288/8=36, divisible by 4 but not 8 — verify whether the reference actually pads V to head_dim=40 or whether this is a no-op for tiny). MLX config tracks this field but the MLX implementation does not pad. Confirm against transformers code at oracle stage."
  ],
  "intake_gaps": []
}
