Mr-profik/Profik-AI-Coding
061
1---2base_model:3- huihui-ai/Huihui-Qwen3-4B-Thinking-2507-abliterated4datasets:5- Aquiles-ai/Athenea-Coding-100k6license: apache-2.07tags:8- code9- agent10- text-generation-inference11- merge12- uncensored13- athenea14language:15- en16- es17pipeline_tag: text-generation18library_name: transformers19---20 21<h1 align="center">Athenea-4B-Coding</h1>22 2324 25**Athenea-4B-Coding** is a fine-tuned version of [huihui-ai/Huihui-Qwen3-4B-Thinking-2507-abliterated](https://huggingface.co/huihui-ai/Huihui-Qwen3-4B-Thinking-2507-abliterated), specialized in **code reasoning, debugging, and problem solving**.26Trained on high-quality programming data with explicit reasoning traces using `<think>` and `</think>` tags, the model is designed to perform detailed step-by-step reasoning for software development, algorithm design, and code comprehension tasks.27 28> ⚠️ **Important Note:** This model uses an *abliterated (uncensored)* base version, providing full expressive freedom and unrestricted output generation. Users are fully responsible for any use or content produced by the model. It is intended exclusively for research and experimentation purposes.29 30## 🎯 Model Description31 32Athenea-4B-Coding extends Huihui-Qwen3’s structured reasoning capabilities into programming-related domains, showing strong performance on logical problem-solving, code completion, and debugging scenarios.33 34Key features:35 36* **Step-by-step code reasoning** within `<think>` blocks37* **Specialization in algorithmic and debugging tasks**38* **Uncensored output generation** for full reasoning visibility39* **Improved logical consistency** through focused fine-tuning40* **Compatible with open inference frameworks** (Transformers, vLLM, etc.)41 42The model was fine-tuned using the dataset [Aquiles-ai/Athenea-Coding-100k](https://huggingface.co/datasets/Aquiles-ai/Athenea-Coding-100k), which includes diverse programming challenges, structured reasoning chains, and natural language explanations across multiple programming languages.43 44> Note: Fine-tuning was performed using **Kronos**, Aquiles-ai’s proprietary enterprise fine-tuning system.45 46## 💻 Usage47 48### Installation49 50```bash51uv pip install transformers torch accelerate52```53 54### Basic Inference55 56```python57from transformers import AutoModelForCausalLM, AutoTokenizer58import torch59 60model = AutoModelForCausalLM.from_pretrained("Aquiles-ai/Athenea-4B-Coding",61 dtype=torch.bfloat16,62 trust_remote_code=True,63 device_map="auto",64 attn_implementation="flash_attention_2") # Requires flash-attn65 66# Without flash-attn:67# model = AutoModelForCausalLM.from_pretrained("Aquiles-ai/Athenea-4B-Coding",68# dtype="auto",69# device_map="auto"70# )71 72tokenizer = AutoTokenizer.from_pretrained("Aquiles-ai/Athenea-4B-Coding", trust_remote_code=True)73 74messages = [75 {"role": "user", "content": "Hey, write a Python function that calculates the factorial of a number recursively."}76]77 78inputs = tokenizer.apply_chat_template(79 messages,80 add_generation_prompt=True,81 tokenize=True,82 return_dict=True,83 return_tensors="pt",84).to('cuda')85 86with torch.no_grad():87 output = model.generate(88 **inputs,89 max_new_tokens=8092,90 pad_token_id=tokenizer.eos_token_id,91 eos_token_id=tokenizer.eos_token_id,92 )93 94# Decode and print the output95print(tokenizer.decode(output[0], skip_special_tokens=True))96```97 98### Streaming Inference99 100```python101from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer102import torch103from threading import Thread104 105model = AutoModelForCausalLM.from_pretrained("Aquiles-ai/Athenea-4B-Coding",106 dtype=torch.bfloat16,107 trust_remote_code=True,108 device_map="auto",109 attn_implementation="flash_attention_2")110 111tokenizer = AutoTokenizer.from_pretrained("Aquiles-ai/Athenea-4B-Coding", trust_remote_code=True)112 113messages = [114 {"role": "user", "content": "Hey, write a Python function that implements the binary search algorithm recursively."}115]116 117inputs = tokenizer.apply_chat_template(118 messages,119 add_generation_prompt=True,120 tokenize=True,121 return_dict=True,122 return_tensors="pt",123).to('cuda')124 125# Create the streamer126streamer = TextIteratorStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)127 128# Build kwargs for generate129generate_kwargs = dict(130 **inputs,131 max_new_tokens=8092,132 pad_token_id=tokenizer.eos_token_id,133 eos_token_id=tokenizer.eos_token_id,134 streamer=streamer,135)136 137def _generate_thread(model, kwargs):138 with torch.no_grad():139 model.generate(**kwargs)140 141thread = Thread(target=_generate_thread, args=(model, generate_kwargs))142thread.start()143 144for chunk in streamer:145 print(chunk, end="", flush=True)146```147 148### Production Deployment with vLLM149 150**Start server:**151 152```bash153vllm serve Aquiles-ai/Athenea-4B-Coding \154 --host 0.0.0.0 \155 --port 8000 \156 --api-key dummyapikey \157 --max-model-len=16384 \158 --async-scheduling \159 --gpu-memory-utilization=0.90160```161 162**Request to the server from the OpenAI client:**163 164```python165from openai import OpenAI166client = OpenAI(api_key="dummyapikey", base_url="http://127.0.0.1:8000/v1")167stream = client.chat.completions.create(168 model="Aquiles-ai/Athenea-4B-Coding",169 messages=[{170 "role": "user",171 "content": "Hey, write a Python function that determines if a string is a palindrome, ignoring case, spaces, and punctuation."172 }],173 max_tokens=8092,174 stream=True175)176for chunk in stream:177 if chunk.choices[0].delta.content:178 print(chunk.choices[0].delta.content, end="", flush=True)179```180 181**vLLM Benefits:** 20-30x faster inference, OpenAI-compatible API, continuous batching, async scheduling.182 183## Contact184 185- **More about [Aquiles-ai](https://aquiles-ai.vercel.app)).**186 187- **Aquiles-ai on [GitHub](https://github.com/Aquiles-ai).**188 189- **Our collections at [HuggingFace](https://huggingface.co/Aquiles-ai/collections).**190 191### Aquiles-playground192 193In addition to code usage, you can also try our models locally through an [open-source playground on GitHub](https://github.com/Aquiles-ai/aquiles-playground).194 195196 197<p align="center">198 Made with ❤️ by <a href="https://github.com/Aquiles-ai">Aquiles-ai</a>199</p>