Image-Text-to-Text
Transformers
Safetensors
nexa_vision_moe
text-generation
conversational
custom_code
Instructions to use Neura-Tech-AI/Nexa-AI-VL-4x4B-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Neura-Tech-AI/Nexa-AI-VL-4x4B-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Neura-Tech-AI/Nexa-AI-VL-4x4B-Base", trust_remote_code=True) messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Neura-Tech-AI/Nexa-AI-VL-4x4B-Base", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Neura-Tech-AI/Nexa-AI-VL-4x4B-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Neura-Tech-AI/Nexa-AI-VL-4x4B-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Neura-Tech-AI/Nexa-AI-VL-4x4B-Base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Neura-Tech-AI/Nexa-AI-VL-4x4B-Base
- SGLang
How to use Neura-Tech-AI/Nexa-AI-VL-4x4B-Base with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Neura-Tech-AI/Nexa-AI-VL-4x4B-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Neura-Tech-AI/Nexa-AI-VL-4x4B-Base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Neura-Tech-AI/Nexa-AI-VL-4x4B-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Neura-Tech-AI/Nexa-AI-VL-4x4B-Base", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Neura-Tech-AI/Nexa-AI-VL-4x4B-Base with Docker Model Runner:
docker model run hf.co/Neura-Tech-AI/Nexa-AI-VL-4x4B-Base
| { | |
| "architectures": [ | |
| "NexaVisionMoEForConditionalGeneration" | |
| ], | |
| "auto_map": { | |
| "AutoConfig": "configuration_nexa.NexaVisionMoEConfig", | |
| "AutoModelForCausalLM": "modeling_nexa.NexaVisionMoEForConditionalGeneration" | |
| }, | |
| "model_type": "nexa_vision_moe", | |
| "transformers_version": "5.12.1", | |
| "vision_model_id": "google/siglip2-so400m-patch16-naflex", | |
| "llm_model_id": "Neura-Tech-AI/Nexa-AI-4x4B-Instruct", | |
| "vision_dim": 1152, | |
| "llm_dim": 2560, | |
| "hidden_size": 2560, | |
| "intermediate_size": 9728, | |
| "moe_intermediate_size": 9728, | |
| "num_local_experts": 4, | |
| "num_experts": 4, | |
| "num_experts_per_tok": 2, | |
| "num_hidden_layers": 36, | |
| "num_attention_heads": 32, | |
| "num_key_value_heads": 8, | |
| "head_dim": 128, | |
| "hidden_act": "silu", | |
| "max_position_embeddings": 262144, | |
| "vocab_size": 151936, | |
| "bos_token_id": 151643, | |
| "eos_token_id": 151645, | |
| "pad_token_id": null, | |
| "tie_word_embeddings": true, | |
| "rms_norm_eps": 1e-06, | |
| "initializer_range": 0.02, | |
| "attention_bias": false, | |
| "attention_dropout": 0.0, | |
| "decoder_sparse_step": 1, | |
| "dtype": "bfloat16", | |
| "norm_topk_prob": true, | |
| "output_router_logits": false, | |
| "router_aux_loss_coef": 0.001, | |
| "use_cache": true, | |
| "use_sliding_window": false, | |
| "sliding_window": null, | |
| "max_window_layers": 36, | |
| "mlp_only_layers": [], | |
| "rope_parameters": { | |
| "rope_theta": 5000000, | |
| "rope_type": "default" | |
| }, | |
| "layer_types": [ | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention", | |
| "full_attention" | |
| ] | |
| } | |