Text Generation
Transformers
Safetensors
mistral3
image-text-to-text
decision-model
typed-decisions
jev
jevbench
calibration
decode-free
multilingual
vision-language
conversational
Instructions to use StandardThinking/StandardOne-3B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use StandardThinking/StandardOne-3B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="StandardThinking/StandardOne-3B") 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("StandardThinking/StandardOne-3B") model = AutoModelForMultimodalLM.from_pretrained("StandardThinking/StandardOne-3B", 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 StandardThinking/StandardOne-3B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "StandardThinking/StandardOne-3B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "StandardThinking/StandardOne-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/StandardThinking/StandardOne-3B
- SGLang
How to use StandardThinking/StandardOne-3B 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 "StandardThinking/StandardOne-3B" \ --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": "StandardThinking/StandardOne-3B", "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 "StandardThinking/StandardOne-3B" \ --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": "StandardThinking/StandardOne-3B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use StandardThinking/StandardOne-3B with Docker Model Runner:
docker model run hf.co/StandardThinking/StandardOne-3B
Download server/tests/test_disconnect_cleanup.py from StandardThinking/StandardOne-3B: direct link, hf CLI and curl.
- Browser
- Download file 5.12 kB
-
https://huggingface.co/StandardThinking/StandardOne-3B/resolve/main/server/tests/test_disconnect_cleanup.py
- Command line
-
hf download hf://StandardThinking/StandardOne-3B/server/tests/test_disconnect_cleanup.py
-
curl -L -o test_disconnect_cleanup.py https://huggingface.co/StandardThinking/StandardOne-3B/resolve/main/server/tests/test_disconnect_cleanup.py
5.12 kB
| """A completed score must not wait forever for a cancelled disconnect poll.""" | |
| import asyncio | |
| import pytest | |
| from jev_adapter.backend import AdapterError, ScoringResult | |
| from jev_adapter.protocol import SystemOneRequest | |
| from jev_adapter.server import create_app | |
| class ControlledBackend: | |
| model = "test-model" | |
| def __init__(self): | |
| self.release = asyncio.Event() | |
| self.entered = asyncio.Event() | |
| self.cancelled = asyncio.Event() | |
| def labels(self, count): | |
| return tuple("AB"[:count]), tuple(range(count)) | |
| async def evaluate(self, prompt, images, labels, token_ids, assistant_prefix): | |
| self.entered.set() | |
| try: | |
| await self.release.wait() | |
| except asyncio.CancelledError: | |
| self.cancelled.set() | |
| raise | |
| return ScoringResult((-0.1, -2.0), 10) | |
| class CancellationSwallowingRequest: | |
| """Reproduce a request probe whose internal cancellation scope wins a race. | |
| CancelledError can be suppressed within a probe, leaving its caller alive. | |
| A real Request.is_disconnected uses a self-cancelling AnyIO CancelScope; | |
| deliberately control that boundary here rather than rely on scheduler luck. | |
| """ | |
| def __init__(self): | |
| self.entered = asyncio.Event() | |
| self.swallowed = asyncio.Event() | |
| self.probe_task = None | |
| self.calls = 0 | |
| async def is_disconnected(self): | |
| self.probe_task = asyncio.current_task() | |
| self.calls += 1 | |
| self.entered.set() | |
| try: | |
| await asyncio.Future() | |
| except asyncio.CancelledError: | |
| self.swallowed.set() | |
| return False | |
| def endpoint_and_body(backend): | |
| app = create_app(backend) | |
| endpoint = next( | |
| route.endpoint | |
| for route in app.routes | |
| if getattr(route, "path", None) == "/v1/systemone" | |
| ) | |
| body = SystemOneRequest.model_validate( | |
| { | |
| "model": backend.model, | |
| "state": "A billing question.", | |
| "questions": { | |
| "route": { | |
| "type": "choice", | |
| "instructions": "Choose the team.", | |
| "criteria": {"billing": None, "technical": None}, | |
| } | |
| }, | |
| } | |
| ) | |
| return endpoint, body | |
| async def test_completed_score_returns_when_disconnect_probe_swallows_cancel(): | |
| backend = ControlledBackend() | |
| endpoint, body = endpoint_and_body(backend) | |
| request = CancellationSwallowingRequest() | |
| response = asyncio.create_task(endpoint(body, request)) | |
| try: | |
| await asyncio.wait_for(request.entered.wait(), timeout=1) | |
| await asyncio.wait_for(backend.entered.wait(), timeout=1) | |
| backend.release.set() | |
| await asyncio.wait_for(request.swallowed.wait(), timeout=1) | |
| done, _ = await asyncio.wait({response}, timeout=0.1) | |
| assert response in done, "completed inference is stuck cleaning up its watcher" | |
| result = response.result() | |
| assert result["answers"]["route"]["choice"] == "billing" | |
| assert request.calls == 1 | |
| assert request.probe_task.done() | |
| finally: | |
| # Do not let a deliberately cancellation-resistant fake leak after red. | |
| request.is_disconnected = disconnected_now | |
| if request.probe_task is not None: | |
| request.probe_task.cancel() | |
| response.cancel() | |
| await asyncio.gather(response, return_exceptions=True) | |
| async def disconnected_now(): | |
| return True | |
| async def test_client_disconnect_still_cancels_unfinished_inference(): | |
| backend = ControlledBackend() | |
| endpoint, body = endpoint_and_body(backend) | |
| class DisconnectedRequest: | |
| async def is_disconnected(self): | |
| await backend.entered.wait() | |
| return True | |
| with pytest.raises(AdapterError) as error: | |
| await asyncio.wait_for(endpoint(body, DisconnectedRequest()), timeout=1) | |
| assert error.value.code == "client_disconnected" | |
| assert error.value.status == 499 | |
| assert backend.cancelled.is_set() | |
| async def test_cancelled_handler_joins_work_and_cancellation_resistant_watcher(): | |
| backend = ControlledBackend() | |
| endpoint, body = endpoint_and_body(backend) | |
| request = CancellationSwallowingRequest() | |
| response = asyncio.create_task(endpoint(body, request)) | |
| try: | |
| await asyncio.wait_for(request.entered.wait(), timeout=1) | |
| await asyncio.wait_for(backend.entered.wait(), timeout=1) | |
| response.cancel() | |
| done, _ = await asyncio.wait({response}, timeout=0.1) | |
| assert response in done, "cancelled handler did not release its child tasks" | |
| with pytest.raises(asyncio.CancelledError): | |
| response.result() | |
| assert backend.cancelled.is_set() | |
| assert request.swallowed.is_set() | |
| assert request.probe_task.done() | |
| finally: | |
| request.is_disconnected = disconnected_now | |
| if request.probe_task is not None: | |
| request.probe_task.cancel() | |
| response.cancel() | |
| await asyncio.gather(response, return_exceptions=True) | |