The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import type { EnvironmentSpeechModel } from "@t3tools/contracts"; |
| 2 | import catalog from "./catalog.json" with { type: "json" }; |
| 3 | |
| 4 | export type SpeechModel = { |
| 5 | readonly id: string; |
| 6 | readonly revision: string; |
| 7 | readonly name: string; |
| 8 | readonly description: string; |
| 9 | readonly filename: string; |
| 10 | readonly size: number; |
| 11 | readonly sha256: string; |
| 12 | readonly languages: readonly string[]; |
| 13 | readonly accuracy: number; |
| 14 | readonly speed: number; |
| 15 | readonly benchmark: NonNullable<EnvironmentSpeechModel["benchmark"]>; |
| 16 | readonly recommended: boolean; |
| 17 | readonly supportsStreaming: boolean; |
| 18 | readonly supportsLanguageDetection: boolean; |
| 19 | readonly supportsTranslation: boolean; |
| 20 | }; |
| 21 | |
| 22 | // Scores remain required by the wire schema but are not displayed. |
| 23 | export const SPEECH_MODELS: readonly SpeechModel[] = catalog.models.map((model) => ({ |
| 24 | ...model, |
| 25 | accuracy: 0, |
| 26 | speed: 0, |
| 27 | })); |
| 28 | |
| 29 | export const DEFAULT_SPEECH_MODEL_ID = "handy-computer/parakeet-unified-en-0.6b-gguf"; |
| 30 | export const getSpeechModel = (modelId: string): SpeechModel | undefined => |
| 31 | SPEECH_MODELS.find((model) => model.id === modelId); |
| 32 | |
| 33 | export { effectiveSpeechLanguage } from "@t3tools/shared/speech"; |