Overview
all-MiniLM-L12-v2 from sentence-transformers turns English text into 384-dimension vectors. On STS-B it scores Spearman 0.830. Cosine scale on that test set: pairs people rate near-identical average 0.84 (338 pairs), unrelated pairs 0.26 (308 pairs); in our sample the similar pair scores 0.84 and the unrelated pair -0.02. Probe pairs through this endpoint score paraphrase 0.84, same topic 0.40, different topic 0.06, opposite meaning 0.64. Embedding models place opposite-meaning sentences about the same subject close together, so cosine measures topical closeness, not polarity; use a classifier for sentiment.
Use it for semantic search, clustering, duplicate and paraphrase detection, and as the embedding step of a retrieval pipeline. The weights run on ml.t2.medium, the smallest SageMaker real-time instance type.
Model details
all-MiniLM-L12-v2 is a 12-layer English sentence-embedding model published by sentence-transformers on Hugging Face: 33.4M parameters (12 layers, 12 attention heads, hidden size 384, 30,522-token vocabulary), 133.5MB of weights, mean pooling, 128-token limit, licensed Apache-2.0.
Measured quality
On STS-B (1,379 test pairs), the cosine similarity of our embeddings correlates with human similarity judgments at Spearman 0.830. Simple word overlap on the same pairs scores 0.504. This measures sentence similarity, not question-to-document retrieval, so evaluate on your own data before relying on it.
Request and response
Request: {"inputs": ["A man is playing a guitar.", "Someone plays a guitar."], "normalize": true} Response: {"embeddings": [[...384 numbers...], [...]], "dimension": 384, "normalized": true} Up to 256 texts per request. normalize=true returns unit-length vectors, so cosine similarity is a plain dot product; by default vectors are returned as the model produces them.
Pricing
Software fee: $0.05 per instance-hour, billed by AWS Marketplace on top of the SageMaker instance. Real-time on ml.t2.medium: $0.05 + $0.056 = about $0.106 per hour (us-east-1). Batch transform on ml.m5.large: $0.05 + $0.115 = about $0.165 per hour, billed only while the job runs. Delete the endpoint when you finish to stop charges. Burstable t2 instances suit evaluation and light traffic; measure throughput before sustained heavy use.
Limits
English text. Only the first 128 tokens of each text are embedded (the model's own limit); longer text is truncated. Embeddings from different models are not comparable, so index and query with the same model.
Deploy in 5 steps
Prerequisites: an AWS account, a SageMaker execution role, and boto3 with SageMaker permissions. No GPU and no VPC setup are needed.
- Subscribe to this listing and copy the model package ARN from the subscription.
- Create a model from that ARN with network isolation on.
- Create an endpoint on ml.t2.medium.
- Send the sample request below.
- Delete the endpoint, endpoint config and model when you are done. Time to value (estimate): typically under 10 minutes from subscription to first response, most of it SageMaker creating the endpoint. Sample code (the same calls we used to verify this package on a real endpoint): import boto3, json sm = boto3.client("sagemaker"); rt = boto3.client("sagemaker-runtime") arn = ""; role = "" sm.create_model(ModelName="m", ExecutionRoleArn=role, PrimaryContainer={"ModelPackageName": arn}, EnableNetworkIsolation=True) sm.create_endpoint_config(EndpointConfigName="m", ProductionVariants=[{"VariantName": "v", "ModelName": "m", "InstanceType": "ml.t2.medium", "InitialInstanceCount": 1}]) sm.create_endpoint(EndpointName="m", EndpointConfigName="m") sm.get_waiter("endpoint_in_service").wait(EndpointName="m") r = rt.invoke_endpoint(EndpointName="m", ContentType="application/json", Body=json.dumps({'inputs': ['A man is playing a guitar.', 'Someone plays a guitar.'], 'normalize': True})) print(r["Body"].read().decode()) sm.delete_endpoint(EndpointName="m"); sm.delete_endpoint_config(EndpointConfigName="m"); sm.delete_model(ModelName="m")
Support
Email support@waltsoft.net . We reply within 1 business day (Monday to Friday). Covered: help deploying this model package on SageMaker, request and response format questions, and fixes for defects in the packaged container. Not covered: accuracy tuning on your own data, your application code, AWS account, IAM or quota issues, and custom model changes.
FAQ
Is my data sent anywhere? No. The model runs inside your SageMaker endpoint and the package is network-isolated. Which model is this? sentence-transformers/all-MiniLM-L12-v2, licensed Apache-2.0. How do I deploy it? Subscribe, then create a real-time endpoint or batch transform job from the model package.
Highlights
- 133.5MB, 33.4M-parameter English embedding model that runs on ml.t2.medium, the smallest SageMaker real-time instance type
- Measured Spearman 0.830 against human similarity judgments on 1,379 STS-B test pairs; simple word overlap scores 0.504
- Returns 384-dimension vectors for up to 256 texts per request, with optional unit-length normalization for cosine search
Details
Features and programs
Financing for AWS Marketplace purchases
Pricing
Dimension | Description | Cost/host/hour |
|---|---|---|
ml.t2.medium Inference (Real-Time) Recommended | Model inference on the ml.t2.medium instance type, real-time mode | $0.05 |
ml.m5.large Inference (Batch) Recommended | Model inference on the ml.m5.large instance type, batch mode | $0.05 |
Vendor refund policy
No refunds.
How can we make this page better?
Legal
Vendor terms and conditions
Content disclaimer
Delivery details
Amazon SageMaker model
An Amazon SageMaker model package is a pre-trained machine learning model ready to use without additional training. Use the model package to create a model on Amazon SageMaker for real-time inference or batch processing. Amazon SageMaker is a fully managed platform for building, training, and deploying machine learning models at scale.
Version release notes
Initial release
Additional details
Inputs
- Summary
English text embeddings from all-MiniLM-L12-v2: 384-dimension vectors, 33.4M parameters, 133.5MB, deployable on ml.t2.medium. Spearman 0.830 on STS-B (word overlap 0.504); probe cosines paraphrase 0.84, different topic 0.06. Apache-2.0, private.
- Input MIME type
- application/json
Support
Vendor support
Email support@waltsoft.net . Reply within 1 business day (Monday to Friday). Covers deployment help, request and response format questions and fixes for defects in the packaged container. Does not cover accuracy tuning on your data, your application code, AWS account, IAM or quota issues, or custom model changes.
AWS infrastructure support
AWS Support is a one-on-one, fast-response support channel that is staffed 24x7x365 with experienced and technical support engineers. The service helps customers of all sizes and technical abilities to successfully utilize the products and features provided by Amazon Web Services.