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.
- HuggingFace: Rnj-1 Instruct is also hosted via Hugging Face Spaces.
Running Rnj-1 locally
Running Rnj-1 on your laptop with llama.cpp
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.
Rnj-1 is supported starting from transformers 4.51.2
-
Example code for querying model without tools
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
import os
model_id = "EssentialAI/rnj-1-instruct"
os.environ["HF_TOKEN"] = <YOUR-HF-TOKEN>
print(f"Loading model: {model_id}...")
model = AutoModelForCausalLM.from_pretrained(
model_id,
dtype=torch.bfloat16,
device_map="auto",
)
tokenizer = AutoTokenizer.from_pretrained(model_id)
print("Model and tokenizer loaded successfully.")
messages = [
{"role": "system", "content": "You are a helpful AI assistant."},
{"role": "user", "content": "Who are you?"}
]
input_ids = tokenizer.apply_chat_template(
messages,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
print("Generating prediction...")
output_ids = model.generate(
input_ids,
max_new_tokens=50,
pad_token_id=tokenizer.eos_token_id,
do_sample=True,
temperature=0.2,
top_p=0.95
)
response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=True)
print(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:
tools = [
{
"type": "function",
"function": {
"name": "get_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {"type": "string", "description": "City and state, e.g., 'San Francisco, CA'"},
"unit": {"type": "string", "enum": ["celsius", "fahrenheit"]}
},
"required": ["location", "unit"],
},
},
},
]
messages = [
{"role": "system", "content": "You are a helpful AI assistant."},
{"role": "user", "content": "What is the weather in San Francisco, CA in Celsius?"}
]
input_ids = tokenizer.apply_chat_template(
messages,
tools=tools,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
print("Generating prediction...")
output_ids = model.generate(
input_ids,
max_new_tokens=200,
pad_token_id=tokenizer.eos_token_id,
do_sample=True,
temperature=0.2,
top_p=0.95
)
response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=False)
print(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:
PRE = "<|pre_fim|>"
MID = "<|mid_fim|>"
SUF = "<|suf_fim|>"
prefix = """def binary_search(arr, target):
lo = 0
hi = len(arr) - 1
while lo <= hi:
"""
suffix = """
return -1
"""
input = PRE + prefix + SUF + suffix + MID
messages = [
{"role": "system", "content": "You are a helpful AI assistant."},
{"role": "user", "content": input}
]
input_ids = tokenizer.apply_chat_template(
messages,
tools=tools,
add_generation_prompt=True,
return_tensors="pt"
).to(model.device)
print("Generating prediction...")
output_ids = model.generate(
input_ids,
max_new_tokens=100,
pad_token_id=tokenizer.eos_token_id,
do_sample=True,
temperature=0.2,
top_p=0.95
)
response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=False)
print(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:
vllm serve EssentialAI/rnj-1-instruct --enable-auto-tool-choice --tool-call-parser hermes
SGLang
On machines that run SGLang, it’s as easy as:
python3 -m sglang.launch_server --model EssentialAI/rnj-1-instruct
IDEs and Agents: Claude Code, Cline, Mini-SWE-Agent
Use with Cline
Rnj-1 works great with Cline, an open source AI coding agent, and is very easy to set up.
The Cline extension is available for VS Code / Cursor, JetBrains IDEs (IntelliJ, PyCharm, WebStorm, etc.) and VSCodium / Windsurf.
Simply add the Cline extension to your favorite IDE (see instructions here) and then enter the details for your Rnj-1 endpoint (instructions here).
Use with Claude Code
To use Rnj-1 with Claude Code, you can use https://github.com/musistudio/claude-code-router. Follow the instructions to set up Claude Code and Claude Code Router at https://github.com/musistudio/claude-code-router/blob/main/README.md.
Agentic mode with Mini-SWE-Agent
Clone the EssentialAI fork of mini-swe-agent (github). Inside the repo, run the following inside a virtualenv:
git checkout eai
pip install -e .
export TOGETHER_API_KEY="..."
mini-extra perf-single [--instance <k>]
mini-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.
License
This repository and the model weights are licensed under the Apache License, Version 2.0 (Apache 2.0).
We welcome your questions and feedback. You can contact us at info@essential.ai.
Citation
@misc{rnj1_instruct,
title = {{Rnj-1-Instruct}},
author = {Ashish Vaswani and Mike Callahan and Adarsh Chaluvaraju and Aleksa Gordić and Devaansh Gupta and Yash Jain and Divya Mansingka and Philip Monk and Khoi Nguyen and Mohit Parmar and Michael Pust and Tim Romanski and Peter Rushton and Ali Shehper and Divya Shivaprasad and Somanshu Singla and Kurt Smith and Saurabh Srivastava and Anil Thomas and Alok Tripathy and Yash Vanjani and Ameya Velingker and {{Essential AI}}},
year = {2025},
url = {https://huggingface.co/EssentialAI/rnj-1-instruct},
note = {Instruction-tuned model release}
}