Skip to content

Latest commit

Β 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

EmbeddingGemma-300M

Replicate

Text embeddings using Google's GEMMA model. 768-dimensional vectors (Matryoshka: 128/256/512/768) optimized for search, classification, and retrieval.

Usage

import replicate, base64, numpy as np

# Returns a base64 string by default
b64 = replicate.run(
    "zsxkib/embedding-gemma-300m",
    input={"text": "Your text here"}
)

# Decode base64 -> float32 vector
embedding = np.frombuffer(base64.b64decode(b64), dtype=np.float32)
print(embedding.shape)  # (768,)

Parameters

  • text: Input text to embed
  • task: Task type (retrieval_query, retrieval_document, classification)
  • output_format: Return format (base64 or array)

Output

Returns a base64 string by default (efficient). Set output_format: "array" to get a list of floats.

Local Development

cog predict -i text="Hello world"

Model Details

  • Architecture: Google GEMMA embedding model (300M parameters)
  • Dimensions: 768
  • Max tokens: 2048 (auto-truncated)
  • Tasks: Retrieval queries/documents, classification

Built by @zsakib_ β€’ GitHub

About

πŸš€ Google's compact 300M parameter embedding model for production-ready semantic search and text similarity tasks 🎯

Resources

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages

Generated from zsxkib/cog-template