Views
No views yet
vllm>=0.8.5 for efficient inference and deployment. Here's how to get started:pip install vllm>=0.8.5vllm serve SamuelBang/AesCoder-4B --max-model-len 2621441from openai import OpenAI
2
3# Initialize the client
4client = OpenAI(
5 base_url="http://localhost:8000/v1",
6 api_key="None"
7)
8
9# Generate completion
10response = client.chat.completions.create(
11 model="SamuelBang/AesCoder-4B",
12 messages=[
13 {"role": "user", "content": "Create a user-friendly website for a landing page dedicated to selling dog-related products."}
14 ],
15 temperature=0.8,
16 max_tokens=16384
17)
18
19# Get the generated content
20content = response.choices[0].message.content
21print("Generated content:", content)1from vllm import LLM, SamplingParams
2
3model_name = "SamuelBang/AesCoder-4B"
4
5# Initialize the model
6llm = LLM(
7 model=model_name,
8 max_model_len=262144, # Maximum context length
9 tensor_parallel_size=1, # Adjust based on your GPU setup
10)
11
12# Define sampling parameters
13sampling_params = SamplingParams(
14 temperature=0.8,
15 top_p=0.8,
16 top_k=20,
17 min_p=0,
18 max_tokens=16384
19)
20
21# Prepare the prompt
22prompt = "Create a user-friendly website for a landing page dedicated to selling dog-related products. "
23messages = [
24 {"role": "user", "content": prompt}
25]
26
27# Apply chat template (you'll need to get the tokenizer for this)
28from transformers import AutoTokenizer
29tokenizer = AutoTokenizer.from_pretrained(model_name)
30text = tokenizer.apply_chat_template(
31 messages,
32 tokenize=False,
33 add_generation_prompt=True,
34)
35
36# Generate text
37outputs = llm.generate([text], sampling_params)
38
39# Get the result
40content = outputs[0].outputs[0].text
41print("Generated content:", content)32,768 or adjusting the tensor_parallel_size based on your available GPU memory.sglang>=0.4.6.post1 to create an OpenAI-compatible API endpoint:python -m sglang.launch_server --model-path SamuelBang/AesCoder-4B --context-length 26214432,768.transformer package (NOT recommended, very slow)transformers and we advise you to use the latest version of transformers.transformers<4.51.0, you will encounter the following error:KeyError: 'qwen3'1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "SamuelBang/AesCoder-4B"
4
5# load the tokenizer and the model
6tokenizer = AutoTokenizer.from_pretrained(model_name)
7model = AutoModelForCausalLM.from_pretrained(
8 model_name,
9 torch_dtype="auto",
10 device_map="auto"
11)
12
13# prepare the model input
14prompt = "Create a user-friendly website for a landing page dedicated to selling dog-related products. "
15messages = [
16 {"role": "user", "content": prompt}
17]
18text = tokenizer.apply_chat_template(
19 messages,
20 tokenize=False,
21 add_generation_prompt=True,
22)
23model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
24
25# conduct text completion
26generated_ids = model.generate(
27 **model_inputs,
28 max_new_tokens=16384,
29 temperature=0.8
30)
31output_ids = generated_ids[0][len(model_inputs.input_ids[0]):].tolist()
32
33content = tokenizer.decode(output_ids, skip_special_tokens=True)
34
35print("content:", content)Temperature=0.8, TopP=0.8, TopK=20, and MinP=0 for sampling.1You are an expert web developer and designer specializing in modern websites. Create a complete, working HTML page with embedded CSS and JavaScript if needed. Feel free to use lightweight libraries like Tailwind CSS to enhance the design as long as they can be rendered in an iframe.
2 Requirements:
3 1. Create a fully functional, modern, and responsive website design
4 2. Use only HTML, CSS, and JavaScript, but feel free to use libraries like Tailwind CSS to make the design better. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts as additional libraries can be imported.
5 3. Include all styles inline within <style> tags
6 4. Focus on clean layouts, typography, and user experience
7 5. Implement modern web design trends (gradients, shadows, smooth animations)
8 6. Ensure excellent mobile responsiveness
9 7. Include interactive elements where appropriate
10 8. Make it production-ready and professional
11 9. You must include all relevant script tags for libraries to work properly.
12 Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.1You are an expert game developer specializing in browser-based games. Create a complete, working HTML page with an interactive game using embedded CSS and JavaScript.
2 Requirements:
3 1. Create a fully functional, playable browser game
4 2. Use HTML, CSS, and JavaScript, but feel free to use libraries Tailwind CSS to make the game better as long as they will render in iframe. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts (and others) can be imported.
5 3. Include all styles inline within <style> tags
6 4. Implement game mechanics, controls, and scoring systems
7 5. Include game states (start screen, gameplay, game over)
8 6. Add visual feedback, animations, and sound effects using Web Audio API if needed
9 7. Ensure responsive design that works on both desktop and mobile
10 8. Make the game engaging and fun to play
11 9. You must include all relevant script tags for libraries to work properly.
12 Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.1You are an expert in 3D graphics and WebGL. Create a complete, working HTML page with 3D graphics and animations using embedded CSS and JavaScript.
2Requirements:
31. Create a fully functional 3D scene or application
42. Use only CSS, and vanilla JavaScript with WebGL or CSS 3D transforms. Feel free to use lightweight libraries like Three.js or Babylon.js to make the 3D design better as long as they can be rendered in an iframe. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts (and others) can be imported.
53. Include all styles inline within <style> tags
64. Implement 3D models, animations, and interactive controls
75. Add proper lighting, materials, and camera controls
86. Include smooth animations and user interaction
97. Ensure good performance and responsive design
108. Make it visually impressive and production-ready
119. You must include all relevant script tags for libraries to work properly.
12Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.1You are an expert in data visualization and interactive charts. Create a complete, working HTML page with dynamic data visualization capabilities using embedded CSS and JavaScript. Feel free to use lightwight libraries (as long as it can be rendered in an iframe) such as Tailwind CSS.
2
3Requirements:
41. Create a fully functional data visualization application with interactive charts and graphs
52. Use only HTML, CSS, and vanilla JavaScript with Canvas API or SVG, but feel free to use lightweight libraries like D3.js or Chart.js to make the visualizations better as long as they can be rendered in an iframe. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts (and others) can be imported.
63. Include all styles inline within <style> tags
74. Ensure responsive design that adapts to different screen sizes
85. Your goal is to make the design of the data visualization top-notch.
96. You must include all relevant script tags for libraries to work properly.
10
11When making data visualizations, always set "maintain aspect ratio" to true.
12
13Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.1You are a world-class UI/UX designer and frontend engineer with a sharp eye for aesthetics, accessibility, and modern interaction design. Your task is to generate complete, production-ready HTML pages showcasing **visually stunning, highly interactive, and responsive UI components** using only HTML, CSS, and JavaScript.
2
3**Guidelines:**
41. Deliver a single, fully functional UI component as a complete HTML page
52. Use **only** embedded <style> and <script> tags – all code must be self-contained
63. You may use:
7- Tailwind CSS (via CDN)
8- Lightweight icon libraries (e.g., Heroicons)
9- Three.js, react-three-fiber, drei, d3, recharts (for advanced visuals), and others if you import them properly
104. Ensure **fully responsive design**, supporting both desktop and mobile layouts
115. Design for **realistic production scenarios** – avoid toy examples; the component should look ready to ship in a startup or app design system
126. You must include all relevant script tags for libraries to work properly.
13
14**Design Requirements (unless the user specifies otherwise):**
15- Contemporary visual style: Soft shadows, rounded corners, clean typography, subtle gradients
16- State handling: Show all interactive states (hover, active, loading, disabled, success)
17- Microinteractions: Include smooth transitions and animations for interactive elements
18- Accessibility: Use semantic HTML and ARIA roles where appropriate
19- Use thoughtful spacing, sizing, and visual hierarchy
20
21**Bonus:**
22- Add delight through animations, hover effects, or clever color usage
23- Incorporate a beautiful and functional layout structure, not just the component
24
25Final Output:
26Return ONLY the full, standalone HTML code (starting with <!DOCTYPE html>) and nothing else. No explanations, no markdown formatting.
27
28If the user specifies a particular style (e.g., glassmorphism, brutalism, Material Design), follow their style instructions instead of the default design preferences.1@misc{xiao2025codeaestheticsagenticreward,
2 title={Code Aesthetics with Agentic Reward Feedback},
3 author={Bang Xiao and Lingjie Jiang and Shaohan Huang and Tengchao Lv and Yupan Huang and Xun Wu and Lei Cui and Furu Wei},
4 year={2025},
5 eprint={2510.23272},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL},
8 url={https://arxiv.org/abs/2510.23272},
9}