Instructions to use TrueEnvs/carbenv-qwen3.5-4b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use TrueEnvs/carbenv-qwen3.5-4b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="TrueEnvs/carbenv-qwen3.5-4b") 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("TrueEnvs/carbenv-qwen3.5-4b") model = AutoModelForMultimodalLM.from_pretrained("TrueEnvs/carbenv-qwen3.5-4b", 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 TrueEnvs/carbenv-qwen3.5-4b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "TrueEnvs/carbenv-qwen3.5-4b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "TrueEnvs/carbenv-qwen3.5-4b", "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/TrueEnvs/carbenv-qwen3.5-4b
- SGLang
How to use TrueEnvs/carbenv-qwen3.5-4b 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 "TrueEnvs/carbenv-qwen3.5-4b" \ --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": "TrueEnvs/carbenv-qwen3.5-4b", "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 "TrueEnvs/carbenv-qwen3.5-4b" \ --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": "TrueEnvs/carbenv-qwen3.5-4b", "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 TrueEnvs/carbenv-qwen3.5-4b with Docker Model Runner:
docker model run hf.co/TrueEnvs/carbenv-qwen3.5-4b
CarbEnv Qwen3.5-4B
Qwen3.5-4B fine-tuned to count the carbohydrate in a meal by looking each food up in the USDA food table, the way a dietitian does, instead of guessing a total. Trained with AutoScientist on Adaption on 37,497 tool-calling steps in English, Indian English and Indian languages from CarbEnv that replay to the same reward; LoRA (r 16) merged into the base weights.
Decision support, not dosing advice. Agreement with food tables is not better glucose control; only a study with people can show that.
Results
Pass@1 (%) on the held-out CarbEnv core: correct only if the foods the model looked up add up to its total and the total is within 7.5 g.
| Model | English (150) | Hindi (116) | Indian English (123) |
|---|---|---|---|
| Claude Opus 5.5 | 100.0 | 96.6 | 96.7 |
| GPT-6.2 Sol | 100.0 | 95.7 | 96.7 |
| Kimi K3.1 Pro | 96.7 | 93.1 | 95.1 |
| Qwen3.5-9B | 94.0 | 81.0 | 78.9 |
| Qwen3.5-4B (base) | 54.9 | 44.8 | 51.2 |
| This model | 96.0 | 89.7 | 92.7 |
English is the mean of three runs at temperature 0.8 (base 55.3, 53.3, 56.0; this model 96.0, 95.3, 96.7); the other columns are one run.
The same meals in seven more Indian languages, against the first release, which was trained without them:
| Bengali | Telugu | Marathi | Malayalam | Kannada | Gujarati | Punjabi | |
|---|---|---|---|---|---|---|---|
| First release | 70.8 | 69.9 | 64.7 | 64.0 | 54.9 | 72.7 | 68.3 |
| This model | 79.8 | 82.1 | 79.8 | 78.4 | 66.4 | 84.5 | 84.6 |
Training on a language lifts it by 11 to 16 points, significant (exact McNemar, p < 0.05) on six of the seven, with no loss in English.
Most of the gain is the model learning to open every food before adding up.
What mattered (four retrained variants of the first release, same recipe, one run each): dropping the translated training rows costs 19 points in Hindi, keeping right totals that the opened foods do not support costs 13, and training on half the tasks costs 8; a single teacher instead of two costs nothing significant.
Use it
The model speaks a plain-text tool protocol: one prompt per step, replies of <call>{"name": ..., "arguments": {...}}</call> lines.
vllm serve TrueEnvs/carbenv-qwen3.5-4b --served-model-name carbenv
git clone https://github.com/beingamanforever/TrueEnvs && cd TrueEnvs/01-carbenv && sh scripts/fetch_data.sh
OPENAI_BASE_URL=http://localhost:8000/v1 OPENAI_API_KEY=local uv run python play.py carbenv core_bn
play.py runs each meal in the environment and prints pass@1.
Limits
- Meals and food tables are from the US; Indian dishes are those in FNDDS (dal, roti, idli, dosa and about thirty more).
- Kannada is the weakest language at 66.4%, about 30 points below English.
- Scores were measured on an 8-bit MLX build of these weights.
- Frontier models are near the ceiling on the English core, so it separates small models and training choices, not frontier systems.
- The base model's licence (Apache 2.0) carries over.
Details: two-page report (describes the first release).
Part of TrueEnvs: RL environments whose rewards check the work.
- Downloads last month
- 40
