Metadata-Version: 2.4
Name: remote-embedding
Version: 0.1.0
Summary: A PyPI-ready FastAPI embedding service and LangChain-compatible remote client.
Author: Meshkat Shariat Bagheri
License-Expression: MIT
Project-URL: Homepage, https://github.com/MeshkatShB/remote-embedding
Project-URL: Issues, https://github.com/MeshkatShB/remote-embedding/issues
Keywords: embeddings,fastapi,langchain,huggingface,api
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Framework :: FastAPI
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: fastapi>=0.115
Requires-Dist: langchain-core>=0.3
Requires-Dist: langchain-huggingface>=0.1.2
Requires-Dist: pydantic>=2.7
Requires-Dist: python-dotenv>=1.0
Requires-Dist: requests>=2.32
Requires-Dist: uvicorn>=0.30
Dynamic: license-file

# remote-embedding

`remote-embedding` packages two things together:

- A FastAPI server that exposes a `/embed` API backed by local Hugging Face models.
- A LangChain-compatible `RemoteEmbeddings` client that calls that server remotely.

## Install

```bash
pip install remote-embedding
```

## Package Layout

The import package is `remote_embedding`.

```python
from remote_embedding import RemoteEmbeddings
```

## Run The Server

Set the environment variables your model needs.

PowerShell:

```powershell
$env:EMBEDDING_MODEL_NAME="BAAI/bge-base-en-v1.5"
$env:EMBEDDING_DIR="C:\\path\\to\\model-cache"
$env:DEVICE="cpu"
```

Bash:

```bash
export EMBEDDING_MODEL_NAME=BAAI/bge-base-en-v1.5
export EMBEDDING_DIR=/path/to/model-cache
export DEVICE=cpu
```

Start the API:

```bash
remote-embedding-server
```

Or:

```bash
python -m remote_embedding
```

Defaults:

- `HOST=0.0.0.0`
- `PORT=5055`

## Use The Client

```python
from remote_embedding import RemoteEmbeddings

embeddings = RemoteEmbeddings(
    base_url="http://127.0.0.1:5055",
    model_name="BAAI/bge-base-en-v1.5",
)

docs = embeddings.embed_documents(["hello world", "remote embeddings"])
query = embeddings.embed_query("search text")
```

## Build For PyPI

Build distributions locally:

```bash
python -m pip install --upgrade build
python -m build
```

This creates:

- `dist/*.tar.gz`
- `dist/*.whl`

Upload with Twine:

```bash
python -m pip install --upgrade twine
python -m twine upload dist/*
```
