How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="Convence/Aroow-Rust-Coder-9B")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    },
]
pipe(text=messages)
# Load model directly
from transformers import AutoProcessor, AutoModelForImageTextToText

processor = AutoProcessor.from_pretrained("Convence/Aroow-Rust-Coder-9B")
model = AutoModelForImageTextToText.from_pretrained("Convence/Aroow-Rust-Coder-9B")
messages = [
    {
        "role": "user",
        "content": [
            {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"},
            {"type": "text", "text": "What animal is on the candy?"}
        ]
    },
]
inputs = processor.apply_chat_template(
	messages,
	add_generation_prompt=True,
	tokenize=True,
	return_dict=True,
	return_tensors="pt",
).to(model.device)

outputs = model.generate(**inputs, max_new_tokens=40)
print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:]))
Quick Links
Aroow-Rust-Coder-9B banner

Model Repository | Base Model | Rust
License: Apache 2.0 | Author: Convence

Aroow-Rust-Coder-9B

Aroow-Rust-Coder-9B is a Rust-focused coding model by Convence, finetuned off Qwen/Qwen3.5-9B. It is designed for Rust code generation, code completion, source understanding, fill-in-the-middle editing, unit-test drafting, and practical programming assistance.

The model is intended for developers who want a Rust-specialized assistant that can work with function signatures, module snippets, tests, compiler errors, and implementation requirements. It should be used as part of a normal Rust development workflow with compiler checks, tests, formatting, and review.

Model Summary

Property Value
Model Name Aroow-Rust-Coder-9B
Base Model Qwen/Qwen3.5-9B
Primary Task Rust code generation and completion
Output Focus Rust source code, tests, explanations, refactors
License Apache 2.0

Intended Use

Aroow-Rust-Coder-9B is intended for Rust programming assistance in editor, notebook, local inference, and agent-style coding workflows.

Suitable use cases include:

  • generating Rust functions from requirements
  • completing partial Rust files
  • writing unit tests
  • explaining Rust code
  • rewriting snippets into more idiomatic Rust
  • assisting with ownership, borrowing, and trait-related issues
  • creating examples for APIs, structs, enums, traits, and modules
  • filling missing code between existing prefix and suffix context

The model is most useful when prompts include concrete constraints, function signatures, examples, or expected behavior.

Core Capabilities

  • Rust Code Generation - Produces functions, structs, enums, traits, impl blocks, modules, and tests.
  • Code Completion - Continues partial Rust code with awareness of surrounding context.
  • Fill-in-the-Middle Editing - Completes missing code between prefix and suffix blocks.
  • Unit-Test Drafting - Generates #[test] functions and #[cfg(test)] modules.
  • Code Explanation - Explains Rust snippets, control flow, type behavior, and common compiler issues.
  • Refactoring Assistance - Suggests cleaner structure, safer patterns, and more idiomatic Rust.
  • Error-Handling Patterns - Supports Result, Option, ?, pattern matching, and recoverable error flow.
  • Standard Library Usage - Works with common collections, iterators, slices, strings, traits, and modules.

Getting Started

Install the required packages:

pip install -U transformers peft torch accelerate

Load the base model and adapter:

import torch
from peft import PeftModel
from transformers import AutoModelForImageTextToText, AutoProcessor

BASE_MODEL = "Qwen/Qwen3.5-9B"
ADAPTER_ID = "Convence/Aroow-Rust-Coder-9B"

processor = AutoProcessor.from_pretrained(BASE_MODEL, trust_remote_code=True)
tokenizer = processor.tokenizer

model = AutoModelForImageTextToText.from_pretrained(
    BASE_MODEL,
    torch_dtype=torch.bfloat16,
    device_map="auto",
    trust_remote_code=True,
)

model = PeftModel.from_pretrained(model, ADAPTER_ID)
model.eval()

Generate a Rust answer:

messages = [
    {
        "role": "system",
        "content": [
            {
                "type": "text",
                "text": "You are Aroow-Rust-Coder-9B, a Rust-focused coding assistant made by Convence. Write clear, safe, idiomatic Rust.",
            }
        ],
    },
    {
        "role": "user",
        "content": [
            {
                "type": "text",
                "text": "Write a Rust function that returns the first duplicate integer in a slice, or None if there is no duplicate. Include unit tests.",
            }
        ],
    },
]

prompt = processor.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True,
)

inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
input_len = inputs["input_ids"].shape[-1]

outputs = model.generate(
    **inputs,
    max_new_tokens=512,
    do_sample=True,
    temperature=0.2,
    top_p=0.95,
)

response = tokenizer.decode(outputs[0][input_len:], skip_special_tokens=True)
print(response)

Prompt Examples

Function Implementation

Write a Rust function:

fn normalize_counts(values: &[u32]) -> Vec<f64>

Requirements:
* return an empty vector for empty input
* divide each value by the total sum
* avoid division by zero
* include unit tests

Compiler Error Help

This Rust code does not compile. Explain the issue and rewrite it idiomatically:

```rust
fn main() {
    let values = vec![String::from("alpha"), String::from("beta")];
    let first = values[0];
    println!("{:?}", values);
    println!("{}", first);
}
```

Fill-in-the-Middle Completion

Fill in the missing Rust code between this prefix and suffix. Return only the missing code.

Prefix:
```rust
impl Cache {
    pub fn get_or_insert_with<F>(&mut self, key: String, f: F) -> &Value
    where
        F: FnOnce() -> Value,
    {
```

Suffix:
```rust
    }
}
```

Recommended Usage

For best results:

  • provide exact function signatures when possible
  • include edge cases and expected behavior
  • state whether external crates are allowed
  • ask for tests when correctness matters
  • run generated code through cargo check
  • run tests with cargo test
  • format generated code with cargo fmt
  • inspect suggestions before applying them to production code

For deterministic code generation, use a low temperature such as 0.1 to 0.3. For brainstorming alternative designs, use a higher temperature with careful review.

Validation Workflow

Generated code should be treated as a draft. A recommended Rust validation workflow is:

cargo fmt
cargo check
cargo test
cargo clippy

For security-sensitive code, add manual review, dependency review, fuzzing, property tests, and threat modeling where appropriate.

Limitations

Aroow-Rust-Coder-9B may:

  • produce code that does not compile
  • comit imports, feature flags, or crate dependencies
  • misunderstand complex lifetimes or trait bounds
  • generate tests that do not cover important edge cases
  • hallucinate APIs or crate behavior
  • produce code that appears correct but fails under real inputs
  • give incomplete explanations of compiler errors

The model should not be used as the sole authority for security-critical, safety-critical, medical, legal, financial, cryptographic, or infrastructure-critical code.

Safety

Developers should avoid sending secrets, credentials, private keys, unreleased proprietary source code, personal data, or regulated information to public inference endpoints.

Generated code should be reviewed before use. Pay special attention to:

  • unsafe blocks
  • FFI
  • raw pointers
  • authentication logic
  • cryptography
  • file-system access
  • network-facing code
  • dependency and supply-chain risk

Citation

@misc{convence2026aroowrustcoder9b,
  title={Aroow-Rust-Coder-9B},
  author={Convence},
  year={2026},
  url={https://huggingface.co/Convence/Aroow-Rust-Coder-9B}
}
Downloads last month
35
Safetensors
Model size
9B params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for Convence/Aroow-Rust-Coder-9B

Finetuned
Qwen/Qwen3.5-9B
Finetuned
(325)
this model

Collection including Convence/Aroow-Rust-Coder-9B