Rnj-1 is a family of 8B parameter open-weight, dense models trained from scratch by Essential AI, optimized for code and STEM with capabilities on par with SOTA open-weight models. These models perform well across a range of programming languages and boast strong agentic capabilities (e.g., inside agentic frameworks like mini-SWE-agent), while also excelling at tool-calling. They additionally exhibit strong capabilities in math and science. Herein, rnj-1 refers to the base model, while rnj-1-instruct refers to the post-trained instruction tuned model.
Capabilities
We evaluate Rnj-1 models against models of comparable size. In addition to accuracy, we also show the FLOPs used in pre-training for each model.
Benchmark Results
Base Model rnj-1
Base Evals
Instruct Model rnj-1-instruct
rnj-1-instruct is strong at code, math, and STEM tasks. It also performs well within agentic frameworks such as mini-swe-agent and has stellar tool use abilities.
Instrcut Evals
We report published numbers when possible, and when unavailable they are internal reproductions.
Pre-training FLOPs were estimated using 6nt, where n is the number of parameters and t is the token budget.
All Evals under the Env bucket were evaluated using mini-swe-agent (bash only) scaffolding.
GPT OSS 20B was evaluated with reasoning_effort=low.
Qwen 3 8B was evaluated with thinking turned off.
Rnj-1 models are designed to be extended
Both rnj-1 and rnj-1-instruct models are being made available for the community to extend and build upon. We deliberately kept post-training limited to allow for further specialization by the community. As an indicator of the untapped potential of the models we report pass@{1,2,4,8} (with T=0.2, n=8 generations) for hard codegen, agentic, and math benchmarks on rnj-1-instruct. These illustrate the model’s potential for test-time scaling and for further domain-specialization. The base model is similarly capable of specialization to other domains different from our post-training if needed.
Pass at k evals
Sidenote: Here is a screen recording of rnj-1-instruct helping us make an early version of this chart.
Highlights of abilities
Code generation: Both rnj-1-instruct and rnj-1 demonstrate strong code generation abilities as measured on tasks like HumanEval+, MBPP+, BigCodeBench, and LiveCodeBench v6. Both models compete with the strongest open weight models, sometimes outperforming even larger models such as GPT OSS 20B. We measured code comprehension abilities using the task of predicting inputs given outputs and vice-versa, Crux-IO. We find our models outperform comparable baselines. For multi-lingual code generation capabilities across programming languages we measure MultiPL-E on 6 languages (C++, TypeScript, Java, JavaScript, Shell, PHP) and we find performance close to the strongest model.
Agentic and Tool Use:rnj-1-instruct dominates the pack on agentic coding, one of our target abilities. SWE-bench performance is indicative of the model’s ability to tackle everyday software engineering tasks. The model is an order of magnitude stronger than comparably sized models on SWE-bench and approaches the capabilities available in much larger models. It scores 20.8% on SWE-bench Verified in bash-only mode, which is higher than Gemini 2.0 flash and Qwen2.5-Coder 32B Instruct under the same agentic framework (leaderboard).
There is a surge of interest in developing models’ abilities to write performant code. rnj-1-instruct is able to use a profiler to iteratively improve the performance of the code it writes. For instance, on Enamel, which measures abilities to write efficient solutions to algorithmic problems, the model outperforms all other models under the same setting.
Furthermore, rnj-1-instruct surpasses comparable models in tool use performance as measured by the Berkeley Functional Calling Leaderboard (BFCL).
Code Infilling : Having specifically been trained on FIM-ed pre-training data, rnj-1 exhibits strong infilling abilities, which have been further enhanced during post-training. The base model rnj-1 scores highly on HE-FIM-Python (avg) at 82.49% and rnj-1-instruct achieves 86.21%.
Mathematical Problem Solving:rnj-1-instruct shows strong mathematical abilities across several levels of difficulty from elementary math (GSM8k), high school and undergraduate math (Minerva-MATH), and competition math (AIME ‘24 and ‘25). On harder subjects, it outcompetes or is on par with the strongest model in the pack.
Scientific Reasoning:rnj-1-instruct exhibits long-context reasoning abilities that are needed to solve hard science and technical questions in GPQA-Diamond and SuperGPQA.
Demos: Rnj-1 models generalize to unseen tasks
We show a few examples of end-to-end capabilities that are usually expected of larger models.
Coding assistant:rnj-1-instruct can operate in agentic mode to create a playable game in a single shot inside of Cline: screen recording.
Agentic use:rnj-1-instruct functions seamlessy within the agentic framework of mini-swe-agent. Given a task such as fixing an issue described in a pull request (PR), fixing a security vulnerability, or writing performant code, it is able to reason across its full context across multiple turns to solve the task. These lead to “trajectories” which are pairs of “Assistant” and “User” turns. Here are a few recordings that show the model’s reasoning abilities across these turns: 1) a SWE task of identifying coding convention violation: screen recording, 2) fixing a security vulnerability: screen recording, 3) diagnosing code performance bottlenecks by running a profiler in the environment and iteratively improving the code: screen recording.
Data analysis in an interactive chat:rnj-1-instruct can work in interactive chat mode to solve a data analysis and visualization task: screen recording.
Architecture
Rnj-1's architecture is similar to Gemma 3, except that it uses only global attention, and YaRN for long-context extension.
Hyperparameter
Value
Total Parameters
8.3B
Number of Layers
32
Model Dimension
4096
MLP Dimension
16384
Number of Attention Heads
32
Number of Key-Value Heads
8
Attention Head Dimension
128
Vocabulary Size
128K
Pretrain Context Length
8K
Context Length
32K
Activation Function
GeGLU
Tied Embeddings?
Yes
Training Dynamics
rnj-1 was pre-trained on 8.4T tokens with an 8K context length, after which the model’s context window was extended to 32K through an additional 380B-token mid-training stage. A final 150B-token SFT stage completed the training to produce rnj-1-instruct.
We used the Muon optimizer throughout all phases. Pre-training followed the WSD learning-rate schedule, consisting of:
Warmup: Linear ramp-up from 0 to 2e-3 over the first 5K steps.
Stable phase: Constant learning rate of 2e-3 from 5K → 230K steps.
Decay: Cosine decay from 2e-3 → 2e-5 from 230K → 380K steps.
Final stable phase: Constant 2e-5 learning rate from 380K → 443.5K steps, concluding pre-training.
Both the mid-training (context-extension phase) and SFT were trained at a fixed learning rate of 2e-5.
The global batch sizes used were:
18M tokens for pre-training.
24M tokens for mid-training.
16M tokens for SFT.
Recommendations
Temperature
We recommend using temperatures in the range [0, 0.6] for rnj-1-instruct.
Propensity to write code
Rnj-1 models have a strong inclination to write code, even for non-code tasks. This is especially true for rnj-1-instruct if the system prompt is omitted. Provide an appropriate system prompt, e.g., “You are a helpful assistant”, along with global task needs to steer the model’s responses in the desired direction.
How to use
Serverless API and online playgrounds
Together.AI: Rnj-1 Instruct is available via API on the Together.ai model platform for serverless inference. It’s also available in the Together.ai playground for quick and easy experimentation.
The easiest way to run Rnj-1 on a laptop is via llama.cpp. A pre-quantized checkpoint is available here as well as instructions to get started.
Use with transformers
Rnj-1 is supported starting from transformers 4.51.2
Example code for querying model without tools
python
1import torch
2from transformers import AutoTokenizer, AutoModelForCausalLM
3import os
45model_id ="EssentialAI/rnj-1-instruct"6os.environ["HF_TOKEN"]=<YOUR-HF-TOKEN>78print(f"Loading model: {model_id}...")9model = AutoModelForCausalLM.from_pretrained(10 model_id,11 dtype=torch.bfloat16,12 device_map="auto",13)14tokenizer = AutoTokenizer.from_pretrained(model_id)1516print("Model and tokenizer loaded successfully.")1718messages =[19{"role":"system","content":"You are a helpful AI assistant."},# Optional system message20{"role":"user","content":"Who are you?"}21]2223input_ids = tokenizer.apply_chat_template(24 messages,25 add_generation_prompt=True,26 return_tensors="pt"27).to(model.device)2829# --- Generate Prediction --- #30print("Generating prediction...")31output_ids = model.generate(32 input_ids,33 max_new_tokens=50,34 pad_token_id=tokenizer.eos_token_id,35 do_sample=True,36 temperature=0.2,37 top_p=0.9538)3940response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=True)41print(response)
Example code for querying with tools
Rnj-1 supports tool-calling which can be parsed by hermes tool-call parser. The tool calls are formatted inside <tool_call> and </tool_call> tags.
An example usage is as follows:
python
1tools =[2{3"type":"function",4"function":{5"name":"get_weather",6"description":"Get the current weather in a given location",7"parameters":{8"type":"object",9"properties":{10"location":{"type":"string","description":"City and state, e.g., 'San Francisco, CA'"},11"unit":{"type":"string","enum":["celsius","fahrenheit"]}12},13"required":["location","unit"],14},15},16},17]1819messages =[20{"role":"system","content":"You are a helpful AI assistant."},# Optional system message21{"role":"user","content":"What is the weather in San Francisco, CA in Celsius?"}22]2324input_ids = tokenizer.apply_chat_template(25 messages,26 tools=tools,27 add_generation_prompt=True,28 return_tensors="pt"29).to(model.device)3031# --- Generate Prediction --- #32print("Generating prediction...")33output_ids = model.generate(34 input_ids,35 max_new_tokens=200,36 pad_token_id=tokenizer.eos_token_id,37 do_sample=True,38 temperature=0.2,39 top_p=0.9540)4142response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=False)43# NOTE: skip_special_tokens is set to False. 44print(response)
Example code for fill-in-the-middle (FIM)
Rnj-1 supports FIM, we show an example payload to trigger FIM mode for Rnj-1 below:
python
1PRE ="<|pre_fim|>"2MID ="<|mid_fim|>"3SUF ="<|suf_fim|>"45prefix ="""def binary_search(arr, target):
6 lo = 0
7 hi = len(arr) - 1
89 while lo <= hi:
10"""1112suffix ="""
13 return -1
14"""1516input= PRE + prefix + SUF + suffix + MID
1718messages =[19{"role":"system","content":"You are a helpful AI assistant."},20{"role":"user","content":input}21]2223input_ids = tokenizer.apply_chat_template(24 messages,25 tools=tools,26 add_generation_prompt=True,27 return_tensors="pt"28).to(model.device)2930# --- Generate Prediction --- #31print("Generating prediction...")32output_ids = model.generate(33 input_ids,34 max_new_tokens=100,35 pad_token_id=tokenizer.eos_token_id,36 do_sample=True,37 temperature=0.2,38 top_p=0.9539)4041response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=False)42print(response)
Serving Rnj-1 on GPUs
vLLM
On machines that run vLLM, it’s as easy as:
vllm serve EssentialAI/rnj-1-instruct
To launch a vLLM server with tool-calling support enabled:
Clone the EssentialAI fork of mini-swe-agent (github). Inside the repo, run the following inside a virtualenv:
python
1git checkout eai
2pip install -e .3export TOGETHER_API_KEY="..."# set this to your Together.AI access key45# use EssentialAI/rnj-1-instruct to solve a performance optimization task6mini-extra perf-single [--instance <k>]7# use EssentialAI/rnj-1-instruct to resolve a SWE PR description8mini-extra swebench-single [--instance <k>]
Known limitations
Hallucinations and factual inaccuracies
Rnj-1 is primarily a coding and STEM model. Hence, it is not optimized for factual recovery.
Identity and knowledge cutoff
Rnj-1 is trained on online web data, and we have observed that it sometimes confuses its identity with other model providers. We believe this is due to a variety of reasons, including references to language models from other providers, model generated data, etc. We hope to rectify this in our follow-up release.
Additionally, Rnj-1 has not been trained or provided with a knowledge cutoff date and may therefore respond with information coming from its training data. If specifically asked for its knowledge cutoff date, the model may hallucinate a date.