Text Generation
Transformers
Safetensors
English
qwen3
medical
clinical
biomedical
radiology
from-scratch
base-model
university-of-kentucky
university-of-louisville
ccts
text-generation-inference
Run this model with HF Jobs
Run Kentucky-Open-Science/KOS-V5-Base on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/Kentucky-Open-Science/KOS-V5-Base. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/Kentucky-Open-Science/KOS-V5-Base on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/Kentucky-Open-Science/KOS-V5-Base. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/Kentucky-Open-Science/KOS-V5-Base. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use Kentucky-Open-Science/KOS-V5-Base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kentucky-Open-Science/KOS-V5-Base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kentucky-Open-Science/KOS-V5-Base")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kentucky-Open-Science/KOS-V5-Base") model = AutoModelForCausalLM.from_pretrained("Kentucky-Open-Science/KOS-V5-Base", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kentucky-Open-Science/KOS-V5-Base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Kentucky-Open-Science/KOS-V5-Base" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kentucky-Open-Science/KOS-V5-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Kentucky-Open-Science/KOS-V5-Base
- SGLang
How to use Kentucky-Open-Science/KOS-V5-Base 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 "Kentucky-Open-Science/KOS-V5-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kentucky-Open-Science/KOS-V5-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "Kentucky-Open-Science/KOS-V5-Base" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kentucky-Open-Science/KOS-V5-Base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Kentucky-Open-Science/KOS-V5-Base with Docker Model Runner:
docker model run hf.co/Kentucky-Open-Science/KOS-V5-Base
transformers 4.x + 5.x compatibility: dual RoPE schema (flat rope_theta + nested rope_parameters), model_input_names; verified on 4.57.1 and 5.2.0
Browse files70 unmodified lines717273747576777879354 unmodified lines43443543643743843944044144244344444544644744844945045145270 unmodified lines| **Training tokens** | **235.2B** (one complete epoch over a 54-source medical/biomedical corpus) || **Final train loss** | ≈1.16 || **Context** | trained at **24,576** tokens (whole-document); `max_position_embeddings` **32,768** || **RoPE** | standard 1D, **θ = 25,000** (pin this, see *Serving notes*) || **Tokenizer** | custom **32k byte-level BPE** ("v5-32k"), `add_bos_token=False`, single special token `<|endoftext|>` (id 0 = eos/bos/pad) || **Objective** | **pure cross-entropy** (no auxiliary/geometric losses; no SigReg, no STP, no MTP) || **Precision / stack** | bf16, 24×H200, DeepSpeed ZeRO-1, FlashAttention-2 || **Architecture class** | `Qwen3ForCausalLM` (stock, exports with no custom modelling code) |354 unmodified linesmodel = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")prompt = "IMPRESSION: The chest radiograph demonstrates"ids = tok(prompt, return_tensors="pt").to(model.device) # add_bos_token=False by designout = model.generate(**ids, max_new_tokens=128, do_sample=False)print(tok.decode(out[0], skip_special_tokens=True))```### Serving notes (please read; these bite)- **`rope_theta = 25000`, not 10000.** Some conversion paths (notably GGUF) silently fall back to10,000 and quietly damage long-context behaviour. **Pin it explicitly** when converting.- **`add_bos_token=False`.** Setting it true double-prepends BOS and breaks generation.- **One special token.** `<|endoftext|>` (id 0) serves eos/bos/pad and the document separator.- **Base model, no chat template.** It completes text. Prompt it as a completion model, or post-train it.- Requires `transformers` with the nested `rope_parameters` config schema (≥5.x), or convert the config.---70 unmodified lines7172737475767778354 unmodified lines43343443543643743843944044144244344444544644744844970 unmodified lines| **Training tokens** | **235.2B** (one complete epoch over a 54-source medical/biomedical corpus) || **Final train loss** | ≈1.16 || **Context** | trained at **24,576** tokens (whole-document); `max_position_embeddings` **32,768** || **RoPE** | standard 1D, **θ = 25,000** || **Tokenizer** | custom **32k byte-level BPE** ("v5-32k"), `add_bos_token=False`, single special token `<|endoftext|>` (id 0 = eos/bos/pad) || **Precision / stack** | bf16, 24×H200, DeepSpeed ZeRO-1, FlashAttention-2 || **Architecture class** | `Qwen3ForCausalLM` (stock, exports with no custom modelling code) |354 unmodified linesmodel = AutoModelForCausalLM.from_pretrained(model_id, dtype=torch.bfloat16, device_map="auto")prompt = "IMPRESSION: The chest radiograph demonstrates"ids = tok(prompt, return_tensors="pt").to(model.device)out = model.generate(**ids, max_new_tokens=128, do_sample=False)print(tok.decode(out[0], skip_special_tokens=True))```### Notes- **Works with `transformers` 4.x and 5.x out of the box.** Verified on 4.57.1 and 5.2.0: the snippetabove runs unchanged on both.- **Base model, no chat template.** It completes text. Prompt it as a completion model, or post-train it.- **One special token.** `<|endoftext|>` (id 0) serves eos/bos/pad and the document separator.---
README.md+6-9