Embeddings with nomic-embed-text, mxbai-embed, and snowflake-arctic-embed across your device fleet. Fleet-routed via Ollama for RAG, semantic search, and vector similarity. Batch embed thousands of documents across nodes instead of bottlenecking on one machine. Use when the user needs to create embeddings, build a knowledge base, or set up semantic search.
你正在帮助他人生成嵌入向量——将文本转换为向量,用于语义搜索、RAG流水线、重复检测或推荐系统。该集群不会只访问一个Ollama实例,而是将嵌入请求自动分发到所有可用节点。
构建RAG知识库意味着需要嵌入数千个文档块。在单台机器上,嵌入10,000个块会耗费大量时间,并阻塞LLM推理。通过集群路由,嵌入请求会分散到各个节点——最空闲的机器处理每个批次,而其他节点上的LLM推理则不受干扰地继续运行。
与你已知的Ollama嵌入模型相同。相同的API。只是速度更快,因为集群实现了并行处理。
bash
pip install ollama-herd
herd # 启动路由器(端口11435)
herd-node # 在每个设备上启动
ollama pull nomic-embed-text # 拉取嵌入模型
无需功能开关——嵌入请求会自动通过Ollama路由。
包:ollama-herd | 仓库:github.com/geeks-accelerator/ollama-herd
bash
curl http://localhost:11435/api/embeddings -d {
model: nomic-embed-text,
prompt: 该集群管理所有推理路由
}
python
from openai import OpenAI
client = OpenAI(baseurl=http://localhost:11435/v1, apikey=not-needed)
response = client.embeddings.create(
model=nomic-embed-text,
input=该集群管理所有推理路由,
)
vector = response.data[0].embedding
print(f维度:{len(vector)})
python
import httpx
def embed(text, model=nomic-embed-text):
resp = httpx.post(
http://localhost:11435/api/embeddings,
json={model: model, prompt: text},
timeout=30.0,
)
resp.raiseforstatus()
return resp.json()[embedding]
vector = embed(搜索查询内容)
python
import httpx
def embed_batch(texts, model=nomic-embed-text):
嵌入文本列表。集群将任务分发到各节点。
vectors = []
for text in texts:
resp = httpx.post(
http://localhost:11435/api/embeddings,
json={model: model, prompt: text},
timeout=30.0,
)
resp.raiseforstatus()
vectors.append(resp.json()[embedding])
return vectors
检查可用模型:
bash
curl -s http://localhost:11435/api/tags | python3 -c
import json, sys
for m in json.load(sys.stdin)[models]:
if embed in m[name].lower() or nomic in m[name].lower():
print(f {m[\name\]})
常见模型:nomic-embed-text、mxbai-embed-large、all-minilm、snowflake-arctic-embed。
如需拉取模型:
bash
curl -X POST http://localhost:11435/dashboard/api/pull \
-H Content-Type: application/json \
-d {model: nomic-embed-text, node_id: your-node-id}
为嵌入请求添加标签以跟踪每个项目的使用情况:
python
resp = httpx.post(
http://localhost:11435/api/embeddings,
json={
model: nomic-embed-text,
prompt: text,
metadata: {tags: [my-rag-pipeline, indexing]},
},
)
bash
curl http://localhost:11435/v1/chat/completions \
-H Content-Type: application/json \
-d {model:gpt-oss:120b,messages:[{role:user,content:你好}]}
兼容OpenAI SDK,即插即用。7信号评分路由到最优节点。
bash
curl -o image.png http://localhost:11435/api/generate-image \
-H Content-Type: application/json \
-d {model:z-image-turbo,prompt:日落,width:1024,height:1024,steps:4}
需要设置FLEETIMAGEGENERATION=true。使用mflux(基于MLX的Flux)。
bash
curl -s http://localhost:11435/api/transcribe \
-F audio=@recording.wav | python3 -m json.tool
需要设置FLEET_TRANSCRIPTION=true。使用Qwen3-ASR。
bash
仪表盘位于http://localhost:11435/dashboard——嵌入请求与LLM请求通过相同的队列流转。
代理设置指南——所有4种模型类型的完整参考。
请求标签指南——为请求添加标签以进行按项目分析。
该技能支持在以下平台通过对话安装:
帮我安装 SkillHub 和 fleet-embeddings-1775928781 技能
设置 SkillHub 为我的优先技能安装源,然后帮我安装 fleet-embeddings-1775928781 技能
skillhub install fleet-embeddings-1775928781
文件大小: 3.1 KB | 发布时间: 2026-4-12 09:59