Muninn-small

Muninn-small is a 48M-parameter multilingual retriever for natural-language-query → code-function retrieval, with an 8,192-token context and 384-dimensional embeddings.

It is the efficient Muninn tier, trained from ibm-granite/granite-embedding-small-english-r2 with a ModernBERT encoder.

Usage

from sentence_transformers import SentenceTransformer

model = SentenceTransformer("BrokkAI/Muninn-small")
model.max_seq_length = 8192

queries = ["Where is retry backoff calculated for failed HTTP requests?"]
documents = [
    "src/net/client.py/HttpClient/retry_delay\n"
    "class HttpClient:def retry_delay(self, attempt):\n"
    "    return min(60, 2 ** attempt)"
]

query_embeddings = model.encode(queries, prompt_name="query", normalize_embeddings=True)
document_embeddings = model.encode(
    documents, prompt_name="document", normalize_embeddings=True
)
scores = model.similarity(query_embeddings, document_embeddings)
print(scores)

The exact prompts used during training and evaluation are:

query:    Given a GitHub issue, retrieve code that must be changed to fix it.
          Query: 
document: Passage: Code chunk from repository.

The query prompt literally says “GitHub issue” because that is the trained prefix. Quarry queries are synthetic natural-language behavioral descriptions, not raw issue text. Keep the prefix unchanged at inference time even when the input is another kind of natural- language code-search query.

Document format

Quarry results use the header format produced by swerank_document_text() before the document prompt is applied. For a free function:

{path}/{function_name}
{source}

For a class method:

{path}/{ClassName}/{function_name}
class {ClassName}:{source}

The worked usage example above is therefore the exact representation of a method named HttpClient.retry_delay in src/net/client.py.

Quarry results

Quarry contains 6,525 synthetic behavioral queries over real repository revisions. The metric is strict all-gold micro recall@k: for each query, |gold ∩ top-k| / |gold|, followed by a flat mean over queries. Models use their native dimensions and the header document format above.

TODO: Competitive results are being rerun and will be added here when the complete comparison is finalized.

Languages

C, C++, C#, Go, Java, JavaScript, PHP, Python, Rust, Scala, and TypeScript.

License and attribution

Muninn-small is released under the Apache License 2.0. It is derived from ibm-granite/granite-embedding-small-english-r2, also released under Apache-2.0. See LICENSE for the full license text.

Downloads last month
12
Safetensors
Model size
47.7M params
Tensor type
BF16
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for brokkai/Muninn-small

Finetuned
(2)
this model