← Open Source
ankane

transformers-ruby

State-of-the-art transformers for Ruby.

AI EngineeringAccess modelsRuby
Open on GitHub
Momentum
+0stars in 24 hours0.0%
729
Stars
12
Forks
+0
This week
3
Contributors
Created 2024-08-19 · Updated 2026-09-05 · #14448 today
Top developers
ankanedefault-antonkaelonswanton

ankane/transformers-ruby is ranked 14,448 with 729 stars.

Same-category comparison

ankane/transformers-ruby is ranked 14,448 among these 8 peers; microsoft/teams-sdk is ranked 14,441.

Same-category comparison
NameRankMetrics
team-openpm/workgpt14,430
Language:
TypeScript
Stars:
731
Forks:
57
Description:
A GPT agent framework for invoking APIs.
Chen-zexi/open-ptc-agent14,434
Language:
Python
Stars:
730
Forks:
90
Description:
An open source implementation of code execution with MCP (Programatic Tool Calling).
YonkoSam/whatsapp-python-chatbot14,436
Language:
Python
Stars:
730
Forks:
218
Description:
WhatsApp Chatbot using Gemini + WasenderAPI.
microsoft/teams-sdk14,441
Language:
TypeScript
Stars:
730
Forks:
271
Description:
SDK focused on building AI based applications and extensions for Microsoft Teams and other Bot Framework channels.
ltjed/freephdlabor14,456
Language:
Python
Stars:
729
Forks:
80
Description:
freephdlabor: customizing personalized multiagent systems that researchs 24/7 on your own scientific problem.
dylanshine/openai-kit14,463
Language:
Swift
Stars:
728
Forks:
115
Description:
A community Swift package used to interact with the OpenAI API.
kdcokenny/opencode-worktree14,467
Language:
TypeScript
Stars:
728
Forks:
41
Description:
Zero-friction git worktrees for OpenCode. Auto-spawns terminals, syncs files, cleans up on exit.
liveloveapp/hashbrown14,469
Language:
TypeScript
Stars:
728
Forks:
64
Description:
Hashbrown is a framework for building agents that run the browser. Built for Angular and React.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguageRuby
CategoryAI Engineering
SubcategoryAccess models
KeywordsClient integration, Embeddings, LocalAI, Retrieval
Stars729
Forks12
Contributors3
Created date2024-08-19
Updated date2026-09-05
Stars in 1 day0
Stars in 7 days0
Rank14,448
Previous rank14,302
Rank change-146
7-day stars rank14,480
Previous 7-day stars rank14,497
7-day stars rank change17
Total stars rank14,387
Previous total stars rank14,355
Total stars rank change-32
CountryUSA
README summary

rb :slightly_smiling_face: State-of-the-art transformers for Ruby For fast inference, check out Informers :fire: Installation First, install Torch. Then add this line to your application’s Gemfile: Getting Started Models Pipelines Models Embedding sentence-transformers/all-MiniLM-L6-v2 sentence-transformers/multi-qa-MiniLM-L6-cos-v1 sentence-transformers/all-mpnet-base-v2 sentence-transformers/paraphrase-MiniLM-L6-v2 mixedbread-ai/mxbai-embed-large-v1 thenlper/gte-small intfloat/e5-base-v2 BAAI/bge-base-en

-v1. 5 Snowflake/snowflake-arctic-embed-m-v1. 5 Sparse embedding opensearch-project/opensearch-neural-sparse-encoding-v1 Reranking mixedbread-ai/mxbai-rerank-base-v1 BAAI/bge-reranker-base sentence-transformers/all-MiniLM-L6-v2 Docs sentence-transformers/multi-qa-MiniLM-L6-cos-v1 Docs sentence-transformers/all-mpnet-base-v2 Docs sentence-transformers/paraphrase-MiniLM-L6-v2 Docs mixedbread-ai/mxbai-embed-large-v1 Docs thenlper/gte-small Docs intfloat/e5-base-v2 Docs BAAI/bge-base-en-v1

. 5 Docs Snowflake/snowflake-arctic-embed-m-v1. 5 Docs opensearch-project/opensearch-neural-sparse-encoding-v1 Docs mixedbread-ai/mxbai-rerank-base-v1 Docs BAAI/bge-reranker-base Docs Pipelines Text Vision Text Embedding Reranking Named-entity recognition Sentiment analysis Question answering Feature extraction Vision Image classification Image feature extraction API This library follows the Transformers Python API. The following model architectures are currently supported: BERT DeBERTa-v2 DistilBERT MPNet ViT XLM-RoBERTa History View the changelog Contributing Everyone

is encouraged to help improve this project. Here are a few ways you can help: Report bugs Fix bugs and submit pull requests Write, clarify, or fix documentation Suggest or add new features To get started with development:

Frequently asked questions

How many stars and forks are recorded?

ankane/transformers-ruby has 729 stars and 12 forks.

What is the repository rank?

ankane/transformers-ruby is ranked 14,448.

What language and category are recorded?

ankane/transformers-ruby has 729 stars, uses Ruby and belongs to AI Engineering.

Which repository is closest in rank?

ankane/transformers-ruby is compared with microsoft/teams-sdk, ranked 14,441 with 730 stars.

README

Transformers.rb

:slightly_smiling_face: State-of-the-art transformers for Ruby

For fast inference, check out Informers :fire:

Installation

First, install Torch.rb.

Then add this line to your application’s Gemfile:

gem "transformers-rb"

Getting Started

Models

Embedding

Sparse embedding

Reranking

sentence-transformers/all-MiniLM-L6-v2

Docs

sentences = ["This is an example sentence", "Each sentence is converted"]

model = Transformers.pipeline("embedding", "sentence-transformers/all-MiniLM-L6-v2")
embeddings = model.(sentences)

sentence-transformers/multi-qa-MiniLM-L6-cos-v1

Docs

query = "How many people live in London?"
docs = ["Around 9 Million people live in London", "London is known for its financial district"]

model = Transformers.pipeline("embedding", "sentence-transformers/multi-qa-MiniLM-L6-cos-v1")
query_embedding = model.(query)
doc_embeddings = model.(docs)
scores = doc_embeddings.map { |e| e.zip(query_embedding).sum { |d, q| d * q } }
doc_score_pairs = docs.zip(scores).sort_by { |d, s| -s }

sentence-transformers/all-mpnet-base-v2

Docs

sentences = ["This is an example sentence", "Each sentence is converted"]

model = Transformers.pipeline("embedding", "sentence-transformers/all-mpnet-base-v2")
embeddings = model.(sentences)

sentence-transformers/paraphrase-MiniLM-L6-v2

Docs

sentences = ["This is an example sentence", "Each sentence is converted"]

model = Transformers.pipeline("embedding", "sentence-transformers/paraphrase-MiniLM-L6-v2")
embeddings = model.(sentences)

mixedbread-ai/mxbai-embed-large-v1

Docs

query_prefix = "Represent this sentence for searching relevant passages: "

input = [
  "The dog is barking",
  "The cat is purring",
  query_prefix + "puppy"
]

model = Transformers.pipeline("embedding", "mixedbread-ai/mxbai-embed-large-v1")
embeddings = model.(input)

thenlper/gte-small

Docs

sentences = ["That is a happy person", "That is a very happy person"]

model = Transformers.pipeline("embedding", "thenlper/gte-small")
embeddings = model.(sentences)

intfloat/e5-base-v2

Docs

doc_prefix = "passage: "
query_prefix = "query: "

input = [
  doc_prefix + "Ruby is a programming language created by Matz",
  query_prefix + "Ruby creator"
]

model = Transformers.pipeline("embedding", "intfloat/e5-base-v2")
embeddings = model.(input)

BAAI/bge-base-en-v1.5

Docs

query_prefix = "Represent this sentence for searching relevant passages: "

input = [
  "The dog is barking",
  "The cat is purring",
  query_prefix + "puppy"
]

model = Transformers.pipeline("embedding", "BAAI/bge-base-en-v1.5")
embeddings = model.(input)

Snowflake/snowflake-arctic-embed-m-v1.5

Docs

query_prefix = "Represent this sentence for searching relevant passages: "

input = [
  "The dog is barking",
  "The cat is purring",
  query_prefix + "puppy"
]

model = Transformers.pipeline("embedding", "Snowflake/snowflake-arctic-embed-m-v1.5")
embeddings = model.(input, pooling: "cls")

opensearch-project/opensearch-neural-sparse-encoding-v1

Docs

docs = ["The dog is barking", "The cat is purring", "The bear is growling"]

model_id = "opensearch-project/opensearch-neural-sparse-encoding-v1"
model = Transformers::AutoModelForMaskedLM.from_pretrained(model_id)
tokenizer = Transformers::AutoTokenizer.from_pretrained(model_id)
special_token_ids = tokenizer.special_tokens_map.map { |_, token| tokenizer.vocab[token] }

feature = tokenizer.(docs, padding: true, truncation: true, return_tensors: "pt", return_token_type_ids: false)
output = model.(**feature)[0]

values, _ = Torch.max(output * feature[:attention_mask].unsqueeze(-1), dim: 1)
values = Torch.log(1 + Torch.relu(values))
values[0.., special_token_ids] = 0
embeddings = values.to_a

mixedbread-ai/mxbai-rerank-base-v1

Docs

query = "How many people live in London?"
docs = ["Around 9 Million people live in London", "London is known for its financial district"]

model = Transformers.pipeline("reranking", "mixedbread-ai/mxbai-rerank-base-v1")
result = model.(query, docs)

BAAI/bge-reranker-base

Docs

query = "How many people live in London?"
docs = ["Around 9 Million people live in London", "London is known for its financial district"]

model = Transformers.pipeline("reranking", "BAAI/bge-reranker-base")
result = model.(query, docs)

Pipelines

Text

Embedding

embed = Transformers.pipeline("embedding")
embed.("We are very happy to show you the 🤗 Transformers library.")

Reranking

rerank = Informers.pipeline("reranking")
rerank.("Who created Ruby?", ["Matz created Ruby", "Another doc"])

Named-entity recognition

ner = Transformers.pipeline("ner")
ner.("Ruby is a programming language created by Matz")

Sentiment analysis

classifier = Transformers.pipeline("sentiment-analysis")
classifier.("We are very happy to show you the 🤗 Transformers library.")

Question answering

qa = Transformers.pipeline("question-answering")
qa.(question: "Who invented Ruby?", context: "Ruby is a programming language created by Matz")

Feature extraction

extractor = Transformers.pipeline("feature-extraction")
extractor.("We are very happy to show you the 🤗 Transformers library.")

Vision

Image classification

classifier = Transformers.pipeline("image-classification")
classifier.("image.jpg")

Image feature extraction

extractor = Transformers.pipeline("image-feature-extraction")
extractor.("image.jpg")

API

This library follows the Transformers Python API. The following model architectures are currently supported:

  • BERT
  • DeBERTa-v2
  • DistilBERT
  • MPNet
  • ViT
  • XLM-RoBERTa

History

View the changelog

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:

To get started with development:

git clone https://github.com/ankane/transformers-ruby.git
cd transformers-ruby
bundle install
bundle exec rake download:files
bundle exec rake test
Nearby in the ranking
Similar items