Model-Agnostic Configuration
Model-Agnostic Configuration
Deeptrain is designed to be model-agnostic, providing a unified interface for over 200+ private and open-source Large Language Models (LLMs). This architecture allows you to decouple your data pipeline from specific model providers, enabling you to switch between models like GPT-4, Claude, Llama 3, or Mistral with minimal configuration changes.
Connecting Your Model
To integrate a specific model with Deeptrain, you must define the provider and the model identifier. Deeptrain handles the underlying protocol translations to ensure that multi-modal data (images, audio, video) is correctly formatted for the target model's specific requirements.
Configuration Object
When initializing the Deeptrain client or agent, use the following configuration structure:
| Parameter | Type | Description |
| :--- | :--- | :--- |
| model_provider | string | The LLM host (e.g., openai, anthropic, huggingface, ollama, vllm). |
| model_name | string | The specific model version (e.g., gpt-4o, claude-3-5-sonnet, llama3:70b). |
| api_key | string | Your authentication credential for the provider. |
| base_url | string | (Optional) The custom endpoint URL for self-hosted or proxy models. |
Implementation Example
The following example demonstrates how to configure Deeptrain to use different model providers while maintaining the same multi-modal processing logic.
from deeptrain import MultiModalConnector
# Example 1: Configuring for OpenAI (Private Model)
gpt_config = {
"model_provider": "openai",
"model_name": "gpt-4o",
"api_key": "sk-..."
}
# Example 2: Configuring for a Local Llama instance via Ollama (Open Source)
llama_config = {
"model_provider": "ollama",
"model_name": "llama3",
"base_url": "http://localhost:11434"
}
# Initialize the connector with your chosen configuration
connector = MultiModalConnector(config=llama_config)
# Deeptrain handles the modal-to-text or modal-to-embedding translation
# regardless of the underlying model's native vision/audio support.
response = connector.process_source(
video_url="https://youtube.com/watch?v=example",
query="Summarize the visual steps in this tutorial."
)
Supported Providers
Deeptrain leverages a flexible adapter system to support a wide array of ecosystems:
- Proprietary APIs: OpenAI, Anthropic, Google Gemini, Mistral AI, Cohere.
- Open Source & Self-Hosted: Integration with
vLLM,Ollama, andLocalAI. - Cloud Orchestrators: Amazon Bedrock, Azure OpenAI Service, and Hugging Face Inference Endpoints.
Environment Variables
For production environments, it is recommended to configure models using environment variables to keep credentials secure:
# Provider Settings
export DEEPTRAIN_MODEL_PROVIDER="anthropic"
export DEEPTRAIN_MODEL_NAME="claude-3-5-sonnet-20240620"
# Authentication
export ANTHROPIC_API_KEY="your_api_key_here"
# Optional: Custom Endpoints for Private Clouds
export DEEPTRAIN_BASE_URL="https://your-private-proxy.com/v1"
Custom Model Support
If you are using a proprietary fine-tuned model or a provider not listed in the standard documentation, you can utilize the CustomAdapter interface. This allows you to define how Deeptrain's multi-modal payloads should be structured to match your specific API schema.
Note: When using models that do not natively support vision or audio, Deeptrain automatically utilizes its internal Transcribe API and localized embedding database to convert visual and auditory data into a format the LLM can interpret.