Text Embeddings Inference
Supported Models
Key Features
Apolo deployment
Field
Description
Web Console UI



Usage
References
Last updated
Was this helpful?



Last updated
Was this helpful?
Was this helpful?
import requests
import json
# URL of your TEI server (adjust if running locally or behind a proxy)
TEI_ENDPOINT = "https://<YOUR_OUTPUTS_ENDPOINT>"
# Example texts to embed
texts = [
"The quick brown fox jumps over the lazy dog.",
"Artificial intelligence is transforming the world."
]
# Request payload
payload = {
"inputs": texts,
"normalize": True # Optional: normalize vectors to unit length
}
if __name__ == '__main__':
# Make the request
response = requests.post(
TEI_ENDPOINT,
headers={"Content-Type": "application/json"},
data=json.dumps(payload)
)
# Check for errors
if response.status_code != 200:
print(f"Error {response.status_code}: {response.text}")
exit(1)
# Parse and print the embeddings
embeddings = response.json()
for i, embedding in enumerate(embeddings):
print(f"Text: {texts[i]}")
print(f"Embedding: {embedding}")
print()