High-performance In-browser LLM Inference Engine
This report summarizes scanner evidence for mlc-ai/web-llm, a TypeScript project with 19,340 GitHub stars. SynthScan examined 52,124 lines of code across 263 source files, recording 55 pattern matches distributed across 3 syntactic categories. The legacy adjusted pattern signal is 1.1 (Low pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Payload schema: 1.0.0 · Engine: 2.0.0 · Scoring: heuristic-density-v1 · Scan date: 2026-10-31.
Can maintainers explain intent, assumptions, and trade-offs? 48 finding(s).
Are imports declared and package/API names verified? 7 finding(s).
Are wrappers, guards, and repeated structures necessary? 42 finding(s).
Which changes need focused human review? 55 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 55 distinct pattern matches across 3 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | tests/embedding_stats.test.ts | 39 | function createEmbeddingPipelineBase(): EmbeddingLike { | CODE |
| LOW | tests/resumable_engine_integration.test.ts | 80 | function setNavigatorStorageEstimate(estimate: { | CODE |
| LOW | tests/browser/harness.js | 103 | export async function runFirstTokenReplayRegression() { | CODE |
| LOW | tests/browser/harness.js | 155 | export async function runKnownTokenForwardingRegression() { | CODE |
| LOW | tests/browser/rollup.config.js | 9 | function stubNodePerformanceImport() { | CODE |
| LOW | tests/helpers/engine_fixture.ts | 553 | export function createEngineWithMultiplePipelines() { | CODE |
| LOW | tests/helpers/engine_fixture.ts | 597 | export function createEngineWithEmbeddingPipeline() { | CODE |
| LOW | examples/simple-chat-js/index.js | 17 | function updateEngineInitProgressCallback(report) { | CODE |
| LOW | examples/resumable-generation/src/main.ts | 450 | async function startInterruptedValidationSession( | CODE |
| LOW | examples/resumable-generation/src/main.ts | 564 | async function validateWorkerStreamingResume(): Promise<unknown> { | CODE |
| LOW | examples/resumable-generation/src/main.ts | 653 | async function validateWorkerLockExclusion(): Promise<unknown> { | CODE |
| LOW | examples/json-schema/src/json_schema.ts | 12 | async function simpleStructuredTextExample() { | CODE |
| LOW | src/service_worker.ts | 191 | export async function CreateServiceWorkerMLCEngine( | CODE |
| LOW | src/artifact_manifest.ts | 278 | function parseAudioDecodeProcessor( | CODE |
| LOW | src/artifact_manifest.ts | 335 | function parseImageDecodeProcessor( | CODE |
| LOW | src/artifact_manifest.ts | 489 | export function parseModelPackageManifest( | CODE |
| LOW | src/artifact_manifest.ts | 546 | export function resolveModelPackageResourceURLs( | CODE |
| LOW | src/artifact_manifest.ts | 565 | export function parseCompiledProgramArtifact( | CODE |
| LOW | src/artifact_manifest.ts | 664 | export function resolveChatCompletionArtifact( | CODE |
| LOW | src/engine.ts | 107 | function countTrailingReplacementChar(value: string): number { | CODE |
| LOW | src/conversation.ts | 545 | export function compareConversationObject( | CODE |
| LOW | src/conversation.ts | 663 | export function getConversationFromChatCompletionRequest( | CODE |
| LOW⚡ | src/cache_util.ts | 30 | export function getTensorCacheAccessOptions( | CODE |
| LOW⚡ | src/cache_util.ts | 40 | function createScopedArtifactCache( | CODE |
| LOW⚡ | src/cache_util.ts | 47 | async function maybeVerifyTokenizerIntegrity( | CODE |
| LOW | src/cache_util.ts | 84 | export async function deleteModelAllInfoInCache( | CODE |
| LOW | src/config.ts | 169 | export function postInitAndCheckGenerationConfigValues( | CODE |
| LOW | src/support.ts | 78 | export function getTokenTableFromTokenizer(tokenizer: Tokenizer): string[] { | CODE |
| LOW⚡ | src/support.ts | 132 | export function getToolCallFromOutputMessage( | CODE |
| LOW⚡ | src/support.ts | 136 | export function getToolCallFromOutputMessage( | CODE |
| LOW⚡ | src/support.ts | 140 | export function getToolCallFromOutputMessage( | CODE |
| LOW | src/support.ts | 286 | export function getChunkedPrefillInputData( | CODE |
| LOW | src/support.ts | 487 | export async function getResizedRGBArrayFromURL( | CODE |
| LOW | src/extension_service_worker.ts | 118 | export async function CreateServiceWorkerMLCEngine( | CODE |
| LOW | src/openai_api_protocols/completion.ts | 341 | export function rejectCompletionResumable( | CODE |
| LOW | src/resumable/checkpoint_writer.ts | 295 | export async function readResumableCheckpointPayload( | CODE |
| LOW | src/resumable/replay.ts | 110 | export function getResumableGenerationConfig( | CODE |
| LOW | src/resumable/replay.ts | 123 | export function hasUnsupportedGrammarReplay( | CODE |
| LOW | src/resumable/generation.ts | 80 | export function normalizeResumableGenerationConfig( | CODE |
| LOW | src/resumable/coordinator.ts | 257 | function normalizeCheckpointInterval( | CODE |
| LOW | src/resumable/coordinator.ts | 267 | function shouldCaptureDecodeCheckpoint( | CODE |
| LOW | src/resumable/coordinator.ts | 299 | function isChatCompletionReplayRequest( | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/simple-chat-js/index.js | 80 | .setAttribute("placeholder", "Generating..."); | CODE |
| LOW | examples/simple-chat-ts/src/simple_chat.ts | 279 | this.uiChatInput.setAttribute("placeholder", "Generating..."); | CODE |
| LOW | examples/simple-chat-ts/src/simple_chat.ts | 324 | this.uiChatInput.setAttribute("placeholder", "Enter your message..."); | CODE |
| LOW | examples/simple-chat-upload/src/simple_chat.ts | 279 | this.uiChatInput.setAttribute("placeholder", "Generating..."); | CODE |
| LOW | examples/simple-chat-upload/src/simple_chat.ts | 318 | this.uiChatInput.setAttribute("placeholder", "Enter your message..."); | CODE |
| LOW | examples/next-simple-chat/src/utils/chat_ui.ts | 110 | // this.uiChatInput.setAttribute("placeholder", "Generating..."); | COMMENT |
| LOW | examples/next-simple-chat/src/pages/api/hello.ts | 12 | res.status(200).json({ name: "John Doe" }); | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | examples/subgroups-usage/src/subgroups_usage.ts | 81 | // const appConfig: webllm.AppConfig = { | COMMENT |
| LOW | examples/subgroups-usage/src/subgroups_usage.ts | 101 | // const engine: webllm.MLCEngineInterface = await webllm.CreateMLCEngine( | COMMENT |
| LOW | examples/get-started/src/get_started.ts | 21 | logLevel: "INFO", // specify the log level | COMMENT |
| LOW | examples/get-started/src/get_started.ts | 41 | // overrides: { | COMMENT |
| LOW | src/llm_chat.ts | 301 | // be reinitialized since `this.tokenizer` does not change throughout the lifetime of LLMChatPipeline. | COMMENT |
| LOW | src/config.ts | 501 | // model_id: "DeepSeek-R1-Distill-Qwen-1.5B-q4f16_1-MLC", | COMMENT |