Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Index your code
hub
/
github.com/StarTrail-org/PixelRAG
/ functions
Functions
1,050 in github.com/StarTrail-org/PixelRAG
⨍
Functions
1,050
◇
Types & classes
108
↳
Endpoints
6
↓ 94 callers
Method
cdp
Send a CDP command, wait for response.
render/src/pixelrag_render/strategies/base.py:51
↓ 38 callers
Method
from_pretrained
(cls, pretrained_model_name_or_path, *args, **kwargs)
train/models/biqwen3.py:62
↓ 19 callers
Function
_clear_rope_deltas
Clear stale rope_deltas state on Qwen3VL model. Qwen3VLModel.compute_3d_position_ids stores self.rope_deltas after processing image batches.
train/train_contrastors.py:896
↓ 19 callers
Method
run
Distribute tile_infos dynamically across workers and collect results. Splits tile_infos into small work chunks and puts them into the shared
embed/src/pixelrag_embed/embed.py:1385
↓ 17 callers
Function
cn
(...inputs: ClassValue[])
web/lib/utils.ts:4
↓ 17 callers
Function
debug_trace
Emit a per-rank debug line when tracing distributed hangs.
train/train_contrastors.py:391
↓ 16 callers
Function
chunk_inputs
Split a batch of inputs into chunks along batch dimension. Only includes tensor values in chunks (non-tensors are dropped) so that RandContex
train/train_contrastors.py:924
↓ 16 callers
Function
extract_url_from_metadata
Extract URL from example metadata. Args: example: Example dict with 'metadata' field. Returns: Extracted URL or None.
eval/lib/simpleqa_data.py:215
↓ 16 callers
Method
update
(self, model)
train/train_contrastors.py:134
↓ 15 callers
Method
close
(self)
render/src/pixelrag_render/strategies/base.py:55
↓ 14 callers
Function
article_url
Get navigate URL for an article. Supports both file:// and http://.
render/src/pixelrag_render/strategies/base.py:42
↓ 13 callers
Method
close
(self)
embed/src/pixelrag_embed/embed.py:1597
↓ 13 callers
Method
kill
(self)
render/src/pixelrag_render/strategies/cdp_overlap.py:117
↓ 13 callers
Function
worker_task
(wi: int)
render/src/pixelrag_render/backends/fast_cdp.py:347
↓ 11 callers
Function
_log
Write log line directly to file descriptor (wandb-proof).
train/train.py:39
↓ 11 callers
Method
close
(self)
render/src/pixelrag_render/backends/fast_cdp.py:226
↓ 9 callers
Function
clip_loss
InfoNCE contrastive loss with hard negative support (from contrastors/loss.py). Inspired by: https://github.com/mlfoundations/open_clip/blob/main
train/train_contrastors.py:206
↓ 9 callers
Function
launch_websocket
Launch Chrome via subprocess, connect via websocket.
render/src/pixelrag_render/strategies/connection.py:181
↓ 8 callers
Function
_get_query_image_path_for_example
Get EVQA query image path. Dispatches by dataset_name: inaturalist | landmarks.
eval/lib/retrieval.py:293
↓ 8 callers
Function
process_queries
Wrap queries in chat template with retrieval instruction.
train/train_contrastors.py:794
↓ 8 callers
Method
wait
(self, timeout=None)
render/src/pixelrag_render/strategies/cdp_overlap.py:114
↓ 7 callers
Method
cdp
(self, method: str, params: dict | None = None)
render/src/pixelrag_render/strategies/connection.py:93
↓ 7 callers
Method
cdp
(self, method: str, params: dict | None = None)
render/src/pixelrag_render/backends/fast_cdp.py:195
↓ 7 callers
Function
launch_playwright
Launch Chrome via Playwright, get CDP session.
render/src/pixelrag_render/strategies/connection.py:234
↓ 7 callers
Function
resolve_editorial_photo
Return the path to the editorial photo for a QA row, or None.
eval/run_livevqa.py:439
↓ 6 callers
Function
_bytes_to_pil
Convert raw bytes, base64 string, dict with 'bytes' key, or PIL Image to a PIL Image. Returns None on failure.
eval/lib/benchmarks.py:66
↓ 6 callers
Method
apply
Swap model params with EMA params. Call before eval.
train/train_contrastors.py:139
↓ 6 callers
Function
process_doc_images
Wrap document images in chat template with representation instruction. Returns batch-major pixel_values (B, max_patches, dim) so that chunk_i
train/train_contrastors.py:806
↓ 6 callers
Method
send_signal
(self, _)
render/src/pixelrag_render/strategies/cdp_overlap.py:111
↓ 6 callers
Function
tileUrl
(hit: { article_id: number; tile_index: number; chunk_index: number; })
web/lib/api.ts:30
↓ 5 callers
Function
_cdp_send
Send a CDP command and wait for its response.
render/src/pixelrag_render/backends/websocket.py:72
↓ 5 callers
Function
_filter_tiles_by_aspect_ratio
Filter out tiles with extreme aspect ratios. Args: tile_paths: List of tile image paths. max_aspect_ratio: Maximum allowed aspect
eval/lib/retrieval.py:1481
↓ 5 callers
Function
_format_mc_options
Format MC options as 'A. text1\nB. text2\n...
eval/lib/simpleqa_data.py:1067
↓ 5 callers
Function
build_openai_client
Create an OpenAI-compatible client for local or hosted endpoints.
train/train_contrastors.py:399
↓ 5 callers
Function
gather_with_grad
All-gather tensors across GPUs while preserving gradients.
train/train_contrastors.py:92
↓ 5 callers
Method
generate
Generate response from messages with retry on timeout/connection errors. Args: max_retries: Retry count for timeout errors.
eval/lib/llm.py:524
↓ 5 callers
Function
grad_cache_loss
GradCache: large effective batch with constant memory (from contrastors/loss.py). 1. Forward all chunks WITHOUT grad → cache embeddings 2. Co
train/train_contrastors.py:289
↓ 5 callers
Function
log
(...args)
web/agent-server.mjs:65
↓ 5 callers
Function
run_test_evals
Run mini-v6/v8/... eval on every loaded test dataset and log per-set metrics.
train/train_contrastors.py:2855
↓ 5 callers
Function
send
(event, data)
web/agent-server.mjs:222
↓ 5 callers
Function
split_image_to_tiles
Split an image into fixed-size tiles. Args: image_path: Path to the source image. output_dir: Directory to save tiles. ti
eval/lib/simpleqa_data.py:648
↓ 4 callers
Function
_format_rate
(rate: float)
index/src/pixelrag_index/monitor.py:60
↓ 4 callers
Method
_health_check
Quick HTTP check to see if kiwix-serve is responding.
index/src/pixelrag_index/sources/kiwix.py:133
↓ 4 callers
Function
_resolve_path
Resolve chunk file path from article_id, tile_index, chunk_index.
serve/src/pixelrag_serve/api.py:248
↓ 4 callers
Function
_save_task_query_image
Save query image from any task to disk. Returns path or None. Images saved to {base_dir}/{task_name}_images/{example_id}.png Works with PIL im
eval/lib/retrieval.py:477
↓ 4 callers
Function
build_messages_for_livevqa
Build OpenAI-compatible messages for a LiveVQA MCQ call. Supports mixed content: images first, then text chunks, then the MCQ prompt.
eval/run_livevqa.py:250
↓ 4 callers
Function
capture_screenshot_for_example
Capture screenshot for a single example. Args: example: Example dict with metadata containing URL. screenshot_dir: Directory to s
eval/lib/simpleqa_data.py:314
↓ 4 callers
Method
close
(self)
index/src/pixelrag_index/sources/kiwix.py:589
↓ 4 callers
Function
collect_grads
(model, logit_scale)
train/tests/test_grad_multi_gpu.py:101
↓ 4 callers
Function
fetchApi
(path: string, init?: RequestInit)
web/lib/api.ts:5
↓ 4 callers
Method
get_hits
Return raw per-hit dicts (title/text/url/score/...) for this example. Used by wrappers that need per-chunk granularity (e.g. RenderedTextWrap
eval/lib/retrieval.py:3444
↓ 4 callers
Function
normalize_answer
SQuAD-style normalization: lowercase, strip punctuation, articles, whitespace.
eval/run_monaco.py:731
↓ 4 callers
Function
percentile
(arr, p)
render/src/pixelrag_render/bench/bench_throughput.py:353
↓ 4 callers
Function
pool_and_normalize
Last-token pooling + L2 normalization. Matches the production embedding pipeline (embed_tiles.py direct_gpu backend).
train/model.py:58
↓ 4 callers
Method
prefetch
(self, examples: list[dict])
eval/lib/retrieval.py:3757
↓ 4 callers
Function
render_urls
Render a list of URLs to tiled JPEG images. Args: urls: URLs to capture. output_dir: Directory to write tile subdirectories into.
render/src/pixelrag_render/render.py:58
↓ 4 callers
Method
retrieve
Retrieve relevant content for the query. Args: query: The question/query text. example: The full example dict (may co
eval/lib/retrieval.py:60
↓ 4 callers
Function
save_checkpoint
(step, epoch)
train/train_contrastors.py:2709
↓ 4 callers
Function
send
(event: string, data: unknown)
web/app/api/chat/route.ts:213
↓ 4 callers
Method
set_epoch
(self, epoch)
train/train_contrastors.py:661
↓ 4 callers
Method
stop
(self)
index/src/pixelrag_index/sources/kiwix.py:248
↓ 3 callers
Method
_build_article_list
(self)
index/src/pixelrag_index/sources/kiwix.py:530
↓ 3 callers
Function
_count_lines
(path: Path)
index/src/pixelrag_index/monitor.py:145
↓ 3 callers
Function
_eager_load_images
Force lazy images to load by promoting data-src and setting loading='eager'.
eval/lib/screenshot.py:193
↓ 3 callers
Function
_extract_host
Extract physical hostname from machine_id (``hostname-PID``). Machine IDs look like ``ip-172-31-2-101-4188035`` (AWS) or ``129-80-136-19-1450
index/src/pixelrag_index/monitor.py:74
↓ 3 callers
Function
_init_screenshot_utils
Initialize screenshot utilities (lazy import).
eval/lib/simpleqa_data.py:296
↓ 3 callers
Function
_load_image
(path)
train/train_contrastors.py:855
↓ 3 callers
Function
_parse_new_jsonl
Parse newly appended lines from a JSONL results file into state/cycle.
index/src/pixelrag_index/monitor.py:116
↓ 3 callers
Method
_retrieve_single
(self, query: str, example: dict)
eval/lib/retrieval.py:3118
↓ 3 callers
Function
_wait_for_images
Wait for all document images to finish loading (load or error).
eval/lib/screenshot.py:212
↓ 3 callers
Function
build_usage_summary
(client_ctx: dict, model: str)
train/filter_hard_negatives_vqa.py:754
↓ 3 callers
Function
candidate_priority
(review: dict)
train/clean_queries_simpleqa_style.py:514
↓ 3 callers
Function
find_chrome
Find the best available Chrome binary. Auto-installs if none found. Search order: 1. CHROME_PATH env var 2. pixelrag-installed headless_s
render/src/pixelrag_render/chrome.py:50
↓ 3 callers
Function
get_chunked_embeddings
Forward pass on chunks without grad, caching embeddings + RNG states.
train/train_contrastors.py:274
↓ 3 callers
Function
gpu_worker
Load model on one GPU, embed all assigned tiles, write partial .npz. This function runs in a child process with CUDA_VISIBLE_DEVICES set. Ar
embed/src/pixelrag_embed/embed.py:732
↓ 3 callers
Function
handleFile
(file: File)
web/components/SearchBar.tsx:55
↓ 3 callers
Function
handleFile
(file: File)
web/app/chat/page.tsx:183
↓ 3 callers
Function
handleNumber
( field: "n_docs" | "nprobe" | "min_tile_height", value: string )
web/components/SearchControls.tsx:31
↓ 3 callers
Function
init_chat_templates
Pre-compute chat template strings once to avoid per-batch overhead.
train/train_contrastors.py:751
↓ 3 callers
Function
make_collate_fn
Collate: process queries as text, images as visual prompts. With hard negatives, document images are interleaved: [pos1, neg1a, neg1b, po
train/train_contrastors.py:847
↓ 3 callers
Function
manual_all_reduce_grads
Average gradients across ranks for modules outside DDP's reducer path.
train/train_contrastors.py:380
↓ 3 callers
Function
render_pdf
Render a PDF file to tiled JPEG images. Args: path: Path to the PDF file. output_dir: Directory to write the tile subdirectory in
render/src/pixelrag_render/render.py:110
↓ 3 callers
Function
render_url
Render a URL to tiled JPEG images. Args: url: URL to capture (http:// or https:// or file://). output_dir: Directory to write til
render/src/pixelrag_render/render.py:19
↓ 3 callers
Function
run_gpu_workers_parallel
Launch one non-daemonic process per GPU and collect partial .npz paths. When reuse_workers=True, uses dynamic work distribution via a shared queu
embed/src/pixelrag_embed/embed.py:1645
↓ 3 callers
Function
run_query_side_tests
(step)
train/train_contrastors.py:2780
↓ 3 callers
Function
save_checkpoint
Save LoRA weights + optimizer/scheduler state.
train/train.py:71
↓ 3 callers
Function
save_npz
Save npz with optional compression.
embed/src/pixelrag_embed/embed.py:130
↓ 3 callers
Function
sse
(event, data)
web/agent-server.mjs:134
↓ 3 callers
Function
update
(patch: Partial<SearchOptions>)
web/components/SearchControls.tsx:27
↓ 3 callers
Method
wait_for_event
Wait for a CDP event with the given method name. Args: method: CDP event method, e.g. "Page.frameStoppedLoading".
render/src/pixelrag_render/strategies/connection.py:106
↓ 3 callers
Function
write_jsonl
(path: Path, rows: list[dict])
train/split_first5_chunks.py:61
↓ 2 callers
Method
_batch_ocr
(self, paths: list[str])
eval/lib/retrieval.py:3575
↓ 2 callers
Function
_build_chat_prompt
Build the embedding prompt using the model's chat template. Uses the official Qwen3-VL-Embedding prompt format: system: <instruction>
embed/src/pixelrag_embed/embed.py:437
↓ 2 callers
Method
_cache_path
(self)
index/src/pixelrag_index/sources/kiwix.py:425
↓ 2 callers
Method
_capture
( self, tab, article: dict, page_h: int, wi: int )
render/src/pixelrag_render/strategies/cdp_pipelined_dc.py:255
↓ 2 callers
Method
_download_zim
(url: str, dest: Path)
index/src/pixelrag_index/sources/kiwix.py:337
↓ 2 callers
Function
_embed_tile_infos_with_engine
Embed tile infos with a pre-initialized engine function + prompt. Uses a pipeline: background threads read files, hash, and decode only uniqu
embed/src/pixelrag_embed/embed.py:858
↓ 2 callers
Method
_ensure_recv
(self)
render/src/pixelrag_render/backends/fast_cdp.py:158
↓ 2 callers
Method
_ensure_recv_loop
(self)
render/src/pixelrag_render/strategies/connection.py:39
↓ 2 callers
Method
_extract_urls_from_results
Extract source URLs from tile paths in results, preserving retrieval order.
eval/lib/retrieval.py:3047
next →
1–100 of 1,050, ranked by callers