Run this model with HF Jobs
Run SamuelBang/AesCoder-4B 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/SamuelBang/AesCoder-4B. 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/SamuelBang/AesCoder-4B 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/SamuelBang/AesCoder-4B. 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/SamuelBang/AesCoder-4B. 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 SamuelBang/AesCoder-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SamuelBang/AesCoder-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SamuelBang/AesCoder-4B") 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("SamuelBang/AesCoder-4B") model = AutoModelForCausalLM.from_pretrained("SamuelBang/AesCoder-4B", 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 SamuelBang/AesCoder-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SamuelBang/AesCoder-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SamuelBang/AesCoder-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SamuelBang/AesCoder-4B
- SGLang
How to use SamuelBang/AesCoder-4B 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 "SamuelBang/AesCoder-4B" \ --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": "SamuelBang/AesCoder-4B", "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 "SamuelBang/AesCoder-4B" \ --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": "SamuelBang/AesCoder-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SamuelBang/AesCoder-4B with Docker Model Runner:
docker model run hf.co/SamuelBang/AesCoder-4B
Improve model card: Add metadata, news, abstract, to-do list, and GitHub link
Browse filesThis PR significantly enhances the model card for AesCoder-4B by:
- Adding the `pipeline_tag: text-generation` for accurate categorization and improved discoverability on the Hugging Face Hub.
- Specifying `library_name: transformers` to enable the automated "how to use" widget, as the model is explicitly compatible with the `transformers` library.
- Including the `license: apache-2.0` for clear licensing information, based on common practice for similar models.
- Adding the Hugging Face model badge from the project's GitHub README to the introductory section.
- Incorporating an explicit link to the GitHub repository for easy access to the codebase.
- Integrating the `
123456789101129 unmodified lines414243444546248 unmodified lines295296297298299300301302303---base_model:- Qwen/Qwen3-4B-Instruct-2507---# Code Aesthetics with Agentic Reward Feedback<div align="center"><a href='https://bangx7.github.io/code-aesthetics/'><img src='https://img.shields.io/badge/Project-Page-Green'></a><br><a href="https://arxiv.org/abs/2510.23272"><b>Paper Link</b>👁️</a></div>29 unmodified lines</p></div>**Note: This is the version of AesCoder-4B model for only webpage design.**## Quickstart248 unmodified linesIf the user specifies a particular style (e.g., glassmorphism, brutalism, Material Design), follow their style instructions instead of the default design preferences.```## 📚 CitationIf you find this codebase useful for your research, please use the following entry.```BibTeX1234567891011121314151629 unmodified lines46474849505152535455565758596061626364248 unmodified lines313314315316317318---base_model:- Qwen/Qwen3-4B-Instruct-2507pipeline_tag: text-generationlibrary_name: transformerslicense: apache-2.0---# Code Aesthetics with Agentic Reward Feedback<div align="center"><a href='https://bangx7.github.io/code-aesthetics/'><img src='https://img.shields.io/badge/Project-Page-Green'></a><a href="https://huggingface.co/SamuelBang/AesCoder-4B"><img alt="Hugging Face"src="https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-ffc107?color=ffc107&logoColor=white"/></a><br><a href="https://arxiv.org/abs/2510.23272"><b>Paper Link</b>👁️</a></div>29 unmodified lines</p></div>For the codebase, refer to: https://github.com/bangx7/code_aesthetics## 🎉 News- __[2025.10.27]__: Release the [Project Page](https://bangx7.github.io/code-aesthetics/) and the [Arxiv](https://arxiv.org/abs/2510.23272) version.## 📷 AbstractLarge Language Models (LLMs) have become valuable assistants for developers in code-related tasks. While LLMs excel at traditional programming tasks such as code generation and bug fixing, they struggle with visually-oriented coding tasks, often producing suboptimal aesthetics. In this paper, we introduce a new pipeline to enhance the aesthetic quality of LLM-generated code. We first construct AesCode-358K, a large-scale instruction-tuning dataset focused on code aesthetics. Next, we propose agentic reward feedback, a multi-agent system that evaluates executability, static aesthetics, and interactive aesthetics. Building on this, we develop GRPO-AR, which integrates these signals into the GRPO algorithm for joint optimization of functionality and code aesthetics. Finally, we develop OpenDesign, a benchmark for assessing code aesthetics. Experimental results show that combining supervised fine-tuning on AesCode-358K with reinforcement learning using agentic reward feedback significantly improves performance on OpenDesign and also enhances results on existing benchmarks such as PandasPlotBench. Notably, our AesCoder-4B surpasses GPT-4o and GPT-4.1, and achieves performance comparable to large open-source models with 480B-685B parameters, underscoring the effectiveness of our approach.## To-do List- [x] Release paper and project page- [ ] Release our AesCoder model- [ ] Release code**Note: This is the version of AesCoder-4B model for only webpage design.**## Quickstart248 unmodified linesIf the user specifies a particular style (e.g., glassmorphism, brutalism, Material Design), follow their style instructions instead of the default design preferences.```## 📚 CitationIf you find this codebase useful for your research, please use the following entry.```BibTeX