Image-Text-to-Text
Transformers
Safetensors
GGUF
gemma3
turkish
türkiye
english
ai
lamapi
next
next-x1
efficient
text-generation
open-source
12b
huggingface
large-language-model
llm
causal
transformer
artificial-intelligence
machine-learning
ai-research
natural-language-processing
language
multilingual
multimodal
nlp
finetuned
lightweight
creative
summarization
question-answering
chat
generative-ai
optimized
unsloth
trl
sft
chemistry
code
biology
finance
legal
music
art
state-of-the-art
climate
medical
agent
text-generation-inference
Merge
dense
conversational
Instructions to use thelamapi/next-12b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use thelamapi/next-12b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="thelamapi/next-12b") 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 AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("thelamapi/next-12b") model = AutoModelForImageTextToText.from_pretrained("thelamapi/next-12b") 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?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - llama-cpp-python
How to use thelamapi/next-12b with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="thelamapi/next-12b", filename="next-12b-mmproj.gguf", )
llm.create_chat_completion( 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" } } ] } ] ) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use thelamapi/next-12b with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf thelamapi/next-12b:Q8_0 # Run inference directly in the terminal: llama-cli -hf thelamapi/next-12b:Q8_0
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf thelamapi/next-12b:Q8_0 # Run inference directly in the terminal: llama-cli -hf thelamapi/next-12b:Q8_0
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf thelamapi/next-12b:Q8_0 # Run inference directly in the terminal: ./llama-cli -hf thelamapi/next-12b:Q8_0
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf thelamapi/next-12b:Q8_0 # Run inference directly in the terminal: ./build/bin/llama-cli -hf thelamapi/next-12b:Q8_0
Use Docker
docker model run hf.co/thelamapi/next-12b:Q8_0
- LM Studio
- Jan
- vLLM
How to use thelamapi/next-12b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "thelamapi/next-12b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "thelamapi/next-12b", "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/thelamapi/next-12b:Q8_0
- SGLang
How to use thelamapi/next-12b 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 "thelamapi/next-12b" \ --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": "thelamapi/next-12b", "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 "thelamapi/next-12b" \ --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": "thelamapi/next-12b", "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" } } ] } ] }' - Ollama
How to use thelamapi/next-12b with Ollama:
ollama run hf.co/thelamapi/next-12b:Q8_0
- Unsloth Studio new
How to use thelamapi/next-12b with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for thelamapi/next-12b to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for thelamapi/next-12b to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for thelamapi/next-12b to start chatting
- Docker Model Runner
How to use thelamapi/next-12b with Docker Model Runner:
docker model run hf.co/thelamapi/next-12b:Q8_0
- Lemonade
How to use thelamapi/next-12b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull thelamapi/next-12b:Q8_0
Run and chat with the model
lemonade run user.next-12b-Q8_0
List all available models
lemonade list
Upload model trained with Unsloth
Browse filesUpload model trained with Unsloth 2x faster
- README.md +1 -0
- config.json +113 -0
- generation_config.json +13 -0
- model-00001-of-00005.safetensors +3 -0
- model-00002-of-00005.safetensors +3 -0
- model-00003-of-00005.safetensors +3 -0
- model-00004-of-00005.safetensors +3 -0
- model-00005-of-00005.safetensors +3 -0
- model.safetensors.index.json +0 -0
README.md
CHANGED
|
@@ -6,6 +6,7 @@ tags:
|
|
| 6 |
- unsloth
|
| 7 |
- gemma3
|
| 8 |
- trl
|
|
|
|
| 9 |
license: apache-2.0
|
| 10 |
language:
|
| 11 |
- en
|
|
|
|
| 6 |
- unsloth
|
| 7 |
- gemma3
|
| 8 |
- trl
|
| 9 |
+
- sft
|
| 10 |
license: apache-2.0
|
| 11 |
language:
|
| 12 |
- en
|
config.json
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"Gemma3ForConditionalGeneration"
|
| 4 |
+
],
|
| 5 |
+
"boi_token_index": 255999,
|
| 6 |
+
"bos_token_id": 2,
|
| 7 |
+
"dtype": "bfloat16",
|
| 8 |
+
"eoi_token_index": 256000,
|
| 9 |
+
"eos_token_id": 106,
|
| 10 |
+
"image_token_index": 262144,
|
| 11 |
+
"initializer_range": 0.02,
|
| 12 |
+
"mm_tokens_per_image": 256,
|
| 13 |
+
"model_type": "gemma3",
|
| 14 |
+
"pad_token_id": 0,
|
| 15 |
+
"text_config": {
|
| 16 |
+
"_sliding_window_pattern": 6,
|
| 17 |
+
"attention_bias": false,
|
| 18 |
+
"attention_dropout": 0.0,
|
| 19 |
+
"attn_logit_softcapping": null,
|
| 20 |
+
"cache_implementation": "hybrid",
|
| 21 |
+
"dtype": "bfloat16",
|
| 22 |
+
"final_logit_softcapping": null,
|
| 23 |
+
"head_dim": 256,
|
| 24 |
+
"hidden_activation": "gelu_pytorch_tanh",
|
| 25 |
+
"hidden_size": 3840,
|
| 26 |
+
"initializer_range": 0.02,
|
| 27 |
+
"intermediate_size": 15360,
|
| 28 |
+
"layer_types": [
|
| 29 |
+
"sliding_attention",
|
| 30 |
+
"sliding_attention",
|
| 31 |
+
"sliding_attention",
|
| 32 |
+
"sliding_attention",
|
| 33 |
+
"sliding_attention",
|
| 34 |
+
"full_attention",
|
| 35 |
+
"sliding_attention",
|
| 36 |
+
"sliding_attention",
|
| 37 |
+
"sliding_attention",
|
| 38 |
+
"sliding_attention",
|
| 39 |
+
"sliding_attention",
|
| 40 |
+
"full_attention",
|
| 41 |
+
"sliding_attention",
|
| 42 |
+
"sliding_attention",
|
| 43 |
+
"sliding_attention",
|
| 44 |
+
"sliding_attention",
|
| 45 |
+
"sliding_attention",
|
| 46 |
+
"full_attention",
|
| 47 |
+
"sliding_attention",
|
| 48 |
+
"sliding_attention",
|
| 49 |
+
"sliding_attention",
|
| 50 |
+
"sliding_attention",
|
| 51 |
+
"sliding_attention",
|
| 52 |
+
"full_attention",
|
| 53 |
+
"sliding_attention",
|
| 54 |
+
"sliding_attention",
|
| 55 |
+
"sliding_attention",
|
| 56 |
+
"sliding_attention",
|
| 57 |
+
"sliding_attention",
|
| 58 |
+
"full_attention",
|
| 59 |
+
"sliding_attention",
|
| 60 |
+
"sliding_attention",
|
| 61 |
+
"sliding_attention",
|
| 62 |
+
"sliding_attention",
|
| 63 |
+
"sliding_attention",
|
| 64 |
+
"full_attention",
|
| 65 |
+
"sliding_attention",
|
| 66 |
+
"sliding_attention",
|
| 67 |
+
"sliding_attention",
|
| 68 |
+
"sliding_attention",
|
| 69 |
+
"sliding_attention",
|
| 70 |
+
"full_attention",
|
| 71 |
+
"sliding_attention",
|
| 72 |
+
"sliding_attention",
|
| 73 |
+
"sliding_attention",
|
| 74 |
+
"sliding_attention",
|
| 75 |
+
"sliding_attention",
|
| 76 |
+
"full_attention"
|
| 77 |
+
],
|
| 78 |
+
"max_position_embeddings": 131072,
|
| 79 |
+
"model_type": "gemma3_text",
|
| 80 |
+
"num_attention_heads": 16,
|
| 81 |
+
"num_hidden_layers": 48,
|
| 82 |
+
"num_key_value_heads": 8,
|
| 83 |
+
"query_pre_attn_scalar": 256,
|
| 84 |
+
"rms_norm_eps": 1e-06,
|
| 85 |
+
"rope_local_base_freq": 10000.0,
|
| 86 |
+
"rope_scaling": {
|
| 87 |
+
"factor": 8.0,
|
| 88 |
+
"rope_type": "linear"
|
| 89 |
+
},
|
| 90 |
+
"rope_theta": 1000000.0,
|
| 91 |
+
"sliding_window": 1024,
|
| 92 |
+
"use_cache": true,
|
| 93 |
+
"vocab_size": 262208
|
| 94 |
+
},
|
| 95 |
+
"transformers_version": "4.56.2",
|
| 96 |
+
"unsloth_fixed": true,
|
| 97 |
+
"unsloth_version": "2025.10.10",
|
| 98 |
+
"vision_config": {
|
| 99 |
+
"attention_dropout": 0.0,
|
| 100 |
+
"dtype": "bfloat16",
|
| 101 |
+
"hidden_act": "gelu_pytorch_tanh",
|
| 102 |
+
"hidden_size": 1152,
|
| 103 |
+
"image_size": 896,
|
| 104 |
+
"intermediate_size": 4304,
|
| 105 |
+
"layer_norm_eps": 1e-06,
|
| 106 |
+
"model_type": "siglip_vision_model",
|
| 107 |
+
"num_attention_heads": 16,
|
| 108 |
+
"num_channels": 3,
|
| 109 |
+
"num_hidden_layers": 27,
|
| 110 |
+
"patch_size": 14,
|
| 111 |
+
"vision_use_head": false
|
| 112 |
+
}
|
| 113 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bos_token_id": 2,
|
| 3 |
+
"cache_implementation": "hybrid",
|
| 4 |
+
"do_sample": true,
|
| 5 |
+
"eos_token_id": [
|
| 6 |
+
1,
|
| 7 |
+
106
|
| 8 |
+
],
|
| 9 |
+
"pad_token_id": 0,
|
| 10 |
+
"top_k": 64,
|
| 11 |
+
"top_p": 0.95,
|
| 12 |
+
"transformers_version": "4.56.2"
|
| 13 |
+
}
|
model-00001-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a0df7c5d0bab4f1778a7246153e85c19de80c1e2f4fc27da2203d7de0957d09b
|
| 3 |
+
size 4979902192
|
model-00002-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:aaf866125f1c06fadea3bde354f3aa2b946f2dc5e6d1d1838c72948ee8e65a43
|
| 3 |
+
size 4931296592
|
model-00003-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:be150a3fbb77cc39106f883adf96300bec80165a617efb7f6bcac4dd854e552d
|
| 3 |
+
size 4931296656
|
model-00004-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d2120ee72abc70741d8d8024fa69a5c6aec5f92aa8a5e331e4a1460c1fbdf4e
|
| 3 |
+
size 4931296656
|
model-00005-of-00005.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1ee7bc57e1dd3fb2d57df5f5bbacff9cc79cf16b28d4de572dd05aec272bc0aa
|
| 3 |
+
size 4601000928
|
model.safetensors.index.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|