nodejs-coder-qwen25 / README.md
Sriram-214's picture
Upload README.md with huggingface_hub
631df9e verified
metadata
language:
  - en
license: apache-2.0
base_model: unsloth/Qwen2.5-Coder-7B-Instruct-bnb-4bit
tags:
  - text-generation-inference
  - transformers
  - unsloth
  - qwen2
  - trl
  - nodejs
  - javascript
  - backend
  - express
  - gguf
  - ollama
pipeline_tag: text-generation

πŸš€ nodejs-coder-qwen25

A fine-tuned Qwen2.5-Coder-7B-Instruct model specialized for Node.js backend development, trained with LoRA adapters using Unsloth, merged into a single GGUF file for efficient local inference with Ollama.


🧠 Model Description

Property Details
Base Model Qwen2.5-Coder-7B-Instruct
Fine-tuning Method LoRA (Low-Rank Adaptation) via Unsloth
Training Framework TRL SFTTrainer
Quantization GGUF Q4_K_M (~4.4 GB)
Context Length 2048 tokens
Language JavaScript / Node.js

This model is specifically trained to write clean, production-ready Node.js backend code. It understands common backend patterns including REST APIs, database integrations, authentication, and testing.


🎯 Specialties

  • βœ… Express.js β€” REST APIs, middleware, routing
  • βœ… NestJS β€” modules, controllers, services, guards
  • βœ… Sequelize / Prisma β€” ORM models, migrations, queries
  • βœ… MongoDB / Mongoose β€” schemas, models, aggregations
  • βœ… PostgreSQL / pg β€” raw queries, connection pooling
  • βœ… JWT Authentication β€” login, token generation, guards
  • βœ… Jest β€” unit tests, mocking, integration tests
  • βœ… Async/Await β€” file I/O, error handling, promises

⚑ Quick Start with Ollama

Step 1 β€” Download files

hf download Sriram-214/nodejs-coder-qwen25 nodejs-coder-Q4_K_M.gguf --local-dir ./
hf download Sriram-214/nodejs-coder-qwen25 Modelfile --local-dir ./

Step 2 β€” Create Ollama model

ollama create nodejs-coder -f Modelfile

Step 3 β€” Run

ollama run nodejs-coder

πŸ“‹ Modelfile

FROM ./nodejs-coder-Q4_K_M.gguf

PARAMETER temperature 0.7
PARAMETER top_p 0.9
PARAMETER repeat_penalty 1.1
PARAMETER num_ctx 2048
PARAMETER num_gpu 0
PARAMETER stop "<|im_end|>"
PARAMETER stop "<|im_start|>"

TEMPLATE """<|im_start|>system
{{ .System }}<|im_end|>
<|im_start|>user
{{ .Prompt }}<|im_end|>
<|im_start|>assistant
"""

SYSTEM """You are a Node.js backend development expert. You write clean, efficient, production-ready code following best practices. You specialize in Express.js, NestJS, Sequelize, Prisma, MongoDB, PostgreSQL, and Jest testing. Always include error handling and follow RESTful API design principles."""

Note: Set num_gpu 0 for CPU-only mode on GPUs with ≀6GB VRAM. For GPUs with more VRAM, increase this value.


πŸ’¬ Example Prompts & Outputs

Express REST API

Prompt: Write a simple Express.js REST API with a GET /health endpoint

const express = require('express');
const app = express();

app.get('/health', (req, res) => {
  res.status(200).json({ status: 'ok' });
});

app.listen(3000, () => console.log('Server running on port 3000'));

Async File Reading

Prompt: Write a Node.js function that reads a JSON file using async/await

const fs = require('fs').promises;

async function readJsonFile(filePath) {
  try {
    const data = await fs.readFile(filePath, 'utf-8');
    return JSON.parse(data);
  } catch (error) {
    throw new Error(`Failed to read file: ${error.message}`);
  }
}

List Directory Files

Prompt: Write a simple Node.js code to list all the files in a directory

const fs = require('fs');

fs.readdir('./', (err, files) => {
  if (err) throw err;
  console.log(files);
});

πŸ‹οΈ Training Details

Parameter Value
Base Model unsloth/Qwen2.5-Coder-7B-Instruct-bnb-4bit
LoRA Rank 16
LoRA Alpha 32
Training Data Node.js backend code dataset
Training Framework Unsloth + TRL SFTTrainer
Training Environment Google Colab (T4 GPU)
Quantization Q4_K_M via llama.cpp

⚠️ Limitations

  • Optimized for Node.js/JavaScript β€” not suited for other languages
  • Context window of 2048 tokens β€” long files may be truncated
  • CPU inference is slow (~3-5 tokens/sec on modern CPUs)
  • May occasionally produce outdated library syntax

πŸ“„ License

Apache 2.0 β€” see LICENSE