Something went wrong. Try again.
Routing embedding stack for Qwen3-Embedding-0.6B on Apple Silicon: orchestrator + MLX + llama.cpp backends
Something went wrong. Try again.
634 B · 16 lines
Rust
at main
1234567891011121314151617use crate::dto::InputKind;
const DEFAULT_TASK: &str = "Given a web search query, retrieve relevant passages that answer the query";
/// Wrap text with the appropriate instruction prefix for the given input kind.////// Must remain byte-identical to `llama-embed-server/src/prompt.rs` and the/// Swift backend's Prompt.swift, or token counts will drift from what the/// backends actually see and misrouting will occur.pub fn wrap(text: &str, kind: InputKind) -> String { match kind { InputKind::Document => text.to_string(), InputKind::Query => format!("Instruct: {DEFAULT_TASK}\nQuery: {text}"), }}