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)# 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=40) 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/jev_adapter/server.py from StandardThinking/StandardOne-3B: direct link, hf CLI and curl.
- Browser
- Download file 4.44 kB
-
https://huggingface.co/StandardThinking/StandardOne-3B/resolve/main/server/jev_adapter/server.py
- Command line
-
hf download hf://StandardThinking/StandardOne-3B/server/jev_adapter/server.py
-
curl -L -o server.py https://huggingface.co/StandardThinking/StandardOne-3B/resolve/main/server/jev_adapter/server.py
4.44 kB
| """Standalone HTTP process; only the backend client talks to an inference server.""" | |
| import asyncio | |
| import logging | |
| import secrets | |
| from contextlib import asynccontextmanager | |
| from fastapi import Depends, FastAPI, Request | |
| from fastapi.exceptions import RequestValidationError | |
| from fastapi.responses import JSONResponse | |
| from .backend import AdapterError, ScoringBackend | |
| from .protocol import SystemOneRequest | |
| from .service import SystemOneService | |
| logger = logging.getLogger(__name__) | |
| def create_app( | |
| backend: ScoringBackend, | |
| *, | |
| api_key: str | None = None, | |
| max_concurrency: int = 32, | |
| alias: str = "jev-latest", | |
| default_temperature: float = 1.0, | |
| temperature_by_type: dict[str, float] | None = None, | |
| prompt_wording: str = "served", | |
| ) -> FastAPI: | |
| service = SystemOneService( | |
| backend, | |
| max_concurrency=max_concurrency, | |
| alias=alias, | |
| default_temperature=default_temperature, | |
| temperature_by_type=temperature_by_type, | |
| prompt_wording=prompt_wording, | |
| ) | |
| async def lifespan(app): | |
| try: | |
| await backend.start() | |
| yield | |
| finally: | |
| await backend.close() | |
| app = FastAPI(title="Jev adapter", version="0.1.0", lifespan=lifespan) | |
| async def authorize(request: Request): | |
| if api_key and not secrets.compare_digest( | |
| request.headers.get("authorization", "").encode("utf-8"), | |
| f"Bearer {api_key}".encode(), | |
| ): | |
| raise AdapterError( | |
| "unauthorized", "A valid bearer token is required.", status=401 | |
| ) | |
| async def adapter_error(request, exc): | |
| return JSONResponse( | |
| status_code=exc.status, | |
| content={ | |
| "error": { | |
| "code": exc.code, | |
| "message": str(exc), | |
| "field": exc.field, | |
| } | |
| }, | |
| ) | |
| async def validation_error(request, exc): | |
| error = exc.errors()[0] | |
| return JSONResponse( | |
| status_code=422, | |
| content={ | |
| "error": { | |
| "code": "invalid_request", | |
| "message": error["msg"], | |
| "field": ".".join(str(p) for p in error["loc"] if p != "body"), | |
| } | |
| }, | |
| ) | |
| async def health(): | |
| # Process liveness, not an inference/GPU readiness probe. | |
| return {"status": "ok"} | |
| async def models(): | |
| return { | |
| "object": "list", | |
| "data": [ | |
| { | |
| "id": backend.model, | |
| "object": "model", | |
| "owned_by": "inference-engine", | |
| }, | |
| ], | |
| } | |
| async def systemone(body: SystemOneRequest, request: Request): | |
| work = asyncio.create_task(service.score(body)) | |
| stop_watching = False | |
| async def disconnected(): | |
| while not stop_watching: | |
| if await request.is_disconnected(): | |
| return | |
| if not stop_watching: | |
| await asyncio.sleep(0.05) | |
| watcher = asyncio.create_task(disconnected()) | |
| try: | |
| done, _ = await asyncio.wait( | |
| (work, watcher), | |
| return_when=asyncio.FIRST_COMPLETED, | |
| ) | |
| if work in done: | |
| return await work | |
| raise AdapterError( | |
| "client_disconnected", "Client disconnected.", status=499 | |
| ) | |
| except AdapterError: | |
| raise | |
| except Exception: | |
| logger.exception("Decision scoring failed") | |
| raise AdapterError( | |
| "scoring_failed", | |
| "Could not compute a complete decision.", | |
| status=500, | |
| ) from None | |
| finally: | |
| # A disconnect probe's own cancellation scope can absorb cancel(). | |
| # Stop explicitly as well, including before another polling sleep. | |
| stop_watching = True | |
| work.cancel() | |
| watcher.cancel() | |
| await asyncio.gather(work, watcher, return_exceptions=True) | |
| return app | |