Instructions to use ldp72/Test-SmolLM-Marcel-codecarbon with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ldp72/Test-SmolLM-Marcel-codecarbon with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ldp72/Test-SmolLM-Marcel-codecarbon") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ldp72/Test-SmolLM-Marcel-codecarbon") model = AutoModelForCausalLM.from_pretrained("ldp72/Test-SmolLM-Marcel-codecarbon") 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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use ldp72/Test-SmolLM-Marcel-codecarbon with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ldp72/Test-SmolLM-Marcel-codecarbon" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ldp72/Test-SmolLM-Marcel-codecarbon", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ldp72/Test-SmolLM-Marcel-codecarbon
- SGLang
How to use ldp72/Test-SmolLM-Marcel-codecarbon 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 "ldp72/Test-SmolLM-Marcel-codecarbon" \ --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": "ldp72/Test-SmolLM-Marcel-codecarbon", "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 "ldp72/Test-SmolLM-Marcel-codecarbon" \ --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": "ldp72/Test-SmolLM-Marcel-codecarbon", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ldp72/Test-SmolLM-Marcel-codecarbon with Docker Model Runner:
docker model run hf.co/ldp72/Test-SmolLM-Marcel-codecarbon
File size: 1,291 Bytes
8d658b6 d979620 | 1 2 3 4 | timestamp,project_name,run_id,experiment_id,duration,emissions,emissions_rate,cpu_power,gpu_power,ram_power,cpu_energy,gpu_energy,ram_energy,energy_consumed,country_name,country_iso_code,region,cloud_provider,cloud_region,os,python_version,codecarbon_version,cpu_count,cpu_model,gpu_count,gpu_model,longitude,latitude,ram_total_size,tracking_mode,on_cloud,pue
2025-08-28T15:49:53,lm_adaptation,ef663567-f656-4a5f-addc-c59c4af2a2ec,5b0fa12a-3dd7-45bb-9766-cc326314d9f1,305.22420004196465,0.0004140588578183,1.3565728332203015e-06,2.548125,33.58575069944228,54.0,0.0006163177559056,0.0031272630573653,0.0036451816167925,0.0073887624300634,France,FRA,,,,Linux-5.10.0-32-amd64-x86_64-with-glibc2.35,3.12.11,3.0.4,32,AMD EPYC 7282 16-Core Processor,1,1 x NVIDIA A100-PCIE-40GB,2.3387,48.8582,503.433219909668,process,N,1.0
2025-08-28T16:18:26,lm_adaptation,6a99e4c0-615f-4ac7-b8b9-fbb41b6953bf,5b0fa12a-3dd7-45bb-9766-cc326314d9f1,339.06427432689816,0.00047581583856711547,1.4033204751862846e-06,2.95375,34.202068769585054,62.0,0.0006691973303178071,0.003499830022064998,0.004321770816162591,0.008490798168545395,France,FRA,,,,Linux-5.10.0-32-amd64-x86_64-with-glibc2.35,3.12.11,3.0.4,32,AMD EPYC 7282 16-Core Processor,1,1 x NVIDIA A100-PCIE-40GB,2.3387,48.8582,503.43321990966797,process,N,1.0
|