mirror of
https://github.com/hanzoai/papers.git
synced 2026-10-29 07:34:31 +00:00
86 lines
2.0 KiB
TeX
86 lines
2.0 KiB
TeX
\section{AI Inference Integration}
|
|
|
|
|
|
\subsection{Qwen3 Native Embeddings}
|
|
|
|
First-class support for Qwen3 models:
|
|
|
|
\subsubsection{Qwen3-Embedding-8B}
|
|
|
|
Specifications:
|
|
\begin{itemize}
|
|
\item Parameters: 8 billion
|
|
\item Dimensions: 4096
|
|
\item Context: 32,768 tokens
|
|
\item MTEB Score: \#1 multilingual (pending)
|
|
\item Quantization: Q4K, Q8\_0 (GGUF)
|
|
\end{itemize}
|
|
|
|
\subsubsection{Qwen3-Reranker-4B}
|
|
|
|
Specifications:
|
|
\begin{itemize}
|
|
\item Parameters: 4 billion
|
|
\item Output: 768-dim relevance scores
|
|
\item Context: 8,192 tokens
|
|
\item Use case: Two-stage retrieval
|
|
\end{itemize}
|
|
|
|
\subsection{Inference Backends}
|
|
|
|
\subsubsection{Hanzo Engine}
|
|
|
|
Custom inference server (mistral.rs fork) on port 36900:
|
|
|
|
\begin{itemize}
|
|
\item OpenAI-compatible API
|
|
\item GPU acceleration (CUDA/Metal)
|
|
\item GGUF model support
|
|
\item ISQ (In-Situ Quantization)
|
|
\item Flash Attention support
|
|
\end{itemize}
|
|
|
|
\subsubsection{Multi-Provider Support}
|
|
|
|
20+ LLM providers via unified interface:
|
|
\begin{itemize}
|
|
\item OpenAI (GPT-4, GPT-3.5)
|
|
\item Anthropic (Claude 3 Opus/Sonnet/Haiku)
|
|
\item Google (Gemini Pro/Flash)
|
|
\item Ollama (local models)
|
|
\item Groq (high-speed inference)
|
|
\item DeepSeek (reasoning models)
|
|
\item Together AI, OpenRouter, Exo, Grok
|
|
\end{itemize}
|
|
|
|
\subsection{Embedding Pipeline}
|
|
|
|
\begin{algorithm}
|
|
\caption{Native Embedding Generation}
|
|
\begin{algorithmic}[1]
|
|
\REQUIRE Text input, model type
|
|
\ENSURE Embedding vector
|
|
\IF{USE\_NATIVE\_EMBEDDINGS $=$ true}
|
|
\STATE Load GGUF model (Qwen3-Embedding-8B)
|
|
\IF{GPU available}
|
|
\STATE Initialize CUDA/Metal backend
|
|
\ENDIF
|
|
\STATE embedding $\leftarrow$ Model.encode(text)
|
|
\IF{encoding fails}
|
|
\STATE Fallback to Ollama server
|
|
\ENDIF
|
|
\ELSE
|
|
\STATE embedding $\leftarrow$ OllamaClient.embed(text)
|
|
\ENDIF
|
|
\RETURN embedding
|
|
\end{algorithmic}
|
|
\end{algorithm}
|
|
|
|
Performance:
|
|
\begin{itemize}
|
|
\item Throughput: 1000+ embeddings/sec (GPU)
|
|
\item Latency: $<$10ms per embedding (batch size 32)
|
|
\item Memory: 16GB VRAM for 8B model
|
|
\end{itemize}
|
|
|