Run this model with HF Jobs
Run arcee-ai/AFM-4.5B-Preview 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/arcee-ai/AFM-4.5B-Preview. 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/arcee-ai/AFM-4.5B-Preview 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/arcee-ai/AFM-4.5B-Preview. 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/arcee-ai/AFM-4.5B-Preview. 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 arcee-ai/AFM-4.5B-Preview with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use arcee-ai/AFM-4.5B-Preview with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="arcee-ai/AFM-4.5B-Preview") 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("arcee-ai/AFM-4.5B-Preview") model = AutoModelForCausalLM.from_pretrained("arcee-ai/AFM-4.5B-Preview", 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 arcee-ai/AFM-4.5B-Preview with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "arcee-ai/AFM-4.5B-Preview" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "arcee-ai/AFM-4.5B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/arcee-ai/AFM-4.5B-Preview
- SGLang
How to use arcee-ai/AFM-4.5B-Preview 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 "arcee-ai/AFM-4.5B-Preview" \ --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": "arcee-ai/AFM-4.5B-Preview", "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 "arcee-ai/AFM-4.5B-Preview" \ --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": "arcee-ai/AFM-4.5B-Preview", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use arcee-ai/AFM-4.5B-Preview with Docker Model Runner:
docker model run hf.co/arcee-ai/AFM-4.5B-Preview
Upload folder using huggingface_hub
Browse filesFiles changed (4)
3 unmodified lines456789101112131420 unmodified lines353637383940413 unmodified lines],"attention_bias": false,"attention_dropout": 0.0,"auto_map": {"AutoConfig": "MaziyarPanahi/afm-sage-v8.4--configuration_arcee.ArceeConfig","AutoModel": "MaziyarPanahi/afm-sage-v8.4--modeling_arcee.ArceeForCausalLM","AutoModelForCausalLM": "MaziyarPanahi/afm-sage-v8.4--modeling_arcee.ArceeForCausalLM"},"bos_token_id": 128000,"eos_token_id": 128003,"head_dim": 128,20 unmodified lines"rope_theta": 10000.0,"tie_word_embeddings": false,"torch_dtype": "bfloat16","transformers_version": "4.52.4","use_cache": false,"vocab_size": 128064}3 unmodified lines45678920 unmodified lines303132333435363 unmodified lines],"attention_bias": false,"attention_dropout": 0.0,"bos_token_id": 128000,"eos_token_id": 128003,"head_dim": 128,20 unmodified lines"rope_theta": 10000.0,"tie_word_embeddings": false,"torch_dtype": "bfloat16","transformers_version": "4.54.1","use_cache": false,"vocab_size": 128064}
1 unmodified line2345671 unmodified line"_from_model_config": true,"bos_token_id": 128000,"eos_token_id": 128003,"transformers_version": "4.52.4","use_cache": false}1 unmodified line2345671 unmodified line"_from_model_config": true,"bos_token_id": 128000,"eos_token_id": 128003,"transformers_version": "4.54.1","use_cache": false}
12345{"metadata": {"total_size": 9238983680},"weight_map": {123456{"metadata": {"total_parameters": 4619491840,"total_size": 9238983680},"weight_map": {
41 unmodified lines424344454647484 unmodified lines535455565741 unmodified lines}},"bos_token": "<|begin_of_text|>","chat_template": "{{ bos_token }}{%- set loop_messages = messages %}\n{%- if loop_messages[0]['role'] != 'system' %}\n<|im_start|>system\nYou are a helpful assistant named AFM-4.5B-Preview, trained by Arcee AI.<|im_end|>\n{%- endif %}\n{%- for message in loop_messages %}\n{%- set content = '<|im_start|>' + message['role'] + '\\n'+ message['content'] | trim %}\n{%- if loop.index0 == 0 %}\n{%- set content = content %}\n{%- endif %}\n{%- if not (loop.last and message['role'] == 'assistant') %}\n{%- set content = content + '<|im_end|>\\n' %}\n{%- endif %}\n{{- content }}\n{%- endfor %}\n{%- if messages[-1]['role'] != 'assistant' %}\n{{- '<|im_start|>assistant\\n' }}\n{%- endif %}","clean_up_tokenization_spaces": true,"eos_token": "<|end_of_text|>","extra_special_tokens": {},4 unmodified lines"model_max_length": 65536,"pad_token": "<|finetune_right_pad_id|>","padding_side": "left","tokenizer_class": "PreTrainedTokenizer"}41 unmodified lines4243444546474 unmodified lines525354555641 unmodified lines}},"bos_token": "<|begin_of_text|>","clean_up_tokenization_spaces": true,"eos_token": "<|end_of_text|>","extra_special_tokens": {},4 unmodified lines"model_max_length": 65536,"pad_token": "<|finetune_right_pad_id|>","padding_side": "left","tokenizer_class": "PreTrainedTokenizerFast"}
config.json+1-6
generation_config.json+1-1
model.safetensors.index.json+1
tokenizer_config.json+1-2