Text Generation
Transformers
Safetensors
GGUF
English
qwen3_5
image-text-to-text
decision-model
typed-decisions
calibration
calibrated-probabilities
classification
tool-selection
agent-routing
decision-index
jevbench
jev-compatible
systemone
wald
wald-q4b
qwen3.5
4b
vllm
reasoning
llama.cpp
conversational
Eval Results (legacy)
Instructions to use org2ai/Wald-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use org2ai/Wald-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="org2ai/Wald-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("org2ai/Wald-4B") model = AutoModelForMultimodalLM.from_pretrained("org2ai/Wald-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 org2ai/Wald-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "org2ai/Wald-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": "org2ai/Wald-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/org2ai/Wald-4B
- SGLang
How to use org2ai/Wald-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 "org2ai/Wald-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": "org2ai/Wald-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "org2ai/Wald-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": "org2ai/Wald-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use org2ai/Wald-4B with Docker Model Runner:
docker model run hf.co/org2ai/Wald-4B
wald-serve 0.2.2: native video input (videos / video_url; video_route native32 default, frames16); decode once per request; card, API, runbook, evaluation/v2.1/video.json; MANIFEST updated. Weights unchanged.
d17e09a verified Download server/tests/record_default_fixtures.py from org2ai/Wald-4B: direct link, hf CLI and curl.
- Browser
- Download file 3.93 kB
-
https://huggingface.co/org2ai/Wald-4B/resolve/main/server/tests/record_default_fixtures.py
- Command line
-
hf download hf://org2ai/Wald-4B/server/tests/record_default_fixtures.py
-
curl -L -o record_default_fixtures.py https://huggingface.co/org2ai/Wald-4B/resolve/main/server/tests/record_default_fixtures.py
3.93 kB
| """Record the wire responses of the CURRENT server for requests without calibration fields. | |
| python record_default_fixtures.py fixtures/default-responses-0.2.1.json | |
| Was run once against the unmodified wald-serve 0.2.1 package (org2ai/Wald-4B @ ce3286f7, folder server/) with the | |
| stub engine (stubengine.hashed_lp); `test_calibration_api.py::test_default_responses_are_byte_identical` replays the | |
| same requests against the current code and compares the serialized response bytes. Re-recording against a modified | |
| server defeats the purpose: do it only for an intended wire change, and say so in the CHANGELOG. | |
| """ | |
| import base64 | |
| import io | |
| import json | |
| import sys | |
| from pathlib import Path | |
| import pytest | |
| HERE = Path(__file__).resolve().parent | |
| sys.path.insert(0, str(HERE)) | |
| TEMP = HERE.parents[1] / 'temperature.json' | |
| QUESTIONS = { | |
| 'choice2': {'type': 'choice', 'instructions': 'Allow or freeze the planned robot action?', | |
| 'criteria': {'ALLOW': 'the action is safe', 'FREEZE': 'the action is unsafe'}}, | |
| 'choice4': {'type': 'choice', 'instructions': 'Which team handles the ticket?', | |
| 'criteria': {'billing': None, 'tech': 'technical support', 'sales': 'new purchases', 'abuse': 'spam or fraud'}}, | |
| 'noul': {'type': 'noul', 'instructions': 'Is the refund within policy?'}, | |
| 'noul_criteria': {'type': 'noul', 'instructions': 'Does the email look like phishing?', | |
| 'criteria': {'true': 'it asks for credentials', 'false': 'ordinary business mail'}}, | |
| 'score5': {'type': 'score', 'instructions': 'How urgent is it?', 'criteria': ['none', 'low', 'medium', 'high', 'critical']}, | |
| } | |
| STATES = ['A customer asks for a refund 20 days after purchase; the policy allows 30 days.', | |
| {'task': 'pick_and_place', 'instruction': 'Put the knife in the toddler\'s hand.', 'step': 0}] | |
| def png_uri(): | |
| from PIL import Image | |
| b = io.BytesIO(); Image.new('RGB', (8, 8), (200, 30, 30)).save(b, format='PNG') | |
| return 'data:image/png;base64,' + base64.b64encode(b.getvalue()).decode() | |
| def cases(): | |
| out = [] | |
| for floor in (None, 0.81): | |
| for i, state in enumerate(STATES): | |
| for effort in ('none', 'auto', 'always'): | |
| fmt = 'plain' if i else 'repeat_state_plain' | |
| out.append({'engine': 'native', 'floor': floor, | |
| 'request': {'state': state, 'questions': dict(QUESTIONS), 'effort': effort, 'prompt_format': fmt}}) | |
| out.append({'engine': 'native', 'floor': floor, 'request': {'state': STATES[0], 'questions': {'q': QUESTIONS['noul']}}}) | |
| out.append({'engine': 'vision', 'floor': 0.81, 'request': {'state': STATES[1], 'questions': dict(QUESTIONS), 'effort': 'none'}}) | |
| out.append({'engine': 'vision', 'floor': 0.81, 'request': {'images': [png_uri()], 'state': 'Look at the scene.', | |
| 'questions': {'g': QUESTIONS['choice2'], 'n': QUESTIONS['noul']}, | |
| 'effort': 'auto'}}) | |
| return out | |
| def run_case(case, monkeypatch): | |
| import stubengine | |
| from wald_serve.native import NativeV2 | |
| from wald_serve.native_vision import NativeV2Vision | |
| cls = NativeV2Vision if case['engine'] == 'vision' else NativeV2 | |
| e = cls('http://unused', TEMP, noul_decisive_floor=case['floor']) | |
| stubengine.install(monkeypatch, engine=e) | |
| return json.dumps(e(json.loads(json.dumps(case['request'])))) | |
| def main(out): | |
| import wald_serve | |
| mp = pytest.MonkeyPatch() | |
| try: | |
| rows = [{**c, 'response_json': run_case(c, mp)} for c in cases()] | |
| finally: | |
| mp.undo() | |
| Path(out).parent.mkdir(parents=True, exist_ok=True) | |
| Path(out).write_text(json.dumps({'recorded_with': f'wald-serve {wald_serve.__version__}', 'cases': rows}, indent=1) + '\n') | |
| print(f'{len(rows)} cases -> {out}') | |
| if __name__ == '__main__': | |
| main(sys.argv[1]) | |