UNPKG

life

Version:

Life.js is the first fullstack framework to build agentic web applications. It is minimal, extensible, and typesafe. Well, everything you love.

1,247 lines (1,226 loc) 112 kB
import { AsyncQueue, TransportProviderClientBase, agentClientConfig, deepClone, zodObjectWithTelemetry, zodUnionWithTelemetry } from "./chunk-D2T23PCX.mjs"; import { attempt, failure, newId, success } from "./chunk-ZHBK6UTM.mjs"; import { __name } from "./chunk-2D3UJWOA.mjs"; // agent/server/config.ts import { z as z10 } from "zod"; // models/eou/providers/livekit/index.ts import path from "path"; import { fileURLToPath } from "url"; import { InferenceSession, Tensor } from "onnxruntime-node"; import { z } from "zod"; // models/eou/base.ts var EOUBase = class { static { __name(this, "EOUBase"); } config; constructor(configSchema, config) { this.config = configSchema.parse({ ...config }); } }; // models/eou/providers/livekit/index.ts var transformers = import("@huggingface/transformers"); var livekitEOUConfig = zodObjectWithTelemetry({ schema: z.object({ provider: z.literal("livekit"), quantized: z.boolean().prefault(true), /** * Quick benchmarks have shown that Livekit models are very optimized for multi-turn * inferences, the most balanced value considering inference time and accuracy was * in the 2-5 messages range for the quantized version. Carefully benchmark the change * if you consider increasing / decreasing this value outside of that range. */ maxMessages: z.number().prefault(3), maxTokens: z.number().prefault(512) }) }); var LivekitEOU = class extends EOUBase { static { __name(this, "LivekitEOU"); } #_tokenizer; #_session; constructor(config) { super(livekitEOUConfig.schema, config); } // Get or create the ONNX inference session async #getSession() { if (this.#_session) return this.#_session; const currentDir = path.dirname(fileURLToPath(import.meta.url)); const modelPath = path.join( currentDir, "..", "models", "eou", "providers", "livekit", this.config.quantized ? "model-quantized.onnx" : "model.onnx" ); this.#_session = await InferenceSession.create(modelPath, { interOpNumThreads: 1, intraOpNumThreads: 1, executionMode: "sequential" }); return this.#_session; } async #getTokenizer() { if (this.#_tokenizer) return this.#_tokenizer; const { AutoTokenizer } = await transformers; this.#_tokenizer = await AutoTokenizer.from_pretrained("livekit/turn-detector", { revision: "v1.2.2-en" }); return this.#_tokenizer; } async #tokenize(text) { const tokenizer = await this.#getTokenizer(); const inputs = await tokenizer(text, { add_special_tokens: false, truncation: false, return_tensors: "np" }); const tokens = Array.isArray(inputs.input_ids.data) ? inputs.input_ids.data : Array.from(inputs.input_ids.data); return tokens; } async #untokenize(tokens) { const tokenizer = await this.#getTokenizer(); const text = tokenizer.decode(tokens); return text; } async #toLivekitMessages(messages) { while (messages.length > 0 && messages.at(-1)?.role !== "user") { messages.pop(); } const tokens = await this.#tokenize( messages.filter((m) => m.role === "user" || m.role === "agent").slice(-this.config.maxMessages).map( (m) => `${m.role === "user" ? "<|user|>" : "<|assistant|>"} ${m.content.trim()} <|im_end|>` ).join("") ); tokens.pop(); if (tokens.length <= this.config.maxTokens) return this.#untokenize(tokens); const userRoleToken = (await this.#tokenize("<|user|>"))[0]; const agentRoleToken = (await this.#tokenize("<|assistant|>"))[0]; const ellipsisToken = (await this.#tokenize("..."))[0]; tokens.reverse(); const keptTokens = tokens.slice(0, this.config.maxTokens - 3); const restTokens = tokens.slice(this.config.maxTokens - 3); keptTokens.push(ellipsisToken); let truncatedMessageRole; for (const token of restTokens) { if (token === userRoleToken) { truncatedMessageRole = "user"; break; } else if (token === agentRoleToken) { truncatedMessageRole = "agent"; break; } } if (!truncatedMessageRole) throw new Error("Failed to find the role. Shouldn't happen."); keptTokens.push(truncatedMessageRole === "user" ? userRoleToken : agentRoleToken); return this.#untokenize(keptTokens.reverse()); } async predict(messages) { try { if (!messages || messages.length === 0) return 0; const session = await this.#getSession(); const livekitMessages = await this.#toLivekitMessages(messages); if (livekitMessages.length === 0) return 0; const tokens = await this.#tokenize(livekitMessages); if (tokens.length === 0) return 0; const outputs = await session.run({ input_ids: new Tensor("int64", tokens, [1, tokens.length]) }); const eouProbability = outputs.prob?.data[0]; if (!eouProbability) return 0; return Number(eouProbability); } catch (error) { console.error("Livekit EOU error:", error); return 0; } } }; // models/eou/providers/turnsense/index.ts import path2 from "path"; import { fileURLToPath as fileURLToPath2 } from "url"; import { InferenceSession as InferenceSession2, Tensor as Tensor2 } from "onnxruntime-node"; import { z as z2 } from "zod"; var transformers2 = import("@huggingface/transformers"); var MAX_TOKENS = 256; var turnSenseEOUConfig = zodObjectWithTelemetry({ schema: z2.object({ provider: z2.literal("turnsense"), quantized: z2.boolean().prefault(true), /** * Quick benchmark have shown that Turnsense models are very optimized for single * message inferences, and their documentation shows single message inferences as * well. Hence why this value defaults to 1. Carefully benchmark the change if you * consider increasing this value. */ maxMessages: z2.number().prefault(1) }) }); var TurnSenseEOU = class extends EOUBase { static { __name(this, "TurnSenseEOU"); } #_tokenizer; #_session; constructor(config) { super(turnSenseEOUConfig.schema, config); } // Get or create the ONNX inference session async #getSession() { if (this.#_session) return this.#_session; const currentDir = path2.dirname(fileURLToPath2(import.meta.url)); const modelPath = path2.join( currentDir, "..", "models", "eou", "providers", "turnsense", this.config.quantized ? "model-quantized.onnx" : "model.onnx" ); this.#_session = await InferenceSession2.create(modelPath, { interOpNumThreads: 1, intraOpNumThreads: 1, executionMode: "sequential" }); return this.#_session; } async #getTokenizer() { if (this.#_tokenizer) return this.#_tokenizer; const { AutoTokenizer } = await transformers2; this.#_tokenizer = await AutoTokenizer.from_pretrained("latishab/turnsense"); return this.#_tokenizer; } async #tokenize(text) { const tokenizer = await this.#getTokenizer(); const inputs = await tokenizer(text, { padding: "max_length", max_length: 256, truncation: true, truncation_side: "left", return_tensors: "pt" }); const inputIdsArray = Array.isArray(inputs.input_ids.data) ? inputs.input_ids.data : Array.from(inputs.input_ids.data); const attentionMaskArray = Array.isArray(inputs.attention_mask.data) ? inputs.attention_mask.data : Array.from(inputs.attention_mask.data); return { tokens: inputIdsArray, attentionMask: attentionMaskArray }; } async #untokenize(tokens) { const tokenizer = await this.#getTokenizer(); const text = tokenizer.decode(tokens); return text; } async #toTurnsenseMessages(messages) { while (messages.length > 0 && messages.at(-1)?.role !== "user") { messages.pop(); } const { tokens } = await this.#tokenize( messages.filter((m) => m.role === "user" || m.role === "agent").slice(-this.config.maxMessages).map( (m) => `${m.role === "user" ? "<|user|>" : "<|assistant|>"} ${m.content.trim()} <|im_end|>` ).join("") ); tokens.pop(); if (tokens.length <= MAX_TOKENS) return this.#untokenize(tokens); const userRoleToken = (await this.#tokenize("<|user|>")).tokens[0]; const agentRoleToken = (await this.#tokenize("<|assistant|>")).tokens[0]; const ellipsisToken = (await this.#tokenize("...")).tokens[0]; tokens.reverse(); const keptTokens = tokens.slice(0, MAX_TOKENS - 3); const restTokens = tokens.slice(MAX_TOKENS - 3); keptTokens.push(ellipsisToken); let truncatedMessageRole; for (const token of restTokens) { if (token === userRoleToken) { truncatedMessageRole = "user"; break; } else if (token === agentRoleToken) { truncatedMessageRole = "agent"; break; } } if (!truncatedMessageRole) throw new Error("Failed to find the role. Shouldn't happen."); keptTokens.push(truncatedMessageRole === "user" ? userRoleToken : agentRoleToken); return this.#untokenize(keptTokens.reverse()); } async predict(messages) { try { const session = await this.#getSession(); const turnsenseMessages = await this.#toTurnsenseMessages(messages); if (turnsenseMessages.length === 0) return 0; const { tokens, attentionMask } = await this.#tokenize(turnsenseMessages); if (tokens.length === 0) return 0; const outputs = await session.run({ input_ids: new Tensor2("int64", tokens, [1, tokens.length]), attention_mask: new Tensor2("int64", attentionMask, [1, attentionMask.length]) }); const probabilities = outputs.probabilities; if (!probabilities?.data || probabilities.data.length < 2) return 0; const eouProbability = probabilities.data[1]; return typeof eouProbability === "number" ? eouProbability : 0; } catch (error) { console.error("TurnSense EOU error:", error); return 0; } } }; // models/eou/index.ts var eouProviders = { turnsense: { class: TurnSenseEOU, configSchema: turnSenseEOUConfig.schema }, livekit: { class: LivekitEOU, configSchema: livekitEOUConfig.schema } }; var eouProviderConfig = zodUnionWithTelemetry("provider", [ livekitEOUConfig, turnSenseEOUConfig ]); // models/llm/providers/mistral.ts import { Mistral } from "@mistralai/mistralai"; import { z as z3 } from "zod"; // models/llm/base.ts var LLMBase = class { static { __name(this, "LLMBase"); } config; constructor(configSchema, config) { this.config = configSchema.parse({ ...config }); } createGenerateMessageJob() { const id = newId("job"); const stream = new AsyncQueue(); const _abortController = new AbortController(); const job = { id, stream, cancel: /* @__PURE__ */ __name(() => _abortController.abort(), "cancel"), _abortController }; return job; } }; // models/llm/providers/mistral.ts var mistralLLMConfig = zodObjectWithTelemetry({ schema: z3.object({ provider: z3.literal("mistral"), apiKey: z3.string().prefault(process.env.MISTRAL_API_KEY), model: z3.enum([ "mistral-large-latest", "mistral-large-2411", "mistral-large-2407", "mistral-small-latest", "mistral-small-2501", "mistral-small-2503", "mistral-medium-latest", "mistral-medium-2505", "pixtral-large-latest", "pixtral-large-2411", "codestral-latest", "codestral-2501", "codestral-2405", "ministral-3b-latest", "ministral-8b-latest", "open-mistral-7b", "open-mixtral-8x7b", "open-mixtral-8x22b" ]).prefault("mistral-small-latest"), temperature: z3.number().min(0).max(1).prefault(0.5) }), toTelemetry: /* @__PURE__ */ __name((config) => { config.apiKey = "redacted"; return config; }, "toTelemetry") }); var MistralLLM = class extends LLMBase { static { __name(this, "MistralLLM"); } #client; constructor(config) { super(mistralLLMConfig.schema, config); this.#client = new Mistral({ apiKey: config.apiKey }); } /** * Format conversion */ #toMistralMessage(message) { if (message.role === "user") return { role: "user", content: message.content }; if (message.role === "agent") return { role: "assistant", content: message.content, toolCalls: message.toolsRequests?.map((request) => ({ type: "function", id: request.toolRequestId, function: { name: request.toolName, arguments: JSON.stringify(request.toolInput) } })) }; if (message.role === "system") return { role: "system", content: message.content }; if (message.role === "tool") return { role: "tool", toolCallId: message.toolName, content: JSON.stringify(message.toolOutput) }; return null; } #toMistralMessages(messages) { return messages.map(this.#toMistralMessage.bind(this)); } #toMistralTool(tool) { return { type: "function", function: { name: tool.name, description: tool.description, parameters: z3.toJSONSchema(tool.schema.input) } }; } #toMistralTools(tools) { return tools.map(this.#toMistralTool); } /** * Generate a message with job management - returns jobId along with stream */ async generateMessage(params) { const job = this.createGenerateMessageJob(); const mistralTools = params.tools.length > 0 ? this.#toMistralTools(params.tools) : void 0; const mistralMessages = this.#toMistralMessages(params.messages); try { const stream = await this.#client.chat.stream({ model: this.config.model, temperature: this.config.temperature, messages: mistralMessages, ...mistralTools?.length ? { tools: mistralTools } : {} }); (async () => { let pendingToolCalls = {}; try { for await (const chunk of stream) { if (job._abortController.signal.aborted) break; const choice = chunk.data.choices[0]; if (!choice) throw new Error("No choice"); const delta = choice.delta; if (delta.content) { const content = delta.content; const contentString = typeof content === "string" ? content : JSON.stringify(content); job.stream.push({ type: "content", content: contentString }); } const toolCalls = delta.toolCalls; if (toolCalls) { for (const toolCall of toolCalls) { const id = toolCall.id ?? Object.keys(pendingToolCalls).at(-1); if (!id) throw new Error("No tool call ID"); if (!pendingToolCalls[id]) { pendingToolCalls[id] = { id, name: "", arguments: "" }; } if (toolCall.function?.name) { pendingToolCalls[id].name += toolCall.function.name; } if (toolCall.function?.arguments) { pendingToolCalls[id].arguments += toolCall.function.arguments; } } } if (choice.finishReason === "tool_calls") { job.stream.push({ type: "tools", tools: Object.values(pendingToolCalls).map((toolCall) => ({ toolRequestId: toolCall.id, toolName: toolCall.name, toolInput: JSON.parse(toolCall.arguments || "{}") })) }); pendingToolCalls = {}; } if (choice.finishReason === "stop") job.stream.push({ type: "end" }); } } catch (error) { job.stream.push({ type: "error", error: error instanceof Error ? error.message : "Unknown error" }); } })(); return job; } catch (error) { job.stream.push({ type: "error", error: error instanceof Error ? error.message : "Failed to create stream" }); return job; } } async generateObject(params) { try { const mistralMessages = this.#toMistralMessages(params.messages); const jsonSchema = z3.toJSONSchema(params.schema); const response = await this.#client.chat.complete({ model: this.config.model, messages: mistralMessages, temperature: this.config.temperature, responseFormat: { type: "json_schema", jsonSchema: { name: "avc", schemaDefinition: jsonSchema } } }); const data = JSON.parse(response.choices?.[0]?.message?.content || "{}"); return { type: "content", data }; } catch (error) { return { type: "error", error: error instanceof Error ? error.message : "Failed to generate object" }; } } }; // models/llm/providers/openai.ts import { OpenAI } from "openai"; import { z as z4 } from "zod"; var openAILLMConfig = zodObjectWithTelemetry({ schema: z4.object({ provider: z4.literal("openai"), apiKey: z4.string().prefault(process.env.OPENAI_API_KEY), model: z4.enum(["gpt-4o-mini", "gpt-4o", "gpt-5", "gpt-5-nano"]).prefault("gpt-4o"), temperature: z4.number().min(0).max(2).prefault(1) }), toTelemetry: /* @__PURE__ */ __name((config) => { config.apiKey = "redacted"; return config; }, "toTelemetry") }); var OpenAILLM = class extends LLMBase { static { __name(this, "OpenAILLM"); } #client; constructor(config) { super(openAILLMConfig.schema, config); this.#client = new OpenAI({ apiKey: config.apiKey }); } /** * Format conversion */ #toOpenAIMessage(message) { if (message.role === "user") { return { role: "user", content: message.content }; } if (message.role === "agent") { return { role: "assistant", content: message.content, ...message.toolsRequests?.length ? { tool_calls: message.toolsRequests?.map((request) => ({ id: request.toolRequestId, function: { name: request.toolName, arguments: JSON.stringify(request.toolInput) }, type: "function" })) } : {} }; } if (message.role === "system") { return { role: "system", content: message.content }; } if (message.role === "tool") { return { role: "tool", tool_call_id: message.toolName, content: JSON.stringify(message.toolOutput) }; } return null; } #toOpenAIMessages(messages) { return messages.map(this.#toOpenAIMessage); } #toOpenAITool(tool) { return { type: "function", function: { name: tool.name, description: tool.description, parameters: z4.toJSONSchema(tool.schema.input) } }; } #toOpenAITools(tools) { return tools.map(this.#toOpenAITool); } /** * Generate a message with job management - returns jobId along with stream */ async generateMessage(params) { const job = this.createGenerateMessageJob(); const openaiTools = params.tools.length > 0 ? this.#toOpenAITools(params.tools) : void 0; const openaiMessages = this.#toOpenAIMessages(params.messages); const stream = await this.#client.chat.completions.create( { model: this.config.model, temperature: this.config.temperature, messages: openaiMessages, stream: true, ...openaiTools?.length ? { tools: openaiTools, parallel_tool_calls: true } : {} }, { signal: job._abortController.signal } // Allows the stream to be cancelled ); (async () => { let pendingToolCalls = {}; for await (const chunk of stream) { if (job._abortController.signal.aborted) break; const choice = chunk.choices[0]; if (!choice) throw new Error("No choice"); const delta = choice.delta; if (delta.content) job.stream.push({ type: "content", content: delta.content }); if (delta.tool_calls) { for (const toolCall of delta.tool_calls) { const id = toolCall.id ?? Object.keys(pendingToolCalls).at(-1); if (!id) throw new Error("No tool call ID"); if (!pendingToolCalls[id]) pendingToolCalls[id] = { id, name: "", arguments: "" }; if (toolCall.function?.name) pendingToolCalls[id].name += toolCall.function.name; if (toolCall.function?.arguments) pendingToolCalls[id].arguments += toolCall.function.arguments; } } if (choice.finish_reason === "tool_calls") { job.stream.push({ type: "tools", tools: Object.values(pendingToolCalls).map((toolCall) => ({ toolRequestId: toolCall.id, toolName: toolCall.name, toolInput: JSON.parse(toolCall.arguments || "{}") })) }); pendingToolCalls = {}; } if (choice.finish_reason === "stop") job.stream.push({ type: "end" }); } })(); return job; } async generateObject(params) { try { const openaiMessages = this.#toOpenAIMessages(params.messages); const jsonSchema = z4.toJSONSchema(params.schema); const response = await this.#client.chat.completions.create({ model: this.config.model, messages: openaiMessages, temperature: this.config.temperature, response_format: { type: "json_schema", json_schema: { name: "avc", schema: jsonSchema } } }); const data = JSON.parse(response.choices[0]?.message?.content || "{}"); return { type: "content", data }; } catch (error) { return { type: "error", error: error instanceof Error ? error.message : "Failed to generate object" }; } } }; // models/llm/providers/xai.ts import { OpenAI as OpenAI2 } from "openai"; import { z as z5 } from "zod"; var xaiLLMConfig = zodObjectWithTelemetry({ schema: z5.object({ provider: z5.literal("xai"), apiKey: z5.string().prefault(process.env.XAI_API_KEY), model: z5.enum([ "grok-3", "grok-3-fast", "grok-3-mini", "grok-3-mini-fast", "grok-2-1212", "grok-2-vision-1212", "grok-beta", "grok-vision-beta" ]).prefault("grok-3-mini"), temperature: z5.number().min(0).max(2).prefault(0.5) }), toTelemetry: /* @__PURE__ */ __name((config) => { config.apiKey = "redacted"; return config; }, "toTelemetry") }); var XaiLLM = class extends LLMBase { static { __name(this, "XaiLLM"); } #client; constructor(config) { super(xaiLLMConfig.schema, config); this.#client = new OpenAI2({ apiKey: config.apiKey, baseURL: "https://api.x.ai/v1" }); } /** * Format conversion */ #toOpenAIMessage(message) { if (message.role === "user") { return { role: "user", content: message.content }; } if (message.role === "agent") { return { role: "assistant", content: message.content, ...message.toolsRequests?.length ? { tool_calls: message.toolsRequests?.map((request) => ({ id: request.toolRequestId, function: { name: request.toolName, arguments: JSON.stringify(request.toolInput) }, type: "function" })) } : {} }; } if (message.role === "system") { return { role: "system", content: message.content }; } if (message.role === "tool") { return { role: "tool", tool_call_id: message.toolName, content: JSON.stringify(message.toolOutput) }; } return null; } #toOpenAIMessages(messages) { return messages.map(this.#toOpenAIMessage); } #toOpenAITool(tool) { return { type: "function", function: { name: tool.name, description: tool.description, parameters: z5.toJSONSchema(tool.schema.input) } }; } #toOpenAITools(tools) { return tools.map(this.#toOpenAITool); } /** * Generate a message with job management - returns jobId along with stream */ async generateMessage(params) { const job = this.createGenerateMessageJob(); const openaiTools = params.tools.length > 0 ? this.#toOpenAITools(params.tools) : void 0; const openaiMessages = this.#toOpenAIMessages(params.messages); const stream = await this.#client.chat.completions.create( { model: this.config.model, temperature: this.config.temperature, messages: openaiMessages, stream: true, ...openaiTools?.length ? { tools: openaiTools, parallel_tool_calls: true } : {} }, { signal: job._abortController.signal } // Allows the stream to be cancelled ); (async () => { let pendingToolCalls = {}; for await (const chunk of stream) { if (job._abortController.signal.aborted) continue; const choice = chunk.choices[0]; if (!choice) throw new Error("No choice"); const delta = choice.delta; if (delta.content) { job.stream.push({ type: "content", content: delta.content }); continue; } if (delta.tool_calls) { for (const toolCall of delta.tool_calls) { const id = toolCall.id ?? Object.keys(pendingToolCalls).at(-1); if (!id) throw new Error("No tool call ID"); if (!pendingToolCalls[id]) pendingToolCalls[id] = { id, name: "", arguments: "" }; if (toolCall.function?.name) pendingToolCalls[id].name += toolCall.function.name; if (toolCall.function?.arguments) pendingToolCalls[id].arguments += toolCall.function.arguments; } } if (chunk.choices[0]?.finish_reason === "tool_calls") { job.stream.push({ type: "tools", tools: Object.values(pendingToolCalls).map((toolCall) => ({ toolRequestId: toolCall.id, toolName: toolCall.name, toolInput: JSON.parse(toolCall.arguments || "{}") })) }); pendingToolCalls = {}; } if (chunk.choices[0]?.finish_reason === "stop") job.stream.push({ type: "end" }); } })(); return job; } async generateObject(params) { try { const openaiMessages = this.#toOpenAIMessages(params.messages); const jsonSchema = z5.toJSONSchema(params.schema); const response = await this.#client.chat.completions.create({ model: this.config.model, messages: openaiMessages, temperature: this.config.temperature, response_format: { type: "json_schema", json_schema: { name: "avc", schema: jsonSchema } } }); const data = JSON.parse(response.choices[0]?.message?.content || "{}"); return { type: "content", data }; } catch (error) { return { type: "error", error: error instanceof Error ? error.message : "Failed to generate object" }; } } }; // models/llm/index.ts var llmProviders = { mistral: { class: MistralLLM, configSchema: mistralLLMConfig }, openai: { class: OpenAILLM, configSchema: openAILLMConfig }, xai: { class: XaiLLM, configSchema: xaiLLMConfig } }; var llmProviderConfig = zodUnionWithTelemetry("provider", [ mistralLLMConfig, openAILLMConfig, xaiLLMConfig ]); // models/stt/providers/deepgram.ts import { createClient, LiveTranscriptionEvents } from "@deepgram/sdk"; import { z as z6 } from "zod"; // models/stt/base.ts var STTBase = class { static { __name(this, "STTBase"); } config; constructor(configSchema, config) { this.config = configSchema.parse({ ...config }); } createGenerateJob() { const id = newId("job"); const stream = new AsyncQueue(); const _abortController = new AbortController(); const job = { id, stream, inputVoice: /* @__PURE__ */ __name((pcm) => this.onVoiceInput(job, pcm), "inputVoice"), cancel: /* @__PURE__ */ __name(() => _abortController.abort(), "cancel"), _abortController }; return job; } }; // models/stt/providers/deepgram.ts var deepgramSTTConfig = zodObjectWithTelemetry({ schema: z6.object({ provider: z6.literal("deepgram"), apiKey: z6.string().prefault(process.env.DEEPGRAM_API_KEY), model: z6.enum([ "nova-3", "nova-2", "nova-2-general", "nova-2-meeting", "nova-2-phonecall", "nova-2-voicemail", "nova-2-finance", "nova-2-conversationalai", "nova-2-video", "nova-2-medical", "nova-2-drivethru", "nova-2-automotive", "nova-2-atc", "nova", "nova-general", "nova-phonecall", "enhanced", "enhanced-general", "enhanced-meeting", "enhanced-phonecall", "enhanced-finance", "base", "base-general", "base-meeting", "base-phonecall", "base-voicemail", "base-finance", "base-conversationalai", "base-video", "whisper-tiny", "whisper-base", "whisper-small", "whisper-medium", "whisper-large" ]).prefault("nova-2-general"), language: z6.string().prefault("en") }), toTelemetry: /* @__PURE__ */ __name((config) => { config.apiKey = "redacted"; return config; }, "toTelemetry") }); var DeepgramSTT = class extends STTBase { static { __name(this, "DeepgramSTT"); } #deepgram; #jobsSockets = /* @__PURE__ */ new Map(); constructor(config) { super(deepgramSTTConfig.schema, config); this.#deepgram = createClient(config.apiKey); } // biome-ignore lint/suspicious/useAwait: need async to match STTBase abstract method async generate() { const job = this.createGenerateJob(); const socket = this.#deepgram.listen.live({ encoding: "linear16", sample_rate: 16e3, channels: 1, filler_words: true, numerals: true, punctuate: true, smart_format: true, endpointing: 0, // VAD is managed by the generation plugin no_delay: true, // Dynamic config model: this.config.model, language: this.config.language }); this.#jobsSockets.set(job.id, socket); socket.on(LiveTranscriptionEvents.Transcript, (msg) => { const text = msg.channel.alternatives[0]?.transcript; if (text) job.stream.push({ type: "content", textChunk: text }); }); job._abortController.signal.addEventListener("abort", () => { socket.requestClose(); this.#jobsSockets.delete(job.id); }); setInterval(() => socket.keepAlive(), 1e3); return job; } // biome-ignore lint/suspicious/useAwait: Need async to match STTBase abstract method async onVoiceInput(job, pcm) { this.#jobsSockets.get(job.id)?.send(pcm.buffer); } }; // models/stt/index.ts var sttProviders = { deepgram: { class: DeepgramSTT, configSchema: deepgramSTTConfig } }; var sttProviderConfig = zodUnionWithTelemetry("provider", [deepgramSTTConfig]); // models/tts/providers/cartesia.ts import { CartesiaClient } from "@cartesia/cartesia-js"; import { z as z7 } from "zod"; // shared/audio-chunk-to-ms.ts function audioChunkToMs(audioChunk, sampleRate = 16e3) { return audioChunk.length / sampleRate * 1e3; } __name(audioChunkToMs, "audioChunkToMs"); // shared/weighted-average.ts var WeightedAverage = class { static { __name(this, "WeightedAverage"); } weightedSum = 0; totalWeight = 0; constructor(initialValue = 0) { this.add(initialValue, 1); } add(value, weight) { this.weightedSum += value * weight; this.totalWeight += weight; } get average() { return this.totalWeight > 0 ? this.weightedSum / this.totalWeight : 0; } get hasData() { return this.totalWeight > 0; } reset() { this.weightedSum = 0; this.totalWeight = 0; } }; // models/tts/lib/speech-duration-tokenizer.ts import { ToWords } from "to-words"; // models/tts/lib/hyphenator.ts var END = Symbol("END"); var Hyphenator = class { static { __name(this, "Hyphenator"); } tree; exceptions; constructor(patterns, exceptions) { this.tree = {}; this.exceptions = {}; for (const pattern of patterns.split(/\s+/)) { this.#insertPattern(pattern); } for (const exception of exceptions.split(/\s+/)) { const points = [0, ...Array.from(exception).map((c) => c === "-" ? 1 : 0)]; this.exceptions[exception.replace(/-/g, "")] = points; } } #insertPattern(pattern) { const chars = pattern.replaceAll(/[0-9]/g, ""); const points = pattern.split(/[.a-z]/).map((d) => Number.parseInt(d || "0", 10)); let node = this.tree; for (const char of chars) { if (!node[char]) { node[char] = {}; } node = node[char]; } node[END] = points; } hyphenateWord(word) { if (word.length <= 4) { return [word]; } let points = this.exceptions[word.toLowerCase()]; if (!points) { const work = `.${word.toLowerCase()}.`; points = new Array(work.length + 1).fill(0); for (let i = 0; i < work.length; i++) { let node = this.tree; for (const char of work.slice(i)) { if (node[char]) { node = node[char]; if (node[END]) { const end = node[END]; end.forEach((x, j) => { if (!points) return; points[i + j] = Math.max(points[i + j] ?? 0, x); }); } } else { break; } } } points[1] = points[2] = points[points.length - 2] = points[points.length - 3] = 0; } const pieces = [""]; for (let i = 0; i < word.length; i++) { const char = word[i]; if (!char) continue; pieces[pieces.length - 1] += char; const point = points[i + 2]; if (point && point % 2) { pieces.push(""); } } return pieces; } }; var PATTERNS = ( // Knuth and Liang's original hyphenation patterns from classic TeX. // In the public domain. `.ach4 .ad4der .af1t .al3t .am5at .an5c .ang4 .ani5m .ant4 .an3te .anti5s .ar5s .ar4tie .ar4ty .as3c .as1p .as1s .aster5 .atom5 .au1d .av4i .awn4 .ba4g .ba5na .bas4e .ber4 .be5ra .be3sm .be5sto .bri2 .but4ti .cam4pe .can5c .capa5b .car5ol .ca4t .ce4la .ch4 .chill5i .ci2 .cit5r .co3e .co4r .cor5ner .de4moi .de3o .de3ra .de3ri .des4c .dictio5 .do4t .du4c .dumb5 .earth5 .eas3i .eb4 .eer4 .eg2 .el5d .el3em .enam3 .en3g .en3s .eq5ui5t .er4ri .es3 .eu3 .eye5 .fes3 .for5mer .ga2 .ge2 .gen3t4 .ge5og .gi5a .gi4b .go4r .hand5i .han5k .he2 .hero5i .hes3 .het3 .hi3b .hi3er .hon5ey .hon3o .hov5 .id4l .idol3 .im3m .im5pin .in1 .in3ci .ine2 .in2k .in3s .ir5r .is4i .ju3r .la4cy .la4m .lat5er .lath5 .le2 .leg5e .len4 .lep5 .lev1 .li4g .lig5a .li2n .li3o .li4t .mag5a5 .mal5o .man5a .mar5ti .me2 .mer3c .me5ter .mis1 .mist5i .mon3e .mo3ro .mu5ta .muta5b .ni4c .od2 .odd5 .of5te .or5ato .or3c .or1d .or3t .os3 .os4tl .oth3 .out3 .ped5al .pe5te .pe5tit .pi4e .pio5n .pi2t .pre3m .ra4c .ran4t .ratio5na .ree2 .re5mit .res2 .re5stat .ri4g .rit5u .ro4q .ros5t .row5d .ru4d .sci3e .self5 .sell5 .se2n .se5rie .sh2 .si2 .sing4 .st4 .sta5bl .sy2 .ta4 .te4 .ten5an .th2 .ti2 .til4 .tim5o5 .ting4 .tin5k .ton4a .to4p .top5i .tou5s .trib5ut .un1a .un3ce .under5 .un1e .un5k .un5o .un3u .up3 .ure3 .us5a .ven4de .ve5ra .wil5i .ye4 4ab. a5bal a5ban abe2 ab5erd abi5a ab5it5ab ab5lat ab5o5liz 4abr ab5rog ab3ul a4car ac5ard ac5aro a5ceou ac1er a5chet 4a2ci a3cie ac1in a3cio ac5rob act5if ac3ul ac4um a2d ad4din ad5er. 2adi a3dia ad3ica adi4er a3dio a3dit a5diu ad4le ad3ow ad5ran ad4su 4adu a3duc ad5um ae4r aeri4e a2f aff4 a4gab aga4n ag5ell age4o 4ageu ag1i 4ag4l ag1n a2go 3agog ag3oni a5guer ag5ul a4gy a3ha a3he ah4l a3ho ai2 a5ia a3ic. ai5ly a4i4n ain5in ain5o ait5en a1j ak1en al5ab al3ad a4lar 4aldi 2ale al3end a4lenti a5le5o al1i al4ia. ali4e al5lev 4allic 4alm a5log. a4ly. 4alys 5a5lyst 5alyt 3alyz 4ama am5ab am3ag ama5ra am5asc a4matis a4m5ato am5era am3ic am5if am5ily am1in ami4no a2mo a5mon amor5i amp5en a2n an3age 3analy a3nar an3arc anar4i a3nati 4and ande4s an3dis an1dl an4dow a5nee a3nen an5est. a3neu 2ang ang5ie an1gl a4n1ic a3nies an3i3f an4ime a5nimi a5nine an3io a3nip an3ish an3it a3niu an4kli 5anniz ano4 an5ot anoth5 an2sa an4sco an4sn an2sp ans3po an4st an4sur antal4 an4tie 4anto an2tr an4tw an3ua an3ul a5nur 4ao apar4 ap5at ap5ero a3pher 4aphi a4pilla ap5illar ap3in ap3ita a3pitu a2pl apoc5 ap5ola apor5i apos3t aps5es a3pu aque5 2a2r ar3act a5rade ar5adis ar3al a5ramete aran4g ara3p ar4at a5ratio ar5ativ a5rau ar5av4 araw4 arbal4 ar4chan ar5dine ar4dr ar5eas a3ree ar3ent a5ress ar4fi ar4fl ar1i ar5ial ar3ian a3riet ar4im ar5inat ar3io ar2iz ar2mi ar5o5d a5roni a3roo ar2p ar3q arre4 ar4sa ar2sh 4as. as4ab as3ant ashi4 a5sia. a3sib a3sic 5a5si4t ask3i as4l a4soc as5ph as4sh as3ten as1tr asur5a a2ta at3abl at5ac at3alo at5ap ate5c at5ech at3ego at3en. at3era ater5n a5terna at3est at5ev 4ath ath5em a5then at4ho ath5om 4ati. a5tia at5i5b at1ic at3if ation5ar at3itu a4tog a2tom at5omiz a4top a4tos a1tr at5rop at4sk at4tag at5te at4th a2tu at5ua at5ue at3ul at3ura a2ty au4b augh3 au3gu au4l2 aun5d au3r au5sib aut5en au1th a2va av3ag a5van ave4no av3era av5ern av5ery av1i avi4er av3ig av5oc a1vor 3away aw3i aw4ly aws4 ax4ic ax4id ay5al aye4 ays4 azi4er azz5i 5ba. bad5ger ba4ge bal1a ban5dag ban4e ban3i barbi5 bari4a bas4si 1bat ba4z 2b1b b2be b3ber bbi4na 4b1d 4be. beak4 beat3 4be2d be3da be3de be3di be3gi be5gu 1bel be1li be3lo 4be5m be5nig be5nu 4bes4 be3sp be5str 3bet bet5iz be5tr be3tw be3w be5yo 2bf 4b3h bi2b bi4d 3bie bi5en bi4er 2b3if 1bil bi3liz bina5r4 bin4d bi5net bi3ogr bi5ou bi2t 3bi3tio bi3tr 3bit5ua b5itz b1j bk4 b2l2 blath5 b4le. blen4 5blesp b3lis b4lo blun4t 4b1m 4b3n bne5g 3bod bod3i bo4e bol3ic bom4bi bon4a bon5at 3boo 5bor. 4b1ora bor5d 5bore 5bori 5bos4 b5ota both5 bo4to bound3 4bp 4brit broth3 2b5s2 bsor4 2bt bt4l b4to b3tr buf4fer bu4ga bu3li bumi4 bu4n bunt4i bu3re bus5ie buss4e 5bust 4buta 3butio b5uto b1v 4b5w 5by. bys4 1ca cab3in ca1bl cach4 ca5den 4cag4 2c5ah ca3lat cal4la call5in 4calo can5d can4e can4ic can5is can3iz can4ty cany4 ca5per car5om cast5er cas5tig 4casy ca4th 4cativ cav5al c3c ccha5 cci4a ccompa5 ccon4 ccou3t 2ce. 4ced. 4ceden 3cei 5cel. 3cell 1cen 3cenc 2cen4e 4ceni 3cent 3cep ce5ram 4cesa 3cessi ces5si5b ces5t cet4 c5e4ta cew4 2ch 4ch. 4ch3ab 5chanic ch5a5nis che2 cheap3 4ched che5lo 3chemi ch5ene ch3er. ch3ers 4ch1in 5chine. ch5iness 5chini 5chio 3chit chi2z 3cho2 ch4ti 1ci 3cia ci2a5b cia5r ci5c 4cier 5cific. 4cii ci4la 3cili 2cim 2cin c4ina 3cinat cin3em c1ing c5ing. 5cino cion4 4cipe ci3ph 4cipic 4cista 4cisti 2c1it cit3iz 5ciz ck1 ck3i 1c4l4 4clar c5laratio 5clare cle4m 4clic clim4 cly4 c5n 1co co5ag coe2 2cog co4gr coi4 co3inc col5i 5colo col3or com5er con4a c4one con3g con5t co3pa cop3ic co4pl 4corb coro3n cos4e cov1 cove4 cow5a coz5e co5zi c1q cras5t 5crat. 5cratic cre3at 5cred 4c3reta cre4v cri2 cri5f c4rin cris4 5criti cro4pl crop5o cros4e cru4d 4c3s2 2c1t cta4b ct5ang c5tant c2te c3ter c4ticu ctim3i ctu4r c4tw cud5 c4uf c4ui cu5ity 5culi cul4tis 3cultu cu2ma c3ume cu4mi 3cun cu3pi cu5py cur5a4b cu5ria 1cus cuss4i 3c4ut cu4tie 4c5utiv 4cutr 1cy cze4 1d2a 5da. 2d3a4b dach4 4daf 2dag da2m2 dan3g dard5 dark5 4dary 3dat 4dativ 4dato 5dav4 dav5e 5day d1b d5c d1d4 2de. deaf5 deb5it de4bon decan4 de4cil de5com 2d1ed 4dee. de5if deli4e del5i5q de5lo d4em 5dem. 3demic dem5ic. de5mil de4mons demor5 1den de4nar de3no denti5f de3nu de1p de3pa depi4 de2pu d3eq d4erh 5derm dern5iz der5s des2 d2es. de1sc de2s5o des3ti de3str de4su de1t de2to de1v dev3il 4dey 4d1f d4ga d3ge4t dg1i d2gy d1h2 5di. 1d4i3a dia5b di4cam d4ice 3dict 3did 5di3en d1if di3ge di4lato d1in 1dina 3dine. 5dini di5niz 1dio dio5g di4pl dir2 di1re dirt5i dis1 5disi d4is3t d2iti 1di1v d1j d5k2 4d5la 3dle. 3dled 3dles. 4dless 2d3lo 4d5lu 2dly d1m 4d1n4 1do 3do. do5de 5doe 2d5of d4og do4la doli4 do5lor dom5iz do3nat doni4 doo3d dop4p d4or 3dos 4d5out do4v 3dox d1p 1dr drag5on 4drai dre4 drea5r 5dren dri4b dril4 dro4p 4drow 5drupli 4dry 2d1s2 ds4p d4sw d4sy d2th 1du d1u1a du2c d1uca duc5er 4duct. 4ducts du5el du4g d3ule dum4be du4n 4dup du4pe d1v d1w d2y 5dyn dy4se dys5p e1a4b e3act ead1 ead5ie ea4ge ea5ger ea4l eal5er eal3ou eam3er e5and ear3a ear4c ear5es ear4ic ear4il ear5k ear2t eart3e ea5sp e3ass east3 ea2t eat5en eath3i e5atif e4a3tu ea2v eav3en eav5i eav5o 2e1b e4bel. e4bels e4ben e4bit e3br e4cad ecan5c ecca5 e1ce ec5essa ec2i e4cib ec5ificat ec5ifie ec5ify ec3im eci4t e5cite e4clam e4clus e2col e4comm e4compe e4conc e2cor ec3ora eco5ro e1cr e4crem ec4tan ec4te e1cu e4cul ec3ula 2e2da 4ed3d e4d1er ede4s 4edi e3dia ed3ib ed3ica ed3im ed1it edi5z 4edo e4dol edon2 e4dri e4dul ed5ulo ee2c eed3i ee2f eel3i ee4ly ee2m ee4na ee4p1 ee2s4 eest4 ee4ty e5ex e1f e4f3ere 1eff e4fic 5efici efil4 e3fine ef5i5nite 3efit efor5es e4fuse. 4egal eger4 eg5ib eg4ic eg5ing e5git5 eg5n e4go. e4gos eg1ul e5gur 5egy e1h4 eher4 ei2 e5ic ei5d eig2 ei5gl e3imb e3inf e1ing e5inst eir4d eit3e ei3th e5ity e1j e4jud ej5udi eki4n ek4la e1la e4la. e4lac elan4d el5ativ e4law elaxa4 e3lea el5ebra 5elec e4led el3ega e5len e4l1er e1les el2f el2i e3libe e4l5ic. el3ica e3lier el5igib e5lim e4l3ing e3lio e2lis el5ish e3liv3 4ella el4lab ello4 e5loc el5og el3op. el2sh el4ta e5lud el5ug e4mac e4mag e5man em5ana em5b e1me e2mel e4met em3ica emi4e em5igra em1in2 em5ine em3i3ni e4mis em5ish e5miss em3iz 5emniz emo4g emoni5o em3pi e4mul em5ula emu3n e3my en5amo e4nant ench4er en3dic e5nea e5nee en3em en5ero en5esi en5est en3etr e3new en5ics e5nie e5nil e3nio en3ish en3it e5niu 5eniz 4enn 4eno eno4g e4nos en3ov en4sw ent5age 4enthes en3ua en5uf e3ny. 4en3z e5of eo2g e4oi4 e3ol eop3ar e1or eo3re eo5rol eos4 e4ot eo4to e5out e5ow e2pa e3pai ep5anc e5pel e3pent ep5etitio ephe4 e4pli e1po e4prec ep5reca e4pred ep3reh e3pro e4prob ep4sh ep5ti5b e4put ep5uta e1q equi3l e4q3ui3s er1a era4b 4erand er3ar 4erati. 2erb er4bl er3ch er4che 2ere. e3real ere5co ere3in er5el. er3emo er5ena er5ence 4erene er3ent ere4q er5ess er3est eret4 er1h er1i e1ria4 5erick e3rien eri4er er3ine e1rio 4erit er4iu eri4v e4riva er3m4 er4nis 4ernit 5erniz er3no 2ero er5ob e5roc ero4r er1ou er1s er3set ert3er 4ertl er3tw 4eru eru4t 5erwau e1s4a e4sage. e4sages es2c e2sca es5can e3scr es5cu e1s2e e2sec es5ecr es5enc e4sert. e4serts e4serva 4esh e3sha esh5en e1si e2sic e2sid es5iden es5igna e2s5im es4i4n esis4te esi4u e5skin es4mi e2sol es3olu e2son es5ona e1sp es3per es5pira es4pre 2ess es4si4b estan4 es3tig es5tim 4es2to e3ston 2estr e5stro estruc5 e2sur es5urr es4w eta4b eten4d e3teo ethod3 et1ic e5tide etin4 eti4no e5tir e5titio et5itiv 4etn et5ona e3tra e3tre et3ric et5rif et3rog et5ros et3ua et5ym et5z 4eu e5un e3up eu3ro eus4 eute4 euti5l eu5tr eva2p5 e2vas ev5ast e5vea ev3ell evel3o e5veng even4i ev1er e5verb e1vi ev3id evi4l e4vin evi4v e5voc e5vu e1wa e4wag e5wee e3wh ewil5 ew3ing e3wit 1exp 5eyc 5eye. eys4 1fa fa3bl fab3r fa4ce 4fag fain4 fall5e 4fa4ma fam5is 5far far5th fa3ta fa3the 4fato fault5 4f5b 4fd 4fe. feas4 feath3 fe4b 4feca 5fect 2fed fe3li fe4mo fen2d fend5e fer1 5ferr fev4 4f1f f4fes f4fie f5fin. f2f5is f4fly f2fy 4fh 1fi fi3a 2f3ic. 4f3ical f3ican 4ficate f3icen fi3cer fic4i 5ficia 5ficie 4fics fi3cu fi5del fight5 fil5i fill5in 4fily 2fin 5fina fin2d5 fi2ne f1in3g fin4n fis4ti f4l2 f5less flin4 flo3re f2ly5 4fm 4fn 1fo 5fon fon4de fon4t fo2r fo5rat for5ay fore5t for4i fort5a fos5 4f5p fra4t f5rea fres5c fri2 fril4 frol5 2f3s 2ft f4to f2ty 3fu fu5el 4fug fu4min fu5ne fu3ri fusi4 fus4s 4futa 1fy 1ga gaf4 5gal. 3gali ga3lo 2gam ga5met g5amo gan5is ga3niz gani5za 4gano gar5n4 gass4 gath3 4gativ 4gaz g3b gd4 2ge. 2ged geez4 gel4in ge5lis ge5liz 4gely 1gen ge4nat ge5niz 4geno 4geny 1geo ge3om g4ery 5gesi geth5 4geto ge4ty ge4v 4g1g2 g2ge g3ger gglu5 ggo4 gh3in gh5out gh4to 5gi. 1gi4a gia5r g1ic 5gicia g4ico gien5 5gies. gil4 g3imen 3g4in. gin5ge 5g4ins 5gio 3gir gir4l g3isl gi4u 5giv 3giz gl2 gla4 glad5i 5glas 1gle gli4b g3lig 3glo glo3r g1m g4my gn4a g4na. gnet4t g1ni g2nin g4nio g1no g4non 1go 3go. gob5 5goe 3g4o4g go3is gon2 4g3o3na gondo5 go3ni 5goo go5riz gor5ou 5gos. gov1 g3p 1gr 4grada g4rai gran2 5graph. g5rapher 5graphic 4graphy 4gray gre4n 4gress. 4grit g4ro gruf4 gs2 g5ste gth3 gu4a 3guard 2gue 5gui5t 3gun 3gus 4gu4t g3w 1gy 2g5y3n gy5ra h3ab4l hach4 hae4m hae4t h5agu ha3la hala3m ha4m han4ci han4cy 5hand. han4g hang5er hang5o h5a5niz han4k han4te hap3l hap5t ha3ran ha5ras har2d hard3e har4le harp5en har5ter has5s haun4 5haz haz3a h1b 1head 3hear he4can h5ecat h4ed he5do5 he3l4i hel4lis hel4ly h5elo hem4p he2n hena4 hen5at heo5r hep5 h4era hera3p her4ba here5a h3ern h5erou h3ery h1es he2s5p he4t het4ed heu4 h1f h1h hi5an hi4co high5 h4il2 himer4 h4ina hion4e hi4p hir4l hi3ro hir4p hir4r his3el his4s hith5er hi2v 4hk 4h1l4 hlan4 h2lo hlo3ri 4h1m hmet4 2h1n h5odiz h5ods ho4g hoge4 hol5ar 3hol4e ho4ma home3 hon4a ho5ny 3hood hoon4 hor5at ho5ris hort3e ho5ru hos4e ho5sen hos1p 1hous house3 hov5el 4h5p 4hr4 hree5 hro5niz hro3po 4h1s2 h4sh h4tar ht1en ht5es h4ty hu4g hu4min hun5ke hun4t hus3t4 hu4t h1w h4wart hy3pe hy3ph hy2s 2i1a i2al iam4 iam5ete i2an 4ianc ian3i 4ian4t ia5pe iass4 i4ativ ia4tric i4atu ibe4 ib3era ib5ert ib5ia ib3in ib5it. ib5ite i1bl ib3li i5bo i1br i2b5ri i5bun 4icam 5icap 4icar i4car. i4cara icas5 i4cay iccu4 4iceo 4ich 2ici i5cid ic5ina i2cip ic3ipa i4cly i2c5oc 4i1cr 5icra i4cry ic4te ictu2 ic4t3ua ic3ula ic4um ic5uo i3cur 2id i4dai id5anc id5d ide3al ide4s i2di id5ian idi4ar i5die id3io idi5ou id1it id5iu i3dle i4dom id3ow i4dr i2du id5uo 2ie4 ied4e 5ie5ga ield3 ien5a4 ien4e i5enn i3enti i1er. i3esc i1est i3et 4if. if5ero iff5en if4fr 4ific. i3fie i3fl 4ift 2ig iga5b ig3era ight3i 4igi i3gib ig3il ig3in ig3it i4g4l i2go ig3or ig5ot i5gre igu5i ig1ur i3h 4i5i4 i3j 4ik i1la il3a4b i4lade i2l5am ila5ra i3leg il1er ilev4 il5f il1i il3ia il2ib il3io il4ist 2ilit il2iz ill5ab 4iln il3oq il4ty il5ur il3v i4mag im3age ima5ry imenta5r 4imet im1i im5ida imi5le i5mini 4imit im4ni i3mon i2mu im3ula 2in. i4n3au 4inav incel4 in3cer 4ind in5dling 2ine i3nee iner4ar i5ness 4inga 4inge in5gen 4ingi in5gling 4ingo 4ingu 2ini i5ni. i4nia in3io in1is i5nite. 5initio in3ity 4ink 4inl 2inn 2i1no i4no4c ino4s i4not 2ins in3se insur5a 2int. 2in4th in1u i5nus 4iny 2io 4io. ioge4 io2gr i1ol io4m ion3at ion4ery ion3i io5ph ior3i i4os io5th i5oti io4to i4our 2ip ipe4 iphras4 ip3i ip4ic ip4re4 ip3ul i3qua iq5uef iq3uid iq3ui3t 4ir i1ra ira4b i4rac ird5e ire4de i4ref i4rel4 i4res ir5gi ir1i iri5de ir4is iri3tu 5i5r2iz ir4min iro4g 5iron. ir5ul 2is. is5ag is3ar isas5 2is1c is3ch 4ise is3er 3isf is5han is3hon ish5op is3ib isi4d i5sis is5itiv 4is4k islan4 4isms i2so iso5mer is1p is2pi is4py 4is1s is4sal issen4 is4ses is4ta. is1te is1ti ist4ly 4istral i2su is5us 4ita. ita4bi i4tag 4ita5m i3tan i3tat 2ite it3era i5teri it4es 2ith i1ti 4itia 4i2tic it3ica 5i5tick it3ig it5ill i2tim 2itio 4itis i4tism i2t5o5m 4iton i4tram it5ry 4itt it3uat i5tud it3ul 4itz. i1u 2iv iv3ell iv3en. i4v3er. i4vers. iv5il. iv5io iv1it i5vore iv3o3ro i4v3ot 4i5w ix4o 4iy 4izar izi4 5izont 5ja jac4q ja4p 1je jer5s 4jestie 4jesty jew3 jo4p 5judg 3ka. k3ab k5ag kais4 kal4 k1b k2ed 1kee ke4g ke5li k3en4d k1er kes4 k3est. ke4ty k3f kh4 k1i 5ki. 5k2ic k4ill kilo5 k4im k4in. kin4de k5iness kin4g ki4p kis4 k5ish kk4 k1l 4kley 4kly k1m k5nes 1k2no ko5r kosh4 k3ou kro5n 4k1s2 k4sc ks4l k4sy k5t k1w lab3ic l4abo laci4 l4ade la3dy lag4n lam3o 3land lan4dl lan5et lan4te lar4g lar3i las4e la5tan 4lateli 4lativ 4lav la4v4a 2l1b lbin4 4l1c2 lce4 l3ci 2ld l2de ld4ere ld4eri ldi4 ld5is l3dr l4dri le2a le4bi left5 5leg. 5legg le4mat lem5atic 4len. 3lenc 5lene. 1lent le3ph le4pr lera5b ler4e 3lerg 3l4eri l4ero les2 le5sco 5lesq 3less 5less. l3eva lev4er. lev4era lev4ers 3ley 4leye 2lf l5fr 4l1g4 l5ga lgar3 l4ges lgo3 2l3h li4ag li2am liar5iz li4as li4ato li5bi 5licio li4cor 4lics 4lict. l4icu l3icy l3ida lid5er 3lidi lif3er l4iff li4fl 5ligate 3ligh li4gra 3lik 4l4i4l lim4bl lim3i li4mo l4im4p l4ina 1l4ine lin3ea lin3i link5er li5og 4l4iq lis4p l1it l2it. 5litica l5i5tics liv3er l1iz 4lj lka3 l3kal lka4t l1l l4law l2le l5lea l3lec l3leg l3lel l3le4n l3le4t ll2i l2lin4 l5lina ll4o lloqui5 ll5out l5low 2lm l5met lm3ing l4mod lmon4 2l1n2 3lo. lob5al lo4ci 4lof 3logic l5ogo 3logu lom3er 5long lon4i l3o3niz lood5 5lope. lop3i l3opm lora4 lo4rato lo5rie lor5ou 5los. los5et 5losophiz 5losophy los4t lo4ta loun5d 2lout 4lov 2lp lpa5b l3pha l5phi lp5ing l3pit l4pl l5pr 4l1r 2l1s2 l4sc l2se l4sie 4lt lt5ag ltane5 l1te lten4 ltera4 lth3i l5ties. ltis4 l1tr ltu2 ltur3a lu5a lu3br luch4 lu3ci lu3en luf4 lu5id lu4ma 5lumi l5umn. 5lumnia lu3o luo3r 4lup luss4 lus3te 1lut l5ven l5vet4 2l1w 1ly 4lya 4lyb ly5me ly3no 2lys4 l5yse 1ma 2mab ma2ca ma5chine ma4cl mag5in 5magn 2mah maid5 4mald ma3lig ma5lin mal4li mal4ty 5mania man5is man3iz 4map ma5rine. ma5riz mar4ly mar3v ma5sce mas4e mas1t 5mate math3 ma3tis 4matiza 4m1b mba4t5 m5bil m4b3ing mbi4v 4m5c 4me. 2med 4med. 5media me3die m5e5dy me2g mel5on mel4t me2m mem1o3 1men men4a men5ac men4de 4mene men4i mens4 mensu5 3ment men4te me5on m5ersa 2mes 3mesti me4ta met3al me1te me5thi m4etr 5metric me5trie me3try me4v 4m1f 2mh 5mi. mi3a mid4a mid4g mig4 3milia m5i5lie m4ill min4a 3mind m5inee m4ingl min5gli m5ingly min4t m4inu miot4 m2is mis4er. mis5l mis4ti m5istry 4mith m2iz 4mk 4m1l m1m mma5ry 4m1n mn4a m4nin mn4o 1mo 4mocr 5mocratiz mo2