Skip to content

Capabilities · Voice / Vision / Web / MCP ​

The capability layer unifies "the senses and hands beyond the model": TTS, ASR, OCR, vision, web search/fetch, and MCP external tools. Every capability has an explicit engine choice, hard limits and an egress record — cloud keys enable egress; without them a local engine runs or the call fails explicitly. Never silent fake data.

Speech synthesis (TTS) ​

EngineTriggerDetails
deepseek-ttsDeepSeek key configuredPOST /v1/tools/tts; voices stella / tide; formats wav / pcm; filter_markdown: true; 120 s timeout
IFG_TTS_CMDcustom command env varlocal synthesis port; the command picks the engine
macos-saymacOS fallbacksay --data-format=LEI16@22050 emits 16-bit PCM WAV (decodable by every browser), 60 s timeout
nonenone of the above503 "no TTS engine configured", no fake synthesis

Billing chars (billingChars): CJK characters count as 2, others as 1; per-call caps 10,000 billing chars and a 64 KiB request body. Usage bills chars / 1000 × ttsPer1kChars (default 0.0208, editable in service settings) into the usage and egress ledgers.

Speech recognition (ASR) ​

  • Cloud engine is DeepSeek ASR only: audio ≤8 MiB per segment; multipart upload ≤12 MB overall.
  • No key → 400 asr_not_configured (pointing at Services & Keys), never a silent transcript.
  • Local/demo engines are labeled mock-asr; transcripts carry an engine field so UI and reports can tell real from mock.
  • Glossary correction (asr-glossary): post-transcript substitution against the role glossary, returning corrections.applied detail.
  • Language IFG_ASR_LANGUAGE (default zh-CN); recordings persist in recordings; transcripts are editable (editable: true).
  • Billing seconds / 60 × asrPerMinute (default 0.006).

OCR and vision ​

  • OCR: single file ≤100 MiB; purpose whitelist text_recognition / rich_layout_recognition; local port IFG_OCR_CMD (receives the image path as {file}), errors when unconfigured.
  • Vision: deepseek-flash with OpenAI-style image_url content blocks; MIME whitelist jpeg / png / gif / webp; image ≤32 MiB; max_tokens: 1200.

Web search and fetch ​

  • Search: count clamped to 1–50; need_content: false keeps hit summaries only; without cloud search it falls back to Bing (IFG_SEARCH_ENDPOINT overridable).
  • Fetch: returns Markdown body truncated to 200,000 chars; persists a web_snapshots row with id W + sha256(text)[0:12] — same text, same id, so citations can point back at the snapshot.
  • SSRF guard: assertFetchableUrl rejects private/loopback/metadata addresses; redirects are followed hop by hop manually (redirect: 'manual'), re-running the guard on every Location, capped at 5 hops — a public page 302-ing into the intranet is still blocked. IFG_ALLOW_PRIVATE_FETCH=1 is an explicit opt-out.
  • Web timing is enforced at the tool layer by webTiming (off / prepare / live / auto).

MCP external tools ​

  • Transports: http (URL) and stdio (command, spawned via /bin/sh -c, detached).
  • Handshake: protocolVersion: 2024-11-05, clientInfo: interviewforge-agent-host 0.4.0.
  • stdio stdout buffer has an 8 MiB guard, failing past it so a hostile server cannot flood memory.
  • disabled_tools disables tools per server; approval_mode: auto | confirm — confirm mode requires user approval before a call (tool_approvals).
  • Every mcp.list / mcp.call writes an audit row; egress for MCP calls is decided by the server address and recorded in the ledger.

Egress boundary ​

All capability calls are recorded via capability routes (capability_routes) and the egress ledger (egress): who, when, to which target, at what cost. Local-first ≠ purely local: capabilities with cloud keys configured do egress; without them a local engine runs or the call returns an explicit 4xx/5xx — never fabricated results. See Auth & Security and Providers & Routing.

Structure at a glance ​

Figure 1 · One capability layer, each capability choosing its engine and egress

Local-first · inference egresses on demand · fully traceable