Integrations
Feather integrates seamlessly with popular embedding models, frameworks, and tools. This page covers all supported integrations.
Embedding Models
OpenAI
Use OpenAI's text-embedding models with Feather.
from openai import OpenAI
from feather import DB
import numpy as np
client = OpenAI()
db = DB.open("embeddings.feather", dim=1536)
# Generate embedding
response = client.embeddings.create(
model="text-embedding-3-small",
input="Your text here"
)
vector = np.array(response.data[0].embedding, dtype=np.float32)
# Store in Feather
db.add(1, vector)
db.save()Sentence Transformers
Popular library for sentence embeddings.
from sentence_transformers import SentenceTransformer
from feather import DB
import numpy as np
model = SentenceTransformer('all-MiniLM-L6-v2')
db = DB.open("embeddings.feather", dim=384)
text = "Your text here"
embedding = model.encode(text).astype(np.float32)
db.add(1, embedding)
db.save()Ollama
Local LLM embeddings with Ollama.
import ollama
from feather import DB
import numpy as np
db = DB.open("embeddings.feather", dim=1024)
response = ollama.embeddings(model="nomic-embed-text", prompt="Your text")
vector = np.array(response["embedding"], dtype=np.float32)
db.add(1, vector)
db.save()Frameworks
LangChain
Use Feather as a vector store in LangChain.
from langchain.vectorstores import FeatherVectorStore
from langchain.embeddings import OpenAIEmbeddings
embeddings = OpenAIEmbeddings()
vectorstore = FeatherVectorStore(
embedding=embeddings,
db_path="langchain.feather"
)
# Add documents
vectorstore.add_texts(["Document 1", "Document 2"])
# Search
results = vectorstore.similarity_search("query", k=5)LlamaIndex
Integrate Feather with LlamaIndex.
from llama_index.vector_stores import FeatherVectorStore
from llama_index import VectorStoreIndex
vector_store = FeatherVectorStore(db_path="llamaindex.feather")
index = VectorStoreIndex.from_vector_store(vector_store)
# Query
query_engine = index.as_query_engine()
response = query_engine.query("Your question")Deployment
WebAssembly (WASM)
Run Feather in the browser with WASM.
import init, { DB } from 'feather-wasm';
await init();
const db = new DB('vectors.feather', 384);
// Use in browser
const vector = new Float32Array(384);
db.add(1, vector);
const results = db.search(query, 5);Mobile (iOS/Android)
Feather works natively on mobile platforms.
// Swift (iOS)
import Feather
let db = try DB.open(path: "vectors.feather", dim: 384)
try db.add(id: 1, vector: vector)
try db.save()