Image-to-Text
Safetensors
GGUF
English
idefics3
vision-language
credit-card
ocr
json-extraction
cardvault
smolvlm
fine-tuned
conversational
Instructions to use sugiv/cardvaultplus-500m with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use sugiv/cardvaultplus-500m with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sugiv/cardvaultplus-500m", filename="GGUF/cardvault-500m-f16.gguf", )
llm.create_chat_completion( messages = "\"cats.jpg\"" )
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- llama.cpp
How to use sugiv/cardvaultplus-500m with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf sugiv/cardvaultplus-500m:Q4_K_M # Run inference directly in the terminal: llama-cli -hf sugiv/cardvaultplus-500m:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf sugiv/cardvaultplus-500m:Q4_K_M # Run inference directly in the terminal: llama-cli -hf sugiv/cardvaultplus-500m:Q4_K_M
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 sugiv/cardvaultplus-500m:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf sugiv/cardvaultplus-500m:Q4_K_M
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 sugiv/cardvaultplus-500m:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf sugiv/cardvaultplus-500m:Q4_K_M
Use Docker
docker model run hf.co/sugiv/cardvaultplus-500m:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use sugiv/cardvaultplus-500m with Ollama:
ollama run hf.co/sugiv/cardvaultplus-500m:Q4_K_M
- Unsloth Studio new
How to use sugiv/cardvaultplus-500m 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 sugiv/cardvaultplus-500m 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 sugiv/cardvaultplus-500m to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for sugiv/cardvaultplus-500m to start chatting
- Docker Model Runner
How to use sugiv/cardvaultplus-500m with Docker Model Runner:
docker model run hf.co/sugiv/cardvaultplus-500m:Q4_K_M
- Lemonade
How to use sugiv/cardvaultplus-500m with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull sugiv/cardvaultplus-500m:Q4_K_M
Run and chat with the model
lemonade run user.cardvaultplus-500m-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = "\"cats.jpg\""
)CardVault+ SmolVLM-500M Fine-tuned Model
Model Description
CardVault+ is a specialized fine-tuned version of HuggingFaceTB/SmolVLM-500M-Instruct, optimized for credit card information extraction. This model can accurately extract structured data from credit card images in JSON format.
Key Features
- Vision-Language Processing: Processes credit card images and extracts text
- Structured Output: Returns data in consistent JSON format
- High Accuracy: Fine-tuned on 9,612 synthetic credit card images
- Production Ready: Optimized for real-world deployment
Training Details
- Base Model: HuggingFaceTB/SmolVLM-500M-Instruct
- Training Method: LoRA (Low-Rank Adaptation) fine-tuning
- Training Data: 9,612 synthetic credit card images
- Training Epochs: 4
- Final Validation Loss: 0.000056
- Training Date: July 22, 2025
Usage
from transformers import AutoProcessor, Idefics3ForConditionalGeneration
from PIL import Image
import torch
# Load model and processor
model = Idefics3ForConditionalGeneration.from_pretrained(
"sugiv/cardvaultplus-500m",
torch_dtype=torch.float16,
trust_remote_code=True
)
processor = AutoProcessor.from_pretrained(
"sugiv/cardvaultplus-500m",
trust_remote_code=True
)
# Process credit card image
image = Image.open("credit_card.jpg")
prompt = '''<|im_start|>user
Extract the card information from this image in the following JSON format:
{
"card_number": "XXXX XXXX XXXX XXXX",
"cardholder_name": "FULL NAME",
"expiry_date": "MM/YY",
"cvv": "XXX",
"card_type": "VISA/MASTERCARD/AMEX/DISCOVER"
}
<image>
<|im_end|>
<|im_start|>assistant
'''
inputs = processor(images=image, text=prompt, return_tensors="pt")
with torch.no_grad():
generated_ids = model.generate(**inputs, max_new_tokens=200)
output = processor.decode(generated_ids[0], skip_special_tokens=True)
Expected Output Format
{
"card_number": "4532 1234 5678 9012",
"cardholder_name": "JOHN DOE",
"expiry_date": "12/27",
"cvv": "123",
"card_type": "VISA"
}
Technical Specifications
- Model Size: ~1GB (merged weights)
- Architecture: Idefics3ForConditionalGeneration
- Input Resolution: Variable (optimized for card images)
- Output Format: Structured JSON
- Inference Speed: ~2-3 seconds per image (RTX A6000)
Limitations and Ethical Considerations
- Intended Use: Educational and development purposes only
- Data Privacy: Do not use with real credit card data
- Security: Always implement proper data handling and security measures
- Compliance: Ensure compliance with financial data regulations
License
Apache 2.0
- Downloads last month
- 11
Model tree for sugiv/cardvaultplus-500m
Base model
HuggingFaceTB/SmolLM2-360M Quantized
HuggingFaceTB/SmolLM2-360M-Instruct Quantized
HuggingFaceTB/SmolVLM-500M-Instruct
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="sugiv/cardvaultplus-500m", filename="", )