🚀 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

Downloads last month
34
GGUF
Model size
8B params
Architecture
qwen2
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Sriram-214/nodejs-coder-qwen25