Zero Labs
Industry News / AI

Prisma-Coder-3B from TIMPS AI

Source · Towards AI By Sandeep Thummala

From the publisher’s feed, collected in the ZeroLabs newsroom.

Introducing PrismaCoder-3B: Building a Specialized Coding Model on Free ComputeCan a small, domain-specialized language model outperform larger general-purpose coding models on a specific programming task? I built PrismaCoder-3B to explore that question.Most AI coding models are designed to help with a broad range of programming tasks. But what happens when we stop trying to solve every coding problem and focus on just one?That question led me to build PrismaCoder-3B, a 3-billion-parameter language model fine-tuned specifically for Prisma ORM schema generation and Prisma Client code.The project was an experiment in model specialization, reinforcement learning, benchmark design, and something equally important: understanding what our evaluation metrics actually prove.The entire training process ran on accessible Kaggle GPU infrastructure, without a dedicated enterprise GPU cluster.Here is how I built it, what the results showed, and what I learned along the way.Why Build a Specialized Coding Model?Prisma is an ORM widely used in TypeScript and JavaScript applications. Developers use it to define database schemas, model relationships, write queries, and interact with databases through Prisma Client.These tasks have structured rules. A model needs to understand model definitions, field types, relationships, CRUD operations, and how different parts of a schema fit together.General-purpose coding models can help with these tasks, but a specialized model offers an opportunity to concentrate training on one well-defined domain.That became the goal of PrismaCoder-3B:Generate and edit Prisma ORM schemas.Assist with Prisma Client queries and CRUD operations.Work with schema-aware code-generation tasks.Explore whether targeted fine-tuning can improve performance without increasing model size.Rather than training a new language model from scratch, I started with an existing open model and adapted it to the target domain.The Model Behind the ProjectPrismaCoder-3B is based on Qwen2.5-Coder-3B-Instruct.I used parameter-efficient fine-tuning techniques so that the training pipeline could run within limited GPU memory.The training process followed three main stages:1. Supervised Fine-Tuning (SFT)The first stage taught the model from curated examples of Prisma-related instructions and code. The dataset combined real code gathered from permissively licensed public repositories with synthetically generated tasks.2. Direct Preference Optimization (DPO)The second stage used preference optimization to encourage better responses based on comparisons between different candidate outputs.3. Group Relative Policy Optimization (GRPO)The third stage introduced online reinforcement learning. Candidate completions were scored using a programmatic verifier, providing a reward signal to guide training.The model used QLoRA, with 4-bit quantization during training and LoRA adapters applied across the model’s linear projections.This approach allowed me to experiment with a multi-stage training pipeline on a 3B-parameter model without requiring a large dedicated compute budget.Training on Kaggle: Working Within Real ConstraintsOne of the most interesting parts of this project was not the model architecture. It was the infrastructure.Training ran on a Kaggle NVIDIA T4 GPU with 16 GB of memory. Sessions had a 12-hour limit, which meant that a training stage could not always finish in one uninterrupted run.I had to work around GPU memory pressure, generation-heavy reinforcement-learning steps, and the need to preserve progress between sessions.The solution involved:QLoRA and memory-efficient training.Regular checkpointing and explicit resume support.Reducing the memory footprint of reinforcement-learning generation.Debugging GPU visibility and memory fragmentation issues.These engineering decisions made it possible to run a multi-stage experiment in an environment accessible to individual developers.The model was trained on approximately 3,000 records from a larger finalized dataset. That is significantly smaller than the project’s original training-data target, so I consider this a proof of concept rather than the final limit of the approach.Building PrismaBenchA specialized model needs more than a few impressive examples. It needs a way to evaluate performance systematically.For this project, I developed PrismaBench, a 1,200-task benchmark covering twelve task categories and three difficulty levels.The benchmark spans schema authoring, schema editing, database query generation, CRUD operations, complex reads, nested writes, migration planning, bug fixing, cross-file reasoning, performance-related tasks, and security-relevant scenarios.The objective was to create a repeatable evaluation process rather than judge the model by selected outputs.I also used provenance tracking and a contamination-exclusion process intended to keep benchmark tasks out of the training dataset.This gave me a foundation for comparing the specialized model with general-purpose coding models under matched evaluation conditions.What Did the Benchmark Show?The initial results were encouraging.On the full 1,200-task PrismaBench, the published checkpoint achieved a 0.9992 pass@1 score under the project’s static V0 evaluation gate.The model also achieved a CodeBLEU score of 0.9332. Its exact-match score was considerably lower because exact match rewards reproducing a reference output verbatim, whereas multiple different implementations may satisfy the same task.I also evaluated several open coding models on the same 200-task benchmark subset, using the same prompt construction and greedy decoding settings.ModelStatic-gate pass@1PrismaCoder-3B100.0%StarCoder2–3B89.5%DeepSeek-Coder-1.3B-Instruct85.5%CodeLlama-7B-Instruct74.0%Qwen2.5-Coder-3B-Instruct67.0%These results suggest that specializing a relatively small model can provide a meaningful advantage on a narrow task domain.However, there is an important distinction between passing a lightweight static checker and generating code that actually works.These numbers measure performance under the benchmark’s static evaluation gate. They are not verified rates of successful compilation, database migration, or execution.That distinction matters, and it led to one of the most important findings in the project.An Important Lesson: A High Score Does Not Guarantee Correct CodeDuring manual testing, I asked the model to generate a simple Prisma schema containing a User model, a Post model, and a relationship between them.The resulting code looked plausible but contained an incorrectly formed relation declaration and omitted the reciprocal relation field needed for a valid one-to-many relationship.Prisma’s own schema validator would reject this output.I investigated why the benchmark had not caught the problem. The static V0 checker performed limited structural and identifier-grounding checks, but it did not fully parse generated Prisma schema definitions or validate relation-clause correctness.Consequently, some invalid schema outputs could still pass the benchmark gate.This is a significant limitation, and I am documenting it alongside the benchmark results rather than treating the headline score as proof of functional correctness.The full validation chain — including Prisma schema validation, client generation, type-checking, and execution against a database — has not yet been completed for this model.For this reason, PrismaCoder-3B should be treated as an experimental research model, not a replacement for proper code validation.This experience reinforced an important engineering principle: an evaluation system can only measure what it actually checks.A model can score extremely well against an incomplete verifier and still fail when its output meets the real tools developers use.The next step is to strengthen the evaluation pipeline and report results under stricter validation criteria.How to Try PrismaCoder-3BI have released the model on Hugging Face under the Apache-2.0 license.You can explore the model card, inspect the available files, and use the model with compatible Transformers-based inference environments.Model: PrismaCoder-3B on Hugging FaceWhen testing the model, use its documented chat template and validate generated schemas before using them in a project. For example:npx prisma validate --schema=./generated_schema.prismaPassing schema validation is an important first step, but it is not a substitute for testing queries, type correctness, migrations, and runtime behavior in the intended application.I would particularly welcome testing that explores relation fields, nested queries, schema editing, and more complex database operations.Final ThoughtsBuilding PrismaCoder-3B taught me that training a model is only one part of building a useful AI system.The dataset matters. The training pipeline matters. The compute constraints matter.But the evaluator matters just as much.The benchmark results offer an encouraging signal that specialization is worth exploring. The schema-validation failure also shows why responsible reporting must include limitations, not just attractive numbers.I built this project to explore what an individual developer can achieve with open models and accessible compute. I am sharing both the promising results and the unfinished work so others can inspect, reproduce, challenge, and improve the approach.Explore the model: PrismaCoder-3BIf you experiment with the model, I would appreciate feedback, especially reproducible evaluations that identify where it succeeds and where it fails.The goal is not just to build a model that scores well. It is to build one whose capabilities we can actually trust.Prisma-Coder-3B from TIMPS AI was originally published in Towards AI on Medium, where people are continuing the conversation by highlighting and responding to this story.