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]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
// useBaseUrl.ts
import { useState, useEffect } from "react";
export const useBaseUrl = () => {
const [baseUrl, setBaseUrl] = useState("http://localhost:4000");
useEffect(() => {
if (typeof window !== "undefined") {
const { protocol, host } = window.location;
setBaseUrl(`${protocol}//${host}`);
}
}, []); // Removed router dependency
return baseUrl;
};
export const defaultPageSize = 25;