feat(packages): add relay-free-llm package
Add RelayFreeLLM, a RESTful API gateway that routes prompts to multiple AI providers (Gemini, Cerebras, Groq, Mistral, etc.) with failover and intent-based routing. Includes local cerebras-cloud-sdk build since it is not yet in nixpkgs.
This commit is contained in:
@@ -23,6 +23,7 @@ A custom Nix overlay and flake providing additional packages not found in upstre
|
||||
| `kubernetes-mcp-server` | Model Context Protocol (MCP) server for Kubernetes and OpenShift | MCP Servers |
|
||||
| `loop` | Corporate messenger for your team | Communication |
|
||||
| `radar` | Modern Kubernetes visibility — topology, event timeline, service traffic, resource browsing, Helm management, and GitOps support | Kubernetes |
|
||||
| `relay-free-llm` | RESTful API to route user prompts to various AI model providers with automatic failover and intent-based routing | AI LLM Gateway |
|
||||
| `stakpak` | DevOps AI agent that generates infrastructure code, debugs Kubernetes, configures CI/CD, and automates deployments | AI Agents |
|
||||
|
||||
## Usage
|
||||
@@ -121,6 +122,7 @@ nix-overlay/
|
||||
│ ├── loop/ # Corporate messenger for your team
|
||||
│ ├── mcp-gateway/ # MCP protocol gateway
|
||||
│ ├── radar/ # Kubernetes UI (topology, timeline, Helm, GitOps)
|
||||
│ ├── relay-free-llm/ # AI model provider routing gateway
|
||||
│ ├── skillsmcp/ # MCP server for Agent Skills
|
||||
│ └── stakpak/ # DevOps AI agent for infrastructure automation
|
||||
└── README.md
|
||||
|
||||
5
packages/relay-free-llm/default.nix
Normal file
5
packages/relay-free-llm/default.nix
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
pkgs.callPackage ./package.nix { }
|
||||
107
packages/relay-free-llm/package.nix
Normal file
107
packages/relay-free-llm/package.nix
Normal file
@@ -0,0 +1,107 @@
|
||||
{
|
||||
lib,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
fetchurl,
|
||||
makeWrapper,
|
||||
}:
|
||||
|
||||
let
|
||||
cerebras-cloud-sdk = python3Packages.buildPythonPackage rec {
|
||||
pname = "cerebras-cloud-sdk";
|
||||
version = "1.67.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://files.pythonhosted.org/packages/92/12/c201f07582068141e88f9a523ab02fdc97de58f2f7c0df775c6c52b9d8dd/cerebras_cloud_sdk-1.67.0.tar.gz";
|
||||
hash = "sha256-Ou1vhsbHqD7p1M+wiirOoInOvyr1uK7RFu95mVpPSBM=";
|
||||
};
|
||||
|
||||
build-system = with python3Packages; [
|
||||
hatchling
|
||||
hatch-fancy-pypi-readme
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
sed -i 's/hatchling==[0-9.]*/hatchling/' pyproject.toml
|
||||
'';
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
anyio
|
||||
distro
|
||||
httpx
|
||||
pydantic
|
||||
sniffio
|
||||
typing-extensions
|
||||
];
|
||||
|
||||
doCheck = false;
|
||||
|
||||
meta = {
|
||||
description = "Python SDK for Cerebras AI platform";
|
||||
homepage = "https://github.com/CerebrasAI/cerebras-cloud-sdk-python";
|
||||
license = lib.licenses.asl20;
|
||||
};
|
||||
};
|
||||
|
||||
pyDeps = with python3Packages; [
|
||||
fastapi
|
||||
uvicorn
|
||||
google-genai
|
||||
cerebras-cloud-sdk
|
||||
groq
|
||||
mistralai
|
||||
requests
|
||||
python-dotenv
|
||||
pydantic
|
||||
httpx
|
||||
];
|
||||
in
|
||||
python3Packages.buildPythonApplication {
|
||||
pname = "relay-free-llm";
|
||||
version = "0.1.0+unstable";
|
||||
format = "other";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "msmarkgu";
|
||||
repo = "RelayFreeLLM";
|
||||
rev = "fea9e1642dbbc5c0980885f41b21aa04a30090a2";
|
||||
hash = "sha256-ZLAVhJFrVFjqAz0f4qOi2REBDccIc8g2H9b7dcqcYRU=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
propagatedBuildInputs = pyDeps;
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
mkdir -p $out/lib/relay-free-llm
|
||||
cp -r src $out/lib/relay-free-llm/
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
makeWrapper ${python3Packages.python.interpreter} $out/bin/relay-free-llm \
|
||||
--add-flags "-m src.server" \
|
||||
--prefix PYTHONPATH : "$out/lib/relay-free-llm:$PYTHONPATH"
|
||||
'';
|
||||
|
||||
doCheck = false;
|
||||
|
||||
passthru = {
|
||||
category = "AI LLM Gateway";
|
||||
updateScript = [
|
||||
"nix-update"
|
||||
"--flake"
|
||||
".#relay-free-llm"
|
||||
"--version=branch=main"
|
||||
];
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "RESTful API to route user prompts to various AI model providers";
|
||||
homepage = "https://github.com/msmarkgu/RelayFreeLLM";
|
||||
license = lib.licenses.mit;
|
||||
mainProgram = "relay-free-llm";
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user