Self-Hosting Guide
Overview
Self-hosting Deeptrain (VMTP) allows you to process sensitive multi-modal data within your own private infrastructure. This ensures that data sovereignty is maintained, as your files, transcriptions, and embeddings never leave your controlled environment.
Prerequisites
Before deploying Deeptrain, ensure your system meets the following requirements:
- Docker: Version 20.10.0 or higher.
- Docker Compose: Version 2.0.0 or higher.
- Hardware:
- Minimum 8GB RAM (16GB recommended for video processing).
- 4-core CPU.
- Optional: NVIDIA GPU with CUDA support for accelerated embedding generation.
Deployment via Docker Compose
The most efficient way to self-host Deeptrain is using Docker Compose. This orchestrates the API service and the localized embedding database.
1. Configuration
Create a .env file in your project root to configure the environment.
# General Configuration
PORT=8080
NODE_ENV=production
# Database & Storage
STORAGE_PATH=./data/uploads
VECTOR_DB_PATH=./data/vectors
# Model Settings
# Supported: openai, anthropic, or local (ollama/vllm)
DEFAULT_MODEL_PROVIDER=openai
OPENAI_API_KEY=your_key_here
# Transcription API Settings
WHISPER_MODEL_SIZE=base
2. Docker Compose File
Create a docker-compose.yml to define the services.
version: '3.8'
services:
deeptrain-api:
image: uditakhourii/vmtp:latest
ports:
- "${PORT}:8080"
volumes:
- ./data:/app/data
env_file:
- .env
restart: always
vector-store:
image: chromadb/chroma:latest
volumes:
- ./chroma_data:/chroma/chroma
ports:
- "8000:8000"
3. Launching the Service
Run the following command to start the services in detached mode:
docker-compose up -d
Configuring Your Client
Once self-hosted, you must point your client-side integration to your private endpoint instead of the public cloud API.
JavaScript/TypeScript Example
import { DeeptrainClient } from '@deeptrain/sdk';
const client = new DeeptrainClient({
baseUrl: 'http://your-private-ip:8080',
apiKey: process.env.DEEPTRAIN_PRIVATE_KEY
});
// Processing a local video file for transcription
const result = await client.transcribe.process('./sensitive_meeting.mp4');
console.log(result.transcription);
Internal Components
While most internal operations are abstracted, self-hosters should be aware of these two primary internal services:
- Transcription Engine (Internal): Handles the conversion of audio/video into text. In a self-hosted environment, this utilizes local compute resources.
- Vector Orchestrator (Internal): Manages the communication between the raw data and the localized embedding database. Ensure the
VECTOR_DB_PATHhas sufficient write permissions.
Resource Management
Video Processing
Video transcription is resource-intensive. If you experience timeouts during Transcribe API calls, increase the TIMEOUT_LIMIT in your .env file and ensure the container has access to at least 4GB of dedicated memory.
Storage
The STORAGE_PATH will store temporary files during processing and persistent embeddings. Monitor this directory to ensure your host machine does not run out of disk space when processing large datasets.
Verifying the Installation
To verify that your self-hosted instance is running correctly, perform a health check:
curl http://localhost:8080/health
Expected Response:
{
"status": "active",
"version": "1.x.x",
"services": {
"vector_store": "connected",
"transcriber": "ready"
}
}