Align Models With Devin
Autonomous software engineer that works in its own cloud environment and opens pull requests for you. Made by Cognition.
Step 1: Get Your API Key
Sign up, then create an API key on the Nugen platform. You do not need a model yet: your agent builds an expert model with you in the steps below.
Get an API KeyStep 2: Add Your Key as a Secret
Cloud agents run on their own machines, so add NUGEN_API_KEY as a secret in Devin's secrets settings. Never paste the key into a prompt. Once Devin has deployed an aligned model, add its ID as NUGEN_MODEL_ID too.
Step 3: Add the Nugen MCP Server
In Devin, open Customize, then MCPs, click +, choose New MCP and enter these values for each server. Devin does not document environment variables for HTTP servers, so paste your key where shown. Save each server, then click Test tools to check the connection.
Devin MCP SettingsServer Name: mcp-execTransport: HTTPServer URL: https://mcp.nugen.in/mcpAuthentication: Authorization headerHeader Key: AuthorizationHeader Value: Bearer <paste your NUGEN_API_KEY here>Server Name: mcp-docsTransport: HTTPServer URL: https://docs.nugen.in/mcpAuthentication: AutomaticStep 4: Add Nugen to AGENTS.md
Devin reads AGENTS.md at the root of your repository. Download the Nugen instructions there and commit the file, so every session follows the Nugen workflow.
Terminalcurl -o AGENTS.md https://nugen.in/AGENTS.mdOn Windows PowerShell, use curl.exe instead of curl.
Step 5: Ask Your Agent to Align a Model
Paste this prompt to start. Your agent reads the Nugen skill, asks about your domain, then adds your knowledge, sets the benchmark and runs the alignment for you.
Prompt# Nugen SDKYou are helping me build on the Nugen API. Nugen Intelligence: build multi-model AI applications from expert models you own.Read these first:- https://nugen.in/AGENTS.md- https://nugen.in/skills/nugen/SKILL.mdGet an API key at https://nugen.in/signup and set `NUGEN_API_KEY`. Never hard-code it.Start by asking me what problem I want to solve. Then use the overview linked from SKILL.md to choose the path, and take me through it one step at a time, running each step with me.Inference capture is off by default. Ask me before you turn it on.
The API reference covers every endpoint and parameter.
Read the API Reference (opens in a new tab)Raise a Ticket (opens in a new tab)Prompts to Start With
Once your agent is set up, paste one of these.
Align a Model to Your Knowledge
Add the files in ./knowledge to Nugen as knowledge, generate a 50-prompt benchmark from them, and start an alignment project on a small open-weight base model. Poll the status and tell me when the expert model is ready.
Compare Against a General Model
Evaluate my expert model on our benchmark with its base model as the baseline, and summarise where the expert model is better and where it still falls short.
Run Retrieval on One Model ID
Use my expert model ID for embeddings, reranking and chat to respond to prompts over ./knowledge, so retrieval, ranking and generation share one understanding of the domain.
Keep the Model Improving
Turn on Nugen inference capture for my organisation, and add a script that re-runs the benchmark evaluation on my expert model and reports any change in score.