The AI Router offers three distinct operating modes to accommodate various privacy requirements and integration scenarios. The Model Routing mode provides the most streamlined experience, directly handling model calls and returning responses. For organizations with private models or specific security needs, Model Selection mode returns only the best model which can then be called manually. The Full Privacy mode offers maximum data protection by accepting pre-computed embeddings for the model selection.
Model Selection mode enables you to leverage AI Router's smart model selection while maintaining complete control over model execution. This mode is particularly valuable for organizations that:
Instead of routing your requests through the AI Router, you receive the model recommendation and handle the execution within your environment. This provides the flexibility to integrate with private deployments while benefiting from AI Router's model selection capabilities.
from airouter import AiRouter
client = AiRouter(
api_key="<THE-API-KEY-YOU-GENERATED>"
)
model_name = client.get_best_model(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the meaning of life?"}
]
)
Full Privacy mode represents the highest level of data protection, ensuring your input content never leaves your environment. In this mode:
from airouter import AiRouter
client = AiRouter(
api_key="<THE-API-KEY-YOU-GENERATED>"
)
model_name = client.get_best_model(
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is the meaning of life?"}
],
full_privacy=True
)
By default, the AI Router SDK uses FastEmbed with the paraphrase-multilingual-mpnet-base-v2
model to generate embeddings. If you already have existing text-embedding-3-small
embeddings or prefer these, you can use them by handing them in and setting the embedding type:
from airouter import AiRouter, EmbeddingType
client = AiRouter(
api_key="<THE-API-KEY-YOU-GENERATED>"
)
model_name = client.get_best_model(
full_privacy=True,
embedding=<YOUR-EMBEDDING>,
embedding_type=EmbeddingType.TEXT_EMBEDDING_3_SMALL
)
If you already have different embeddings you'd like to use, we'll integrate them for you - please contact us at support@airouter.io to discuss compatibility options.
This approach is ideal for organizations handling sensitive data or those subject to strict privacy regulations, as it maintains complete control over raw input data.