SYMBOL INDEX (621 symbols across 41 files) FILE: finetune/convert_gguf.py function run_cmd (line 60) | def run_cmd(cmd, description): function main (line 76) | def main(): FILE: finetune/convert_onnx.py function merge_adapters (line 69) | def merge_adapters(base_model: str, sft_model: str, grpo_model: str) -> ... function export_onnx (line 88) | def export_onnx(model, tokenizer, output_dir: str): function _find_onnx_model (line 116) | def _find_onnx_model(onnx_dir: str) -> Path: function quantize_onnx (line 127) | def quantize_onnx(onnx_dir: str, quantize_type: str): function _quantize_q4 (line 144) | def _quantize_q4(model_path: Path): function _quantize_q8 (line 169) | def _quantize_q8(model_path: Path): function _convert_fp16 (line 189) | def _convert_fp16(model_path: Path): function _report_size (line 210) | def _report_size(path: Path): function validate_onnx (line 217) | def validate_onnx(onnx_dir: str, base_model: str): function write_transformers_js_config (line 294) | def write_transformers_js_config(onnx_dir: str, quantize_type: str = "q4"): function upload_to_hub (line 305) | def upload_to_hub( function main (line 373) | def main(): FILE: finetune/dataset/analyze_data.py class DatasetStats (line 28) | class DatasetStats: function categorize_query (line 43) | def categorize_query(query: str) -> str: function extract_named_entities (line 71) | def extract_named_entities(query: str) -> list: function analyze_examples (line 84) | def analyze_examples(examples: list[TrainingExample]) -> tuple[DatasetSt... function print_report (line 131) | def print_report(stats: DatasetStats, categories: dict, category_example... function main (line 196) | def main(): FILE: finetune/dataset/prepare_data.py function get_tokenizer (line 37) | def get_tokenizer(): function format_for_training (line 46) | def format_for_training(ex: TrainingExample) -> dict: function main (line 81) | def main(): FILE: finetune/dataset/schema.py class OutputType (line 35) | class OutputType(str, Enum): class OutputPair (line 44) | class OutputPair(BaseModel): method text_not_empty (line 54) | def text_not_empty(cls, v: str) -> str: method to_list (line 59) | def to_list(self) -> list[str]: function _coerce_output_pairs (line 63) | def _coerce_output_pairs(v: list) -> list[OutputPair]: class TrainingExample (line 82) | class TrainingExample(BaseModel): method query_not_empty (line 97) | def query_not_empty(cls, v: str) -> str: method output_not_empty (line 104) | def output_not_empty(cls, v: list[OutputPair]) -> list[OutputPair]: method output_as_lists (line 109) | def output_as_lists(self) -> list[list[str]]: function load_examples (line 118) | def load_examples(path: str | Path) -> list[TrainingExample]: function parse_output_text (line 142) | def parse_output_text(text: str) -> list[list[str]]: function reorder_hyde_first (line 162) | def reorder_hyde_first(items: list[list[str]]) -> list[list[str]]: function output_items_to_text (line 170) | def output_items_to_text( function normalize_output_items (line 204) | def normalize_output_items( function has_type (line 237) | def has_type(items: Iterable, kind: str) -> bool: FILE: finetune/dataset/score_data.py function score_file (line 20) | def score_file(path: Path) -> tuple[int, int, list[float], dict]: function main (line 48) | def main() -> int: FILE: finetune/dataset/validate_schema.py function validate_file (line 19) | def validate_file(path: Path) -> tuple[int, int]: function main (line 45) | def main() -> int: FILE: finetune/eval.py function load_model (line 35) | def load_model(model_path: str): function generate_batch (line 77) | def generate_batch( function main (line 118) | def main(): FILE: finetune/experiments/gepa/dspy_gepa.py function _import_dspy (line 13) | def _import_dspy(): class ExpandSignature (line 34) | class ExpandSignature(dspy.Signature): class Expander (line 49) | class Expander(dspy.Module): method __init__ (line 50) | def __init__(self): method forward (line 54) | def forward(self, query: str): function reward_metric (line 58) | def reward_metric(gold, pred, trace=None, pred_name=None, pred_trace=None): function load_queries (line 66) | def load_queries(path: Path) -> list[str]: function to_examples (line 80) | def to_examples(queries: list[str]) -> list[dspy.Example]: function _coerce_output_items (line 84) | def _coerce_output_items(pred) -> list[list[str]]: function write_jsonl (line 106) | def write_jsonl(path: Path, queries: list[str], outputs: list[list[list[... function main (line 112) | def main() -> int: FILE: finetune/experiments/gepa/example.py class SearchType (line 13) | class SearchType(str, Enum): class OutputItem (line 27) | class OutputItem: method __post_init__ (line 37) | def __post_init__(self) -> None: method to_pair (line 48) | def to_pair(self) -> list[str]: class Example (line 53) | class Example: method __post_init__ (line 59) | def __post_init__(self) -> None: method to_json (line 66) | def to_json(self) -> dict: method to_jsonl (line 72) | def to_jsonl(self) -> str: function parse_output_items (line 76) | def parse_output_items(raw_output: Iterable[Iterable[str]]) -> list[Outp... function example_from_json (line 95) | def example_from_json(obj: dict) -> Example: function load_jsonl (line 104) | def load_jsonl(path: str | Path) -> list[Example]: FILE: finetune/experiments/gepa/generate.py function _import_dspy (line 13) | def _import_dspy(): function load_topics (line 32) | def load_topics(path: Path) -> list[str]: function write_jsonl_line (line 53) | def write_jsonl_line(handle, query: str, output_text: str) -> None: function parse_queries (line 58) | def parse_queries(text: str) -> list[str]: function main (line 68) | def main() -> int: FILE: finetune/experiments/gepa/optimizer.py function build_prompt (line 13) | def build_prompt() -> str: function write_model_json (line 34) | def write_model_json(path: Path) -> None: function main (line 52) | def main() -> int: FILE: finetune/experiments/gepa/score.py function score_file (line 17) | def score_file(path: Path) -> tuple[int, int, list[float], dict]: function main (line 50) | def main() -> int: FILE: finetune/experiments/grpo/grpo.py function main (line 54) | def main(): FILE: finetune/jobs/eval.py function parse_expansion (line 108) | def parse_expansion(text): function clean_model_output (line 125) | def clean_model_output(text): function extract_named_entities (line 133) | def extract_named_entities(query): function get_key_terms (line 157) | def get_key_terms(query): function lex_preserves_key_terms (line 161) | def lex_preserves_key_terms(lex_line, query): function lex_preserves_entities (line 166) | def lex_preserves_entities(line, entities): function lex_is_generic (line 171) | def lex_is_generic(lex_line): function word_set_distance (line 183) | def word_set_distance(a, b): function is_diverse (line 187) | def is_diverse(a, b, min_distance=2): function echoes_query (line 193) | def echoes_query(expansion, query): function word_repetition_penalty (line 198) | def word_repetition_penalty(text): function score_expansion_detailed (line 204) | def score_expansion_detailed(query, expansion): function load_model (line 312) | def load_model(base, sft=None, grpo=None): function generate_expansion (line 336) | def generate_expansion(model, tokenizer, query, max_new_tokens=200): function results_to_csv (line 366) | def results_to_csv(results, label): function upload_csv (line 386) | def upload_csv(results, label, repo_id, api): function evaluate_model (line 401) | def evaluate_model(model, tokenizer, label): function main (line 437) | def main(): FILE: finetune/jobs/eval_common.py function parse_expansion (line 42) | def parse_expansion(text): function clean_model_output (line 59) | def clean_model_output(text): function extract_named_entities (line 67) | def extract_named_entities(query): function get_key_terms (line 91) | def get_key_terms(query): function lex_preserves_key_terms (line 95) | def lex_preserves_key_terms(lex_line, query): function lex_preserves_entities (line 100) | def lex_preserves_entities(line, entities): function lex_is_generic (line 106) | def lex_is_generic(lex_line): function word_set_distance (line 118) | def word_set_distance(a, b): function is_diverse (line 122) | def is_diverse(a, b, min_distance=2): function echoes_query (line 129) | def echoes_query(expansion, query): function word_repetition_penalty (line 134) | def word_repetition_penalty(text): function score_expansion (line 140) | def score_expansion(query, expansion): function extract_query_from_prompt (line 218) | def extract_query_from_prompt(prompt): class QMDRewardFunction (line 228) | class QMDRewardFunction: method __call__ (line 232) | def __call__(self, completions, prompts=None, **kwargs): function generate_expansion (line 285) | def generate_expansion(model, tokenizer, query, max_new_tokens=200): function run_eval (line 305) | def run_eval(model, tokenizer, label, upload_repo="tobil/qmd-query-expan... FILE: finetune/reward.py function parse_expansion (line 90) | def parse_expansion(text: str) -> dict: function detect_only_mode (line 108) | def detect_only_mode(query: str) -> tuple[str | None, str]: function clean_model_output (line 121) | def clean_model_output(text: str) -> tuple[str, bool]: function extract_named_entities (line 140) | def extract_named_entities(query: str) -> set: function get_key_terms (line 196) | def get_key_terms(query: str) -> set: function lex_preserves_key_terms (line 201) | def lex_preserves_key_terms(lex_line: str, query: str) -> bool: function lex_preserves_entities (line 209) | def lex_preserves_entities(line: str, entities: set) -> bool: function lex_has_filler (line 217) | def lex_has_filler(lex_line: str, query: str) -> bool: function lex_is_generic (line 224) | def lex_is_generic(lex_line: str) -> bool: function word_set_distance (line 237) | def word_set_distance(a: str, b: str) -> int: function is_diverse (line 242) | def is_diverse(a: str, b: str, min_distance: int = 2) -> bool: function echoes_query (line 250) | def echoes_query(expansion: str, query: str) -> bool: function word_repetition_penalty (line 256) | def word_repetition_penalty(text: str) -> int: function _score_only_mode (line 267) | def _score_only_mode(query: str, base_query: str, text: str, used_thinki... function score_expansion_detailed (line 408) | def score_expansion_detailed(query: str, expansion: str) -> dict: function score_expansion (line 628) | def score_expansion(query: str, expansion: str) -> float: function extract_query_from_prompt (line 634) | def extract_query_from_prompt(prompt: str) -> str: class QMDRewardFunction (line 648) | class QMDRewardFunction: method __call__ (line 652) | def __call__(self, completions: list[str], prompts: list[str] = None, ... FILE: finetune/train.py function export_gguf (line 42) | def export_gguf(model, tokenizer, output_dir: str, model_name: str): class TimedSaveCallback (line 161) | class TimedSaveCallback(TrainerCallback): method __init__ (line 164) | def __init__(self, interval_minutes: float): method on_step_end (line 168) | def on_step_end(self, args, state, control, **kwargs): function run_eval (line 179) | def run_eval(model_path: str) -> float | None: function cmd_sft (line 208) | def cmd_sft(args): function cmd_grpo (line 413) | def cmd_grpo(args): function main (line 648) | def main(): FILE: src/bench-rerank.ts constant RERANK_MODEL (line 29) | const RERANK_MODEL = "hf:ggml-org/Qwen3-Reranker-0.6B-Q8_0-GGUF/qwen3-re... constant MODEL_CACHE (line 30) | const MODEL_CACHE = join(homedir(), ".cache", "qmd", "models"); constant CONTEXT_SIZE (line 31) | const CONTEXT_SIZE = 2048; constant DOC_COUNT (line 36) | const DOC_COUNT = docsIdx >= 0 ? parseInt(args[docsIdx + 1]!) : (quick ?... constant ITERATIONS (line 37) | const ITERATIONS = quick ? 1 : 3; constant PARALLEL_CONFIGS (line 38) | const PARALLEL_CONFIGS = quick ? [1, 4] : [1, 2, 4, 8]; constant QUERY (line 44) | const QUERY = "How do AI agents work and what are their limitations?"; function generateDocs (line 46) | function generateDocs(n: number): string[] { function formatBytes (line 66) | function formatBytes(bytes: number): string { function getMemUsage (line 72) | function getMemUsage(): { rss: number; heapUsed: number } { function median (line 77) | function median(arr: number[]): number { type BenchResult (line 87) | interface BenchResult { function benchmarkConfig (line 99) | async function benchmarkConfig( function main (line 189) | async function main() { FILE: src/cli/formatter.ts type MultiGetFile (line 19) | type MultiGetFile = { type OutputFormat (line 36) | type OutputFormat = "cli" | "csv" | "md" | "xml" | "files" | "json"; type FormatOptions (line 38) | type FormatOptions = { function addLineNumbers (line 56) | function addLineNumbers(text: string, startLine: number = 1): string { function getDocid (line 64) | function getDocid(hash: string): string { function escapeCSV (line 72) | function escapeCSV(value: string | null | number): string { function escapeXml (line 81) | function escapeXml(str: string): string { function searchResultsToJson (line 97) | function searchResultsToJson( function searchResultsToCsv (line 128) | function searchResultsToCsv( function searchResultsToFiles (line 157) | function searchResultsToFiles(results: SearchResult[]): string { function searchResultsToMarkdown (line 167) | function searchResultsToMarkdown( function searchResultsToXml (line 192) | function searchResultsToXml( function searchResultsToMcpCsv (line 213) | function searchResultsToMcpCsv( function documentsToJson (line 230) | function documentsToJson(results: MultiGetFile[]): string { function documentsToCsv (line 243) | function documentsToCsv(results: MultiGetFile[]): string { function documentsToFiles (line 260) | function documentsToFiles(results: MultiGetFile[]): string { function documentsToMarkdown (line 271) | function documentsToMarkdown(results: MultiGetFile[]): string { function documentsToXml (line 288) | function documentsToXml(results: MultiGetFile[]): string { function documentToJson (line 313) | function documentToJson(doc: DocumentResult): string { function documentToMarkdown (line 328) | function documentToMarkdown(doc: DocumentResult): string { function documentToXml (line 342) | function documentToXml(doc: DocumentResult): string { function formatDocument (line 360) | function formatDocument(doc: DocumentResult, format: OutputFormat): stri... function formatSearchResults (line 381) | function formatSearchResults( function formatDocuments (line 409) | function formatDocuments( FILE: src/cli/qmd.ts function getStore (line 113) | function getStore(): ReturnType { function getDb (line 127) | function getDb(): Database { function resyncConfig (line 132) | function resyncConfig(): void { function closeDb (line 144) | function closeDb(): void { function getDbPath (line 151) | function getDbPath(): string { function setIndexName (line 155) | function setIndexName(name: string | null): void { function ensureVecTable (line 170) | function ensureVecTable(_db: Database, dimensions: number): void { method hide (line 190) | hide() { process.stderr.write('\x1b[?25l'); } method show (line 191) | show() { process.stderr.write('\x1b[?25h'); } method set (line 201) | set(percent: number) { method clear (line 204) | clear() { method indeterminate (line 207) | indeterminate() { method error (line 210) | error() { function formatETA (line 216) | function formatETA(seconds: number): string { function checkIndexHealth (line 224) | function checkIndexHealth(db: Database): void { function computeDisplayPath (line 245) | function computeDisplayPath( function formatTimeAgo (line 280) | function formatTimeAgo(date: Date): string { function formatMs (line 291) | function formatMs(ms: number): string { function formatBytes (line 296) | function formatBytes(bytes: number): string { function showStatus (line 303) | async function showStatus(): Promise { function updateCollections (line 497) | async function updateCollections(): Promise { function detectCollectionFromPath (line 594) | function detectCollectionFromPath(db: Database, fsPath: string): { colle... function contextAdd (line 626) | async function contextAdd(pathArg: string | undefined, contextText: stri... function contextList (line 692) | function contextList(): void { function contextRemove (line 720) | function contextRemove(pathArg: string): void { function getDocument (line 786) | function getDocument(filename: string, fromLine?: number, maxLines?: num... function multiGet (line 967) | function multiGet(pattern: string, maxLines?: number, maxBytes: number =... function listFiles (line 1201) | function listFiles(pathArg?: string): void { function formatLsTime (line 1323) | function formatLsTime(date: Date): string { function collectionList (line 1343) | function collectionList(): void { function collectionAdd (line 1377) | async function collectionAdd(pwd: string, globPattern: string, name?: st... function collectionRemove (line 1417) | function collectionRemove(name: string): void { function collectionRename (line 1439) | function collectionRename(oldName: string, newName: string): void { function indexFiles (line 1466) | async function indexFiles(pwd?: string, globPattern: string = DEFAULT_GL... function renderProgressBar (line 1604) | function renderProgressBar(percent: number, width: number = 30): string { function parseEmbedBatchOption (line 1611) | function parseEmbedBatchOption(name: string, value: unknown): number | u... function vectorIndex (line 1620) | async function vectorIndex( function sanitizeFTS5Term (line 1695) | function sanitizeFTS5Term(term: string): string { function buildFTS5Query (line 1701) | function buildFTS5Query(query: string): string { function normalizeBM25 (line 1727) | function normalizeBM25(score: number): number { type OutputOptions (line 1736) | type OutputOptions = { function highlightTerms (line 1752) | function highlightTerms(text: string, query: string): string { function formatScore (line 1764) | function formatScore(score: number): string { function formatExplainNumber (line 1772) | function formatExplainNumber(value: number): string { function shortPath (line 1777) | function shortPath(dirpath: string): string { type EmptySearchReason (line 1785) | type EmptySearchReason = "no_results" | "min_score"; function printEmptySearchResults (line 1788) | function printEmptySearchResults(format: OutputFormat, reason: EmptySear... type OutputRow (line 1812) | type OutputRow = { function outputResults (line 1825) | function outputResults(results: OutputRow[], query: string, opts: Output... function resolveCollectionFilter (line 1969) | function resolveCollectionFilter(raw: string | string[] | undefined, use... function filterByCollections (line 1990) | function filterByCollections { FILE: src/collections.ts type ContextMap (line 22) | type ContextMap = Record; type Collection (line 27) | interface Collection { type CollectionConfig (line 39) | interface CollectionConfig { type NamedCollection (line 47) | interface NamedCollection extends Collection { function setConfigSource (line 67) | function setConfigSource(source?: { configPath?: string; config?: Collec... function setConfigIndexName (line 89) | function setConfigIndexName(name: string): void { function getConfigDir (line 102) | function getConfigDir(): string { function getConfigFilePath (line 114) | function getConfigFilePath(): string { function ensureConfigDir (line 121) | function ensureConfigDir(): void { function loadConfig (line 138) | function loadConfig(): CollectionConfig { function saveConfig (line 170) | function saveConfig(config: CollectionConfig): void { function getCollection (line 198) | function getCollection(name: string): NamedCollection | null { function listCollections (line 212) | function listCollections(): NamedCollection[] { function getDefaultCollections (line 223) | function getDefaultCollections(): NamedCollection[] { function getDefaultCollectionNames (line 230) | function getDefaultCollectionNames(): string[] { function updateCollectionSettings (line 237) | function updateCollectionSettings( function addCollection (line 269) | function addCollection( function removeCollection (line 288) | function removeCollection(name: string): boolean { function renameCollection (line 303) | function renameCollection(oldName: string, newName: string): boolean { function getGlobalContext (line 327) | function getGlobalContext(): string | undefined { function setGlobalContext (line 335) | function setGlobalContext(context: string | undefined): void { function getContexts (line 344) | function getContexts(collectionName: string): ContextMap | undefined { function addContext (line 352) | function addContext( function removeContext (line 376) | function removeContext( function listAllContexts (line 401) | function listAllContexts(): Array<{ function findContextForPath (line 438) | function findContextForPath( function getConfigPath (line 479) | function getConfigPath(): string { function configExists (line 487) | function configExists(): boolean { function isValidCollectionName (line 497) | function isValidCollectionName(name: string): boolean { FILE: src/db.ts function openDatabase (line 61) | function openDatabase(path: string): Database { type Database (line 68) | interface Database { type Statement (line 75) | interface Statement { function loadSqliteVec (line 87) | function loadSqliteVec(db: Database): void { FILE: src/embedded-skills.ts type EmbeddedSkillFile (line 3) | type EmbeddedSkillFile = { constant EMBEDDED_QMD_SKILL_BASE64 (line 8) | const EMBEDDED_QMD_SKILL_BASE64: Record = { function getEmbeddedQmdSkillFiles (line 13) | function getEmbeddedQmdSkillFiles(): EmbeddedSkillFile[] { function getEmbeddedQmdSkillContent (line 20) | function getEmbeddedQmdSkillContent(): string { FILE: src/index.ts type UpdateProgress (line 123) | type UpdateProgress = { type UpdateResult (line 133) | type UpdateResult = { type SearchOptions (line 145) | interface SearchOptions { type LexSearchOptions (line 169) | interface LexSearchOptions { type VectorSearchOptions (line 177) | interface VectorSearchOptions { type ExpandQueryOptions (line 185) | interface ExpandQueryOptions { type StoreOptions (line 196) | interface StoreOptions { type QMDStore (line 212) | interface QMDStore { function createStore (line 333) | async function createStore(options: StoreOptions): Promise { FILE: src/llm.ts function isQwen3EmbeddingModel (line 29) | function isQwen3EmbeddingModel(modelUri: string): boolean { function formatQueryForEmbedding (line 38) | function formatQueryForEmbedding(query: string, modelUri?: string): stri... function formatDocForEmbedding (line 51) | function formatDocForEmbedding(text: string, title?: string, modelUri?: ... type TokenLogProb (line 67) | type TokenLogProb = { type EmbeddingResult (line 75) | type EmbeddingResult = { type GenerateResult (line 83) | type GenerateResult = { type RerankDocumentResult (line 93) | type RerankDocumentResult = { type RerankResult (line 102) | type RerankResult = { type ModelInfo (line 110) | type ModelInfo = { type EmbedOptions (line 119) | type EmbedOptions = { type GenerateOptions (line 128) | type GenerateOptions = { type RerankOptions (line 137) | type RerankOptions = { type LLMSessionOptions (line 144) | type LLMSessionOptions = { type ILLMSession (line 156) | interface ILLMSession { type QueryType (line 170) | type QueryType = 'lex' | 'vec' | 'hyde'; type Queryable (line 175) | type Queryable = { type RerankDocument (line 183) | type RerankDocument = { constant DEFAULT_EMBED_MODEL (line 196) | const DEFAULT_EMBED_MODEL = process.env.QMD_EMBED_MODEL ?? "hf:ggml-org/... constant DEFAULT_RERANK_MODEL (line 197) | const DEFAULT_RERANK_MODEL = "hf:ggml-org/Qwen3-Reranker-0.6B-Q8_0-GGUF/... constant DEFAULT_GENERATE_MODEL (line 199) | const DEFAULT_GENERATE_MODEL = "hf:tobil/qmd-query-expansion-1.7B-gguf/q... constant LFM2_GENERATE_MODEL (line 204) | const LFM2_GENERATE_MODEL = "hf:LiquidAI/LFM2-1.2B-GGUF/LFM2-1.2B-Q4_K_M... constant LFM2_INSTRUCT_MODEL (line 205) | const LFM2_INSTRUCT_MODEL = "hf:LiquidAI/LFM2.5-1.2B-Instruct-GGUF/LFM2.... constant DEFAULT_EMBED_MODEL_URI (line 207) | const DEFAULT_EMBED_MODEL_URI = DEFAULT_EMBED_MODEL; constant DEFAULT_RERANK_MODEL_URI (line 208) | const DEFAULT_RERANK_MODEL_URI = DEFAULT_RERANK_MODEL; constant DEFAULT_GENERATE_MODEL_URI (line 209) | const DEFAULT_GENERATE_MODEL_URI = DEFAULT_GENERATE_MODEL; constant MODEL_CACHE_DIR (line 212) | const MODEL_CACHE_DIR = join(homedir(), ".cache", "qmd", "models"); constant DEFAULT_MODEL_CACHE_DIR (line 213) | const DEFAULT_MODEL_CACHE_DIR = MODEL_CACHE_DIR; type PullResult (line 215) | type PullResult = { type HfRef (line 222) | type HfRef = { function parseHfUri (line 227) | function parseHfUri(model: string): HfRef | null { function getRemoteEtag (line 237) | async function getRemoteEtag(ref: HfRef): Promise { function pullModels (line 249) | async function pullModels( type LLM (line 314) | interface LLM { type LlamaCppConfig (line 352) | type LlamaCppConfig = { constant DEFAULT_INACTIVITY_TIMEOUT_MS (line 383) | const DEFAULT_INACTIVITY_TIMEOUT_MS = 5 * 60 * 1000; constant DEFAULT_EXPAND_CONTEXT_SIZE (line 384) | const DEFAULT_EXPAND_CONTEXT_SIZE = 2048; function resolveExpandContextSize (line 386) | function resolveExpandContextSize(configValue?: number): number { class LlamaCpp (line 407) | class LlamaCpp implements LLM { method constructor (line 436) | constructor(config: LlamaCppConfig = {}) { method touchActivity (line 450) | private touchActivity(): void { method hasLoadedContexts (line 480) | private hasLoadedContexts(): boolean { method unloadIdleResources (line 490) | async unloadIdleResources(): Promise { method ensureModelCacheDir (line 538) | private ensureModelCacheDir(): void { method ensureLlama (line 547) | private async ensureLlama(): Promise { method resolveModel (line 568) | private async resolveModel(modelUri: string): Promise { method ensureEmbedModel (line 577) | private async ensureEmbedModel(): Promise { method computeParallelism (line 611) | private async computeParallelism(perContextMB: number): Promise { method threadsPerContext (line 635) | private async threadsPerContext(parallelism: number): Promise { method ensureEmbedContexts (line 648) | private async ensureEmbedContexts(): Promise { method ensureEmbedContext (line 687) | private async ensureEmbedContext(): Promise { method ensureGenerateModel (line 695) | private async ensureGenerateModel(): Promise { method ensureRerankModel (line 725) | private async ensureRerankModel(): Promise { method ensureRerankContexts (line 763) | private async ensureRerankContexts(): Promise { method countTokens (line 815) | async countTokens(text: string): Promise { method detokenize (line 823) | async detokenize(tokens: readonly LlamaToken[]): Promise { method truncateToContextSize (line 841) | private async truncateToContextSize(text: string): Promise<{ text: str... method embed (line 857) | async embed(text: string, options: EmbedOptions = {}): Promise { method generate (line 953) | async generate(prompt: string, options: GenerateOptions = {}): Promise... method modelExists (line 994) | async modelExists(modelUri: string): Promise { method expandQuery (line 1013) | async expandQuery(query: string, options: { context?: string, includeL... method rerank (line 1106) | async rerank( method getDeviceInfo (line 1205) | async getDeviceInfo(): Promise<{ method dispose (line 1230) | async dispose(): Promise { class LLMSessionManager (line 1276) | class LLMSessionManager { method constructor (line 1281) | constructor(llm: LlamaCpp) { method activeSessionCount (line 1285) | get activeSessionCount(): number { method inFlightOperations (line 1289) | get inFlightOperations(): number { method canUnload (line 1297) | canUnload(): boolean { method acquire (line 1301) | acquire(): void { method release (line 1305) | release(): void { method operationStart (line 1309) | operationStart(): void { method operationEnd (line 1313) | operationEnd(): void { method getLlamaCpp (line 1317) | getLlamaCpp(): LlamaCpp { class SessionReleasedError (line 1325) | class SessionReleasedError extends Error { method constructor (line 1326) | constructor(message = "LLM session has been released or aborted") { class LLMSession (line 1336) | class LLMSession implements ILLMSession { method constructor (line 1343) | constructor(manager: LLMSessionManager, options: LLMSessionOptions = {... method isValid (line 1372) | get isValid(): boolean { method signal (line 1376) | get signal(): AbortSignal { method release (line 1384) | release(): void { method withOperation (line 1400) | private async withOperation(fn: () => Promise): Promise { method embed (line 1419) | async embed(text: string, options?: EmbedOptions): Promise { method expandQuery (line 1427) | async expandQuery( method rerank (line 1434) | async rerank( function getSessionManager (line 1449) | function getSessionManager(): LLMSessionManager { function withLLMSession (line 1471) | async function withLLMSession( function withLLMSessionForLlm (line 1489) | async function withLLMSessionForLlm( function canUnloadLLM (line 1508) | function canUnloadLLM(): boolean { function getDefaultLlamaCpp (line 1522) | function getDefaultLlamaCpp(): LlamaCpp { function setDefaultLlamaCpp (line 1533) | function setDefaultLlamaCpp(llm: LlamaCpp | null): void { function disposeDefaultLlamaCpp (line 1541) | async function disposeDefaultLlamaCpp(): Promise { FILE: src/maintenance.ts class Maintenance (line 18) | class Maintenance { method constructor (line 21) | constructor(store: Store) { method vacuum (line 26) | vacuum(): void { method cleanupOrphanedContent (line 31) | cleanupOrphanedContent(): number { method cleanupOrphanedVectors (line 36) | cleanupOrphanedVectors(): number { method clearLLMCache (line 41) | clearLLMCache(): number { method deleteInactiveDocs (line 46) | deleteInactiveDocs(): number { method clearEmbeddings (line 51) | clearEmbeddings(): void { FILE: src/mcp/server.ts type SearchResultItem (line 34) | type SearchResultItem = { type StatusResult (line 43) | type StatusResult = { function encodeQmdPath (line 64) | function encodeQmdPath(path: string): string { function formatSearchSummary (line 72) | function formatSearchSummary(results: SearchResultItem[], query: string)... function buildInstructions (line 92) | async function buildInstructions(store: QMDStore): Promise { function createMcpServer (line 158) | async function createMcpServer(store: QMDStore): Promise { function startMcpServer (line 522) | async function startMcpServer(): Promise { type HttpServerHandle (line 533) | type HttpServerHandle = { function startMcpHttpServer (line 543) | async function startMcpHttpServer(port: number, options?: { quiet?: bool... FILE: src/store.ts constant HOME (line 41) | const HOME = process.env.HOME || "/tmp"; constant DEFAULT_EMBED_MODEL (line 42) | const DEFAULT_EMBED_MODEL = "embeddinggemma"; constant DEFAULT_RERANK_MODEL (line 43) | const DEFAULT_RERANK_MODEL = "ExpedientFalcon/qwen3-reranker:0.6b-q8_0"; constant DEFAULT_QUERY_MODEL (line 44) | const DEFAULT_QUERY_MODEL = "Qwen/Qwen3-1.7B"; constant DEFAULT_GLOB (line 45) | const DEFAULT_GLOB = "**/*.md"; constant DEFAULT_MULTI_GET_MAX_BYTES (line 46) | const DEFAULT_MULTI_GET_MAX_BYTES = 10 * 1024; constant DEFAULT_EMBED_MAX_DOCS_PER_BATCH (line 47) | const DEFAULT_EMBED_MAX_DOCS_PER_BATCH = 64; constant DEFAULT_EMBED_MAX_BATCH_BYTES (line 48) | const DEFAULT_EMBED_MAX_BATCH_BYTES = 64 * 1024 * 1024; constant CHUNK_SIZE_TOKENS (line 52) | const CHUNK_SIZE_TOKENS = 900; constant CHUNK_OVERLAP_TOKENS (line 53) | const CHUNK_OVERLAP_TOKENS = Math.floor(CHUNK_SIZE_TOKENS * 0.15); constant CHUNK_SIZE_CHARS (line 55) | const CHUNK_SIZE_CHARS = CHUNK_SIZE_TOKENS * 4; constant CHUNK_OVERLAP_CHARS (line 56) | const CHUNK_OVERLAP_CHARS = CHUNK_OVERLAP_TOKENS * 4; constant CHUNK_WINDOW_TOKENS (line 58) | const CHUNK_WINDOW_TOKENS = 200; constant CHUNK_WINDOW_CHARS (line 59) | const CHUNK_WINDOW_CHARS = CHUNK_WINDOW_TOKENS * 4; function getLlm (line 65) | function getLlm(store: Store): LlamaCpp { type BreakPoint (line 76) | interface BreakPoint { type CodeFenceRegion (line 86) | interface CodeFenceRegion { constant BREAK_PATTERNS (line 97) | const BREAK_PATTERNS: [RegExp, number, string][] = [ function scanBreakPoints (line 117) | function scanBreakPoints(text: string): BreakPoint[] { function findCodeFences (line 144) | function findCodeFences(text: string): CodeFenceRegion[] { function isInsideCodeFence (line 171) | function isInsideCodeFence(pos: number, fences: CodeFenceRegion[]): bool... function findBestCutoff (line 188) | function findBestCutoff( constant STRONG_SIGNAL_MIN_SCORE (line 228) | const STRONG_SIGNAL_MIN_SCORE = 0.85; constant STRONG_SIGNAL_MIN_GAP (line 229) | const STRONG_SIGNAL_MIN_GAP = 0.15; constant RERANK_CANDIDATE_LIMIT (line 232) | const RERANK_CANDIDATE_LIMIT = 40; type ExpandedQuery (line 242) | type ExpandedQuery = { function homedir (line 253) | function homedir(): string { function isAbsolutePath (line 267) | function isAbsolutePath(path: string): boolean { function normalizePathSeparators (line 297) | function normalizePathSeparators(path: string): string { function isWSL (line 305) | function isWSL(): boolean { function getRelativePathFromPrefix (line 314) | function getRelativePathFromPrefix(path: string, prefix: string): string... function resolve (line 341) | function resolve(...paths: string[]): string { function enableProductionMode (line 438) | function enableProductionMode(): void { function getDefaultDbPath (line 442) | function getDefaultDbPath(indexName: string = "index"): string { function getPwd (line 462) | function getPwd(): string { function getRealPath (line 466) | function getRealPath(path: string): string { type VirtualPath (line 478) | type VirtualPath = { function normalizeVirtualPath (line 494) | function normalizeVirtualPath(input: string): string { function parseVirtualPath (line 521) | function parseVirtualPath(virtualPath: string): VirtualPath | null { function buildVirtualPath (line 538) | function buildVirtualPath(collectionName: string, path: string): string { function isVirtualPath (line 551) | function isVirtualPath(path: string): boolean { function resolveVirtualPath (line 566) | function resolveVirtualPath(db: Database, virtualPath: string): string |... function toVirtualPath (line 580) | function toVirtualPath(db: Database, absolutePath: string): string | null { function createSqliteVecUnavailableError (line 614) | function createSqliteVecUnavailableError(reason: string): Error { function getErrorMessage (line 623) | function getErrorMessage(err: unknown): string { function verifySqliteVecLoaded (line 627) | function verifySqliteVecLoaded(db: Database): void { function initializeDatabase (line 641) | function initializeDatabase(db: Database): void { type StoreCollectionRow (line 787) | type StoreCollectionRow = { function rowToNamedCollection (line 797) | function rowToNamedCollection(row: StoreCollectionRow): NamedCollection { function getStoreCollections (line 809) | function getStoreCollections(db: Database): NamedCollection[] { function getStoreCollection (line 814) | function getStoreCollection(db: Database, name: string): NamedCollection... function getStoreGlobalContext (line 820) | function getStoreGlobalContext(db: Database): string | undefined { function getStoreContexts (line 826) | function getStoreContexts(db: Database): Array<{ collection: string; pat... function upsertStoreCollection (line 847) | function upsertStoreCollection(db: Database, name: string, collection: O... function deleteStoreCollection (line 869) | function deleteStoreCollection(db: Database, name: string): boolean { function renameStoreCollection (line 874) | function renameStoreCollection(db: Database, oldName: string, newName: s... function updateStoreContext (line 885) | function updateStoreContext(db: Database, collectionName: string, path: ... function removeStoreContext (line 895) | function removeStoreContext(db: Database, collectionName: string, path: ... function setStoreGlobalContext (line 909) | function setStoreGlobalContext(db: Database, value: string | undefined):... function syncConfigToDb (line 921) | function syncConfigToDb(db: Database, config: CollectionConfig): void { function isSqliteVecAvailable (line 958) | function isSqliteVecAvailable(): boolean { function ensureVecTableInternal (line 962) | function ensureVecTableInternal(db: Database, dimensions: number): void { type Store (line 983) | type Store = { type ReindexProgress (line 1060) | type ReindexProgress = { type ReindexResult (line 1066) | type ReindexResult = { function reindexCollection (line 1078) | async function reindexCollection( type EmbedProgress (line 1180) | type EmbedProgress = { type EmbedResult (line 1188) | type EmbedResult = { type EmbedOptions (line 1195) | type EmbedOptions = { type PendingEmbeddingDoc (line 1203) | type PendingEmbeddingDoc = { type EmbeddingDoc (line 1209) | type EmbeddingDoc = PendingEmbeddingDoc & { type ChunkItem (line 1213) | type ChunkItem = { function validatePositiveIntegerOption (line 1223) | function validatePositiveIntegerOption(name: string, value: number | und... function resolveEmbedOptions (line 1231) | function resolveEmbedOptions(options?: EmbedOptions): Required { function extractTitle (line 1915) | function extractTitle(content: string, filename: string): string { function insertContent (line 1933) | function insertContent(db: Database, hash: string, content: string, crea... function insertDocument (line 1941) | function insertDocument( function findActiveDocument (line 1964) | function findActiveDocument( function updateDocumentTitle (line 1979) | function updateDocumentTitle( function updateDocument (line 1993) | function updateDocument( function deactivateDocument (line 2007) | function deactivateDocument(db: Database, collectionName: string, path: ... function getActiveDocumentPaths (line 2015) | function getActiveDocumentPaths(db: Database, collectionName: string): s... function chunkDocument (line 2024) | function chunkDocument( function chunkDocumentByTokens (line 2091) | async function chunkDocumentByTokens( function levenshtein (line 2143) | function levenshtein(a: string, b: string): number { function normalizeDocid (line 2168) | function normalizeDocid(docid: string): string { function isDocid (line 2190) | function isDocid(input: string): boolean { function findDocumentByDocid (line 2203) | function findDocumentByDocid(db: Database, docid: string): { filepath: s... function findSimilarFiles (line 2219) | function findSimilarFiles(db: Database, query: string, maxDistance: numb... function matchFilesByGlob (line 2234) | function matchFilesByGlob(db: Database, pattern: string): { filepath: st... function getContextForPath (line 2270) | function getContextForPath(db: Database, collectionName: string, path: s... function getContextForFile (line 2314) | function getContextForFile(db: Database, filepath: string): string | null { function getCollectionByName (line 2400) | function getCollectionByName(db: Database, name: string): { name: string... function listCollections (line 2415) | function listCollections(db: Database): { name: string; pwd: string; glo... function removeCollection (line 2447) | function removeCollection(db: Database, collectionName: string): { delet... function renameCollection (line 2470) | function renameCollection(db: Database, oldName: string, newName: string... function insertContext (line 2486) | function insertContext(db: Database, collectionId: number, pathPrefix: s... function deleteContext (line 2501) | function deleteContext(db: Database, collectionName: string, pathPrefix:... function deleteGlobalContexts (line 2511) | function deleteGlobalContexts(db: Database): number { function listPathContexts (line 2534) | function listPathContexts(db: Database): { collection_name: string; path... function getAllCollections (line 2559) | function getAllCollections(db: Database): { name: string }[] { function getCollectionsWithoutContext (line 2568) | function getCollectionsWithoutContext(db: Database): { name: string; pwd... function getTopLevelPathsWithoutContext (line 2600) | function getTopLevelPathsWithoutContext(db: Database, collectionName: st... function sanitizeFTS5Term (line 2653) | function sanitizeFTS5Term(term: string): string { function buildFTS5Query (line 2672) | function buildFTS5Query(query: string): string | null { function validateSemanticQuery (line 2744) | function validateSemanticQuery(query: string): string | null { function validateLexQuery (line 2752) | function validateLexQuery(query: string): string | null { function searchFTS (line 2763) | function searchFTS(db: Database, query: string, limit: number = 20, coll... function searchVec (line 2820) | async function searchVec(db: Database, query: string, model: string, lim... function getEmbedding (line 2910) | async function getEmbedding(text: string, model: string, isQuery: boolea... function getHashesForEmbedding (line 2923) | function getHashesForEmbedding(db: Database): { hash: string; body: stri... function clearAllEmbeddings (line 2938) | function clearAllEmbeddings(db: Database): void { function insertEmbedding (line 2947) | function insertEmbedding( function expandQuery (line 2968) | async function expandQuery(query: string, model: string = DEFAULT_QUERY_... function rerank (line 3007) | async function rerank(query: string, documents: { file: string; text: st... function reciprocalRankFusion (line 3056) | function reciprocalRankFusion( function buildRrfTrace (line 3104) | function buildRrfTrace( type DbDocRow (line 3171) | type DbDocRow = { function findDocument (line 3193) | function findDocument(db: Database, filename: string, options: { include... function getDocumentBody (line 3302) | function getDocumentBody(db: Database, doc: DocumentResult | { filepath:... function findDocuments (line 3352) | function findDocuments( function getStatus (line 3462) | function getStatus(db: Database): IndexStatus { type SnippetResult (line 3512) | type SnippetResult = { constant INTENT_WEIGHT_SNIPPET (line 3521) | const INTENT_WEIGHT_SNIPPET = 0.3; constant INTENT_WEIGHT_CHUNK (line 3524) | const INTENT_WEIGHT_CHUNK = 0.5; constant INTENT_STOP_WORDS (line 3530) | const INTENT_STOP_WORDS = new Set([ function extractIntentTerms (line 3552) | function extractIntentTerms(intent: string): string[] { function extractSnippet (line 3558) | function extractSnippet(body: string, query: string, maxLen = 500, chunk... function addLineNumbers (line 3634) | function addLineNumbers(text: string, startLine: number = 1): string { type SearchHooks (line 3652) | interface SearchHooks { type HybridQueryOptions (line 3669) | interface HybridQueryOptions { type HybridQueryResult (line 3680) | interface HybridQueryResult { type RankedListMeta (line 3693) | type RankedListMeta = { function hybridQuery (line 3712) | async function hybridQuery( type VectorSearchOptions (line 3992) | interface VectorSearchOptions { type VectorSearchResult (line 4000) | interface VectorSearchResult { function vectorSearchQuery (line 4019) | async function vectorSearchQuery( type StructuredSearchOptions (line 4075) | interface StructuredSearchOptions { function structuredSearch (line 4106) | async function structuredSearch( FILE: test/cli.test.ts function runQmd (line 38) | async function runQmd( function getFreshDbPath (line 80) | function getFreshDbPath(): string { function createIsolatedTestEnv (line 86) | async function createIsolatedTestEnv(prefix: string): Promise<{ dbPath: ... function pidPath (line 1310) | function pidPath(): string { function runDaemonQmd (line 1315) | async function runDaemonQmd( function spawnHttpServer (line 1326) | function spawnHttpServer(port: number): import("child_process").ChildPro... function waitForServer (line 1341) | async function waitForServer(port: number, timeoutMs = 5000): Promise