NexaAI macOS Setup Guide
This guide demonstrates how to use the NexaAI SDK for various AI inference tasks on macOS, including:- LLM (Large Language Model): Text generation and conversation
- VLM (Vision Language Model): Multimodal understanding and generation
- Embedder: Text vectorization and similarity computation
- Reranker: Document reranking
- ASR (Automatic Speech Recognition): Speech-to-text transcription
- CV (Computer Vision): OCR/text recognition
- TTS (Text-to-Speech): Text-to-speech synthesis
- ImageGen: Image generation from text prompts
- Diarize: Speaker diarization
Prerequisites
1. Install the correct Python version
NexaAI requires Python 3.10 on macOS Verify the installation:Python version: 3.10.18 (main, Jun 3 2025, 18:23:41) [Clang 17.0.0 (clang-1700.0.13.5)]Expected output must contain version
3.10.x
Here are suggested ways to install Python 3.10:
Option 1: Using Homebrew
If you don’t have Homebrew, first install it from https://brew.sh/. Then, in your Terminal:
python3.10:
2. Create and activate a virtual environment
3. Install the NexaAI SDK
4. Verify Your Environment
Run the following code to ensure you have the right environment:Authentication Setup
Before running any examples, you need to set up your NexaAI authentication token from https://sdk.nexa.ai/.Set Token in Environment
Replace"YOUR_NEXA_TOKEN_HERE" with your actual NexaAI token:
Verify the Token is Set
1. LLM (Large Language Model) Inference
Using MLX-accelerated large language models for text generation and conversation.2. VLM (Vision Language Model) Inference
Using MLX-accelerated vision language models for multimodal understanding and generation.3. Embedder Inference
Using MLX-accelerated embedding models for text vectorization and similarity computation.4. ASR (Automatic Speech Recognition) Inference
Using MLX-accelerated speech recognition models for speech-to-text transcription.5. Reranker Inference
Using MLX-accelerated reranking models for document reranking.6. Computer Vision (CV) Inference
Using MLX-accelerated computer vision tasks (e.g., OCR/text recognition) on images.Next Steps
- Explore the API Reference for comprehensive documentation
- Check out the Windows x64 Guide for cross-platform development
- Visit the Windows ARM64 Guide for NPU optimization
Was this page helpful?