Instructions to use Gabriel8495839/SmolVLM-500M-OSAgent with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gabriel8495839/SmolVLM-500M-OSAgent with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Gabriel8495839/SmolVLM-500M-OSAgent") 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Gabriel8495839/SmolVLM-500M-OSAgent") model = AutoModelForMultimodalLM.from_pretrained("Gabriel8495839/SmolVLM-500M-OSAgent", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Gabriel8495839/SmolVLM-500M-OSAgent with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Gabriel8495839/SmolVLM-500M-OSAgent" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gabriel8495839/SmolVLM-500M-OSAgent", "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/Gabriel8495839/SmolVLM-500M-OSAgent
- SGLang
How to use Gabriel8495839/SmolVLM-500M-OSAgent 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 "Gabriel8495839/SmolVLM-500M-OSAgent" \ --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": "Gabriel8495839/SmolVLM-500M-OSAgent", "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 "Gabriel8495839/SmolVLM-500M-OSAgent" \ --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": "Gabriel8495839/SmolVLM-500M-OSAgent", "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 Gabriel8495839/SmolVLM-500M-OSAgent with Docker Model Runner:
docker model run hf.co/Gabriel8495839/SmolVLM-500M-OSAgent
Routing between small per-application adapters instead of one model
Here is what I'm looking at next, and where I'd like your opinion.
The current checkpoint (SmolVLM-500M-OSAgent, LoRA r=256 on SmolVLM-500M-Instruct) reaches 59.0% overall on my 410-task benchmark, with 93.3% on Level 0 and 49.4% on Level 1. The weak spots are concentrated in a few task families, mainly inline text entry in File Explorer (rename, new folder, search) and window resizing.
I ran an experiment on this earlier. Training only on the hardest tasks brought them to roughly 9/10, but when I then continued training on all tasks, that skill was lost completely and went back to 0/10. Retraining it takes only a few hundred steps, so the capability is learnable. The problem is that it doesn't survive being mixed back in.
My plan is to test a different structure instead of one model that has to hold everything:
A frozen base model for the shell basics (Start menu, taskbar, flyouts, navigation)
Small separate adapters per application or task group (Explorer, window management, text entry, and so on), each trained on top of the same frozen base
A simple router in front that picks the adapter from the task text, with a fallback to the base model when it is unsure
Adapters kept in system RAM and loaded into VRAM on demand, so that it could eventually run on consumer GPUs with 8 GB. This is a goal, not something I have measured.
I don't know yet whether this will actually beat a single model. Routing errors could cancel out the gains, and a 500M model may simply be too small for this to matter.
So my question: does this approach seem worthwhile for a model of this size?