Text Generation
Transformers
Safetensors
English
qwen3
clinical
medical
instruction-following
tool-calling
function-calling
KOS-V4
from-scratch
conversational
text-generation-inference
Run this model with HF Jobs
Run Kentucky-Open-Science/KOS-V4-Instruct 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-V4-Instruct. 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-V4-Instruct 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-V4-Instruct. 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-V4-Instruct. 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-V4-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Kentucky-Open-Science/KOS-V4-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Kentucky-Open-Science/KOS-V4-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Kentucky-Open-Science/KOS-V4-Instruct") model = AutoModelForCausalLM.from_pretrained("Kentucky-Open-Science/KOS-V4-Instruct", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Kentucky-Open-Science/KOS-V4-Instruct 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-V4-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Kentucky-Open-Science/KOS-V4-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Kentucky-Open-Science/KOS-V4-Instruct
- SGLang
How to use Kentucky-Open-Science/KOS-V4-Instruct 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-V4-Instruct" \ --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": "Kentucky-Open-Science/KOS-V4-Instruct", "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 "Kentucky-Open-Science/KOS-V4-Instruct" \ --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": "Kentucky-Open-Science/KOS-V4-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Kentucky-Open-Science/KOS-V4-Instruct with Docker Model Runner:
docker model run hf.co/Kentucky-Open-Science/KOS-V4-Instruct
Add commercial reference baselines (GPT-3.5-turbo, Command R, Gemini 1.0 Pro), sourced/attributed
Browse files245 unmodified lines246247248249250251252253254255245 unmodified linesLlama-3-8B-Instruct, Llama-3.2-3B, Qwen2.5-3B and Phi-3-medium-14B. (Llama-3.1-8B's leaderboard IFEval is lower thanits scores on some later evaluations; it is shown here as the archived value.)**Sources.** Metric definition: the official IFEval implementation, `google-research/instruction_following_eval`.Open-model AVG4: computed from `open-llm-leaderboard/results`. Company, parameter count, and release date:`open-llm-leaderboard/contents`. GPT-3.5-turbo: AVG4 from OpenAI's reported IFEval sub-metrics(prompt/inst strict + loose = 53.8 / 64.7 / 56.6 / 67.5).## Compute footprint & requirements### Training245 unmodified lines246247248249250251252253254255256257258259260261262263264265266267268269270271245 unmodified linesLlama-3-8B-Instruct, Llama-3.2-3B, Qwen2.5-3B and Phi-3-medium-14B. (Llama-3.1-8B's leaderboard IFEval is lower thanits scores on some later evaluations; it is shown here as the archived value.)**Commercial reference baselines (reported).** KOS-V4's 62.7 sits squarely in the original commercial-API tier.These are provider/endpoint figures (commercial models are not on the Open LLM Leaderboard), reported as published byeach provider, so treat them as approximate, commercial IFEval is often reported as strict or 2-metric rather thanthe 4-metric AVG4 used in the open-model table above.| commercial model | company | endpoint | reported IFEval || :-- | :-- | :-- | :-- || GPT-3.5-turbo | OpenAI | gpt-3.5-turbo-0125 | ~60.7 (AVG4) / ~63 (strict-prompt) || Cohere Command R | Cohere | command-r (early 2024) | ~62.0 || Gemini 1.0 Pro | Google | gemini-1.0-pro-001 | ~58-61 |**Takeaway.** From a fraction of the data and 24 GPUs, KOS-V4 (62.7) runs **neck-and-neck with the originalcommercial API generation**, GPT-3.5-turbo, Cohere Command R, and Gemini 1.0 Pro.**Sources.** Metric definition: the official IFEval implementation, `google-research/instruction_following_eval`.Open-model AVG4: computed from `open-llm-leaderboard/results`. Company, parameter count, and release date:`open-llm-leaderboard/contents`. GPT-3.5-turbo: AVG4 from OpenAI's reported IFEval sub-metrics(prompt/inst strict + loose = 53.8 / 64.7 / 56.6 / 67.5). Commercial reference baselines (GPT-3.5-turbo, CohereCommand R, Gemini 1.0 Pro): figures reported by the respective providers for the named endpoints; these are notOpen-LLM-Leaderboard entries and their metric basis is provider-defined, hence marked approximate.## Compute footprint & requirements### Training
README.md+17-1