#Embeddings
Generate dense vector representations of text in cave-neural latent space. Useful for semantic search, clustering, RAG pipelines, and detecting goblin-aligned content.
POST https://api.gpt-gob.ai/v1/embeddings##Embedding models
| Model ID | Dimensions | Best for |
|---|---|---|
gob-embed-cave-small | 512 | High-volume RAG, low-latency search |
gob-embed-cave | 1536 | General purpose. Default. |
gob-embed-cave-large | 3072 | Maximum recall, semantic clustering |
gob-embed-shadow | 1536 | Specialized for subtext / implicit context detection |
The shadow variant uses the Shadow Attention layer to encode what's not said alongside what is. Use it for sarcasm detection, intent classification, or any task where the surface meaning isn't enough.
##Request
curl https://api.gpt-gob.ai/v1/embeddings \ -H "Authorization: Bearer $GOB_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "model": "gob-embed-cave", "input": "the quick brown goblin jumps over the lazy dragon" }'You can also pass an array of strings (up to 2048 inputs per request, 8192 tokens each):
{
"model": "gob-embed-cave",
"input": [
"first piece of text",
"second piece of text",
"third piece of text"
]
}##Response
{
"object": "list",
"model": "gob-embed-cave",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [0.0123, -0.0456, 0.0789, "..."]
}
],
"usage": {
"prompt_tokens": 11,
"total_tokens": 11
}
}##Dimensions parameter
For gob-embed-cave and gob-embed-cave-large, you can request a smaller-than-native vector via the dimensions parameter. The model truncates the output to the requested dimensions, with minimal accuracy loss thanks to Matryoshka representation learning.
{
"model": "gob-embed-cave-large",
"input": "...",
"dimensions": 256
}##Encoding format
By default embeddings come back as JSON arrays of floats. For wire efficiency, request base64:
{
"model": "gob-embed-cave",
"input": "...",
"encoding_format": "base64"
}##Cosine similarity
Standard cosine similarity works on GOB embeddings just like any other model. They're already L2-normalized, so dot product == cosine similarity.
import numpy as np
def similarity(a, b):
return float(np.dot(a, b))##Caveats
- โธCave-neural embeddings are not interchangeable with OpenAI's
text-embedding-3-*or any other model's vectors. You can't compare them across spaces. - โธThe
shadowvariant produces vectors that drift further from surface semantics. Don't mixcaveandshadowembeddings in the same index. - โธMaximum input is 8192 tokens per item. Longer inputs are silently truncated.