Skip to content

The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]

746 B
Raw Blame
use std::{
    env,
    process::{Command, ExitCode},
};

use litellm_db_testing::{Error, MigratedPostgres};

#[tokio::main]
async fn main() -> Result<ExitCode, Error> {
    let postgres = MigratedPostgres::start().await?;
    let status = Command::new(env::var("CARGO").unwrap_or_else(|_| "cargo".to_owned()))
        .args(["sqlx", "prepare"])
        .args(env::args().skip(1))
        .args(["--", "--all-targets", "--all-features"])
        .current_dir(concat!(env!("CARGO_MANIFEST_DIR"), "/../db"))
        .env("DATABASE_URL", postgres.url())
        .env("SQLX_OFFLINE", "false")
        .status()
        .map_err(Error::Prepare)?;

    Ok(if status.success() {
        ExitCode::SUCCESS
    } else {
        ExitCode::FAILURE
    })
}