Instructions to use brokkai/Muninn-small with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use brokkai/Muninn-small with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("brokkai/Muninn-small") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Notebooks
- Google Colab
- Kaggle
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