Team Ai
Modelpublic

Sriram-214/nodejs-coder-qwen25

sourceHugging Faceapache-2.0updated 4mo agoView on Hugging Face
1likes41downloads
Model Card

๐Ÿš€ 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

PropertyDetails
Base ModelQwen2.5-Coder-7B-Instruct
Fine-tuning MethodLoRA (Low-Rank Adaptation) via Unsloth
Training FrameworkTRL SFTTrainer
QuantizationGGUF Q4KM (~4.4 GB)
Context Length2048 tokens
LanguageJavaScript / 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

bash
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

bash
ollama create nodejs-coder -f Modelfile

Step 3 โ€” Run

bash
ollama run nodejs-coder

๐Ÿ“‹ Modelfile

dockerfile
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

javascript
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

javascript
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

javascript
const fs = require('fs');

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

๐Ÿ‹๏ธ Training Details

ParameterValue
Base Modelunsloth/Qwen2.5-Coder-7B-Instruct-bnb-4bit
LoRA Rank16
LoRA Alpha32
Training DataNode.js backend code dataset
Training FrameworkUnsloth + TRL SFTTrainer
Training EnvironmentGoogle Colab (T4 GPU)
QuantizationQ4KM 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