設備模型中心|文檔|不和諧|博客| x(Twitter)
NEXA SDK是針對ONNX和GGML模型的局部在設備推理框架中,支持文本生成,圖像生成,視覺模型(VLM),音頻語言模型,語音到文本(ASR)和文本對語音(TTS)功能。可通過Python軟件包或可執行安裝程序安裝。
nexa run omniVLM和音頻語言模型(2.9B參數): nexa run omniaudionexa run qwen2audio ,我們是第一個使用GGML Tensor庫支持音頻語言模型的開源工具包。nexa embed <model_path> <prompt>nexa run -hf <hf_model_id> -mt COMPUTER_VISION或nexa run -ms <ms_model_id> -mt COMPUTER_VISIONnexa run -hf <hf_model_id> -mt NLP或nexa run -ms <ms_model_id> -mt NLP歡迎通過問題提交您的請求,我們每週發貨。
MacOS安裝程序
Windows安裝程序
Linux安裝程序
curl -fsSL https://public-storage.nexa4ai.com/install.sh | sh嘗試使用nexa-exe :
nexa-exe < command > 我們已經發布了針對各種Python版本,平台和後端的預製車輪,以便在我們的索引頁面上安裝方便安裝。
pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/cpu --extra-index-url https://pypi.org/simple --no-cache-dir對於支持金屬(MACOS)的GPU版本:
CMAKE_ARGS= " -DGGML_METAL=ON -DSD_METAL=ON " pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/metal --extra-index-url https://pypi.org/simple --no-cache-dir嘗試以下命令:
wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-MacOSX-arm64.sh
bash Miniforge3-MacOSX-arm64.sh
conda create -n nexasdk python=3.10
conda activate nexasdk
CMAKE_ARGS= " -DGGML_METAL=ON -DSD_METAL=ON " pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/metal --extra-index-url https://pypi.org/simple --no-cache-dir要在CUDA支持下安裝,請確保您已安裝了CUDA工具包12.0。
對於Linux :
CMAKE_ARGS= " -DGGML_CUDA=ON -DSD_CUBLAS=ON " pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/cu124 --extra-index-url https://pypi.org/simple --no-cache-dir對於Windows PowerShell :
$env :CMAKE_ARGS= " -DGGML_CUDA=ON -DSD_CUBLAS=ON " ; pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/cu124 --extra-index-url https://pypi.org/simple --no-cache-dir對於Windows命令提示:
set CMAKE_ARGS= " -DGGML_CUDA=ON -DSD_CUBLAS=ON " & pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/cu124 --extra-index-url https://pypi.org/simple --no-cache-dir對於Windows Git Bash :
CMAKE_ARGS= " -DGGML_CUDA=ON -DSD_CUBLAS=ON " pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/cu124 --extra-index-url https://pypi.org/simple --no-cache-dir如果您在構建時遇到以下問題:

嘗試以下命令:
CMAKE_ARGS= " -DCMAKE_CXX_FLAGS=-fopenmp " pip install nexaai要在ROCM支持下安裝,請確保已安裝ROCM 6.2.1或更高版本。
對於Linux :
CMAKE_ARGS= " -DGGML_HIPBLAS=on " pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/rocm621 --extra-index-url https://pypi.org/simple --no-cache-dir要在Vulkan支持下安裝,請確保您的Vulkan SDK 1.3.261.1或更高版本安裝。
對於Windows PowerShell :
$env :CMAKE_ARGS= " -DGGML_VULKAN=on " ; pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/vulkan --extra-index-url https://pypi.org/simple --no-cache-dir對於Windows命令提示:
set CMAKE_ARGS= " -DGGML_VULKAN=on " & pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/vulkan --extra-index-url https://pypi.org/simple --no-cache-dir對於Windows Git Bash :
CMAKE_ARGS= " -DGGML_VULKAN=on " pip install nexaai --prefer-binary --index-url https://github.nexa.ai/whl/vulkan --extra-index-url https://pypi.org/simple --no-cache-dir如何克隆這個回購
git clone --recursive https://github.com/NexaAI/nexa-sdk如果您忘記使用--recursive ,則可以使用以下命令添加子模塊
git submodule update --init --recursive然後,您可以構建和安裝軟件包
pip install -e . 以下是我們與其他類似工具的區分:
| 特徵 | Nexa SDK | 霍拉馬 | 最佳 | LM Studio |
|---|---|---|---|---|
| GGML支持 | ✅ | ✅ | ✅ | |
| ONNX支持 | ✅ | ✅ | ||
| 文字生成 | ✅ | ✅ | ✅ | ✅ |
| 圖像生成 | ✅ | |||
| 視覺語言模型 | ✅ | ✅ | ✅ | ✅ |
| 音頻模型 | ✅ | |||
| 文本到語音 | ✅ | ✅ | ||
| 服務器功能 | ✅ | ✅ | ✅ | ✅ |
| 使用者介面 | ✅ | ✅ | ||
| 可執行安裝 | ✅ | ✅ | ✅ |
我們的設備模型集線器提供了所有類型的量化模型(文本,圖像,音頻,多模式),並提供用於RAM,文件大小,任務等的過濾器,以幫助您輕鬆地使用UI探索模型。在設備模型中心探索設備模型
支持的模型示例(模型中心的完整列表):
| 模型 | 類型 | 格式 | 命令 |
|---|---|---|---|
| Omniaudio | audiolm | GGUF | nexa run omniaudio |
| qwen2audio | audiolm | GGUF | nexa run qwen2audio |
| 章魚V2 | 功能調用 | GGUF | nexa run octopus-v2 |
| OCTO-NET | 文字 | GGUF | nexa run octo-net |
| Omnivlm | 多模式 | GGUF | nexa run omniVLM |
| Nanollava | 多模式 | GGUF | nexa run nanollava |
| llava-phi3 | 多模式 | GGUF | nexa run llava-phi3 |
| llava-llama3 | 多模式 | GGUF | nexa run llava-llama3 |
| llava1.6-Mistral | 多模式 | GGUF | nexa run llava1.6-mistral |
| llava1.6-Vicuna | 多模式 | GGUF | nexa run llava1.6-vicuna |
| Llama3.2 | 文字 | GGUF | nexa run llama3.2 |
| Llama3未經證實 | 文字 | GGUF | nexa run llama3-uncensored |
| Gemma2 | 文字 | GGUF | nexa run gemma2 |
| qwen2.5 | 文字 | GGUF | nexa run qwen2.5 |
| Mathqwen | 文字 | GGUF | nexa run mathqwen |
| codeqwen | 文字 | GGUF | nexa run codeqwen |
| Mistral | 文字 | GGUF/ONNX | nexa run mistral |
| DeepSeek-Coder | 文字 | GGUF | nexa run deepseek-coder |
| Phi3.5 | 文字 | GGUF | nexa run phi3.5 |
| Openelm | 文字 | GGUF | nexa run openelm |
| 穩定擴散-V2-1 | 圖像生成 | GGUF | nexa run sd2-1 |
| 穩定擴散3中 | 圖像生成 | GGUF | nexa run sd3 |
| Flux.1-Schnell | 圖像生成 | GGUF | nexa run flux |
| lcm-dreamshaper | 圖像生成 | GGUF/ONNX | nexa run lcm-dreamshaper |
| 竊竊私語-v3-turbo | 語音到文本 | 垃圾桶 | nexa run faster-whisper-large-turbo |
| 耳語微小 | 語音到文本 | onnx | nexa run whisper-tiny.en |
| MXBAI插入大型V1 | 嵌入 | GGUF | nexa embed mxbai |
| 提名 - Embed-Text-V1.5 | 嵌入 | GGUF | nexa embed nomic |
| All-Minilm-L12-V2 | 嵌入 | GGUF | nexa embed all-MiniLM-L12-v2:fp16 |
| 樹皮小all | 文本到語音 | GGUF | nexa run bark-small:fp16 |
您可以從HF或使用NEXA SDK的HF或MS繪製,轉換(轉換為.GGUF),量化和運行Llama.cpp支持的文本生成模型。
使用nexa run -hf <hf-model-id>或nexa run -ms <ms-model-id>使用提供的.gguf文件運行模型:
nexa run -hf Qwen/Qwen2.5-Coder-7B-Instruct-GGUFnexa run -ms Qwen/Qwen2.5-Coder-7B-Instruct-GGUF注意:將提示您選擇一個.GGUF文件。如果您所需的量化版本具有多個拆分文件(例如FP16-00001-of-00004),請使用NEXA的轉換工具(請參見下文)在本地轉換和量化該模型。
安裝nexa python軟件包,然後使用pip install "nexaai[convert]"安裝nexa轉換工具,然後使用nexa convert <hf-model-id>轉換模型:
nexa convert HuggingFaceTB/SmolLM2-135M-Instruct或者,您可以使用nexa convert -ms <ms-model-id>從ModelsCope轉換模型:
nexa convert -ms Qwen/Qwen2.5-7B-Instruct注意:檢查我們的排行榜,以獲取不同量化版本的主流語言模型和擁抱面文檔的性能基準,以了解量化選項。
?您可以使用nexa list查看下載和轉換的模型
筆記
pip install nexaai用pip install "nexaai[onnx]"即可。pip install nexaai替換為pip install "nexaai[eval]" 。pip install nexaai用pip install "nexaai[convert]" 。--extra-index-url https://pypi.org/simple與--extra-index-url https://pypi.tuna.tsinghua.edu.cn/simple commandsssssssssssssssssssssssssssssss。這是主要CLI命令的簡要概述:
nexa run :使用GGGUF模型對各種任務進行推斷。nexa onnx :使用ONNX型號對各種任務進行推斷。nexa convert :將擁抱面模型轉換為GGGUF模型。nexa server :運行NEXA AI文本生成服務。nexa eval :運行NEXA AI評估任務。nexa pull :從官方或樞紐中汲取模型。nexa remove :從本地機器中刪除模型。nexa clean :清理所有模型文件。nexa list :列出本地計算機中的所有型號。nexa login :登錄到NEXA API。nexa whoami :顯示當前的用戶信息。nexa logout :從NEXA API註銷。有關CLI命令和用法的詳細信息,請參閱CLI參考文檔。
要使用本地計算機上的模型啟動本地服務器,可以使用nexa server命令。有關服務器設置,API端點和使用示例的詳細信息,請參閱服務器參考文獻文檔。
Swift SDK:提供一個swifty的API,使Swift開發人員可以輕鬆地集成和使用Llama.cpp模型。
更多文檔
我們要感謝以下項目: