Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: deprecate llm cache #2515

Merged
merged 2 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/dashboard/app/(app)/desktop-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ type Props = {
id: string;
name: string;
}[];
llmGateways: {
id: string;
}[];
};
className?: string;
};
Expand Down
3 changes: 3 additions & 0 deletions apps/dashboard/app/(app)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export default async function Layout({ children, breadcrumb }: LayoutProps) {
apis: {
where: (table, { isNull }) => isNull(table.deletedAt),
},
llmGateways: {
columns: { id: true },
},
},
});
if (!workspace) {
Expand Down
1 change: 1 addition & 0 deletions apps/dashboard/app/(app)/mobile-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Props = {
id: string;
name: string;
}[];
llmGateways: { id: string }[];
chronark marked this conversation as resolved.
Show resolved Hide resolved
};
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const DeleteGateway: React.FC<Props> = ({ gateway }) => {

await revalidate();

router.push("/semantic-cache");
router.push("/");
chronark marked this conversation as resolved.
Show resolved Hide resolved
},
onError(err) {
console.error(err);
Expand Down
121 changes: 0 additions & 121 deletions apps/dashboard/app/(app)/semantic-cache/form.tsx

This file was deleted.

30 changes: 0 additions & 30 deletions apps/dashboard/app/(app)/semantic-cache/new/page.tsx

This file was deleted.

This file was deleted.

2 changes: 1 addition & 1 deletion apps/dashboard/app/(app)/semantic-cache/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async function SemanticCachePage() {
}

if (!workspace.llmGateways.length) {
return redirect("/semantic-cache/new");
return redirect("/");
chronark marked this conversation as resolved.
Show resolved Hide resolved
}

return redirect(`/semantic-cache/${workspace.llmGateways[0].id}/logs`);
Expand Down
4 changes: 3 additions & 1 deletion apps/dashboard/app/(app)/workspace-navigations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ const Tag: React.FC<{ label: string; className?: string }> = ({ label, className
);

export const createWorkspaceNavigation = (
workspace: Pick<Workspace, "features"> & Pick<Workspace, "betaFeatures">,
workspace: Pick<Workspace, "features"> &
Pick<Workspace, "betaFeatures"> & { llmGateways: { id: string }[] },
segments: string[],
) => {
return [
Expand Down Expand Up @@ -104,6 +105,7 @@ export const createWorkspaceNavigation = (
href: "/semantic-cache",
label: "Semantic Cache",
active: segments.at(0) === "semantic-cache",
hidden: workspace.llmGateways.length === 0,
},
{
icon: Fingerprint,
Expand Down
36 changes: 0 additions & 36 deletions apps/dashboard/app/new/create-semantic-cache.tsx

This file was deleted.

23 changes: 2 additions & 21 deletions apps/dashboard/app/new/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@ import { insertAuditLogs } from "@/lib/audit";
import { db, schema } from "@/lib/db";
import { auth } from "@clerk/nextjs";
import { newId } from "@unkey/id";
import { ArrowRight, DatabaseZap, GlobeLock, KeySquare } from "lucide-react";
import { ArrowRight, GlobeLock, KeySquare } from "lucide-react";
import { headers } from "next/headers";
import Link from "next/link";
import { notFound, redirect } from "next/navigation";
import { CreateApi } from "./create-api";
import { CreateRatelimit } from "./create-ratelimit";
import { CreateSemanticCacheButton } from "./create-semantic-cache";
import { CreateWorkspace } from "./create-workspace";
import { Keys } from "./keys";

Expand Down Expand Up @@ -80,7 +79,7 @@ export default async function (props: Props) {
]}
/>
<Separator className="my-8" />
<div className="grid grid-cols-1 gap-8 lg:grid-cols-3">
<div className="grid grid-cols-1 gap-8 md::grid-cols-2">
<div className="flex flex-col gap-4 lg:gap-10 p-8 duration-200 border rounded-lg border-border hover:border-primary justify-between">
<div className="flex flex-col gap-4">
<div className="flex items-center justify-center p-4 border rounded-lg bg-primary/5">
Expand Down Expand Up @@ -124,24 +123,6 @@ export default async function (props: Props) {
</Button>
</Link>
</div>
<div className="flex flex-col gap-4 lg:gap-10 p-8 duration-200 border rounded-lg border-border hover:border-primary justify-between">
<div className="flex flex-col gap-4">
<div className="flex items-center justify-center p-4 border rounded-lg bg-primary/5">
<DatabaseZap className="w-6 h-6 text-primary" />
</div>
<h4 className="text-lg font-medium">I want to cache an LLM</h4>
<p className="text-sm text-content-subtle">
Faster, cheaper LLM API calls through re-using semantically similar previous
responses.
</p>
<ol className="ml-2 space-y-1 text-sm list-decimal list-outside text-content-subtle">
<li>You switch out the baseUrl in your requests to OpenAI with your gateway URL</li>
<li>Unkey will automatically start caching your responses</li>
<li>Monitor and track your cache usage here</li>
</ol>
</div>
<CreateSemanticCacheButton />
</div>
</div>
</div>
);
Expand Down
2 changes: 0 additions & 2 deletions apps/dashboard/lib/trpc/routers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { updateKeyOwnerId } from "./key/updateOwnerId";
import { updateKeyRatelimit } from "./key/updateRatelimit";
import { updateKeyRemaining } from "./key/updateRemaining";
import { updateRootKeyName } from "./key/updateRootKeyName";
import { createLlmGateway } from "./llmGateway/create";
import { deleteLlmGateway } from "./llmGateway/delete";
import { createPlainIssue } from "./plain";
import { createNamespace } from "./ratelimit/createNamespace";
Expand Down Expand Up @@ -61,7 +60,6 @@ export const router = t.router({
}),

llmGateway: t.router({
create: createLlmGateway,
delete: deleteLlmGateway,
}),
rootKey: t.router({
Expand Down
8 changes: 0 additions & 8 deletions apps/docs/mint.json
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,6 @@
"group": "Ratelimiting",
"pages": ["ratelimiting/introduction", "ratelimiting/modes", "ratelimiting/overrides"]
},
{
"group": "Semantic cache",
"pages": [
"semantic-cache/introduction",
"semantic-cache/settings",
"semantic-cache/why-semantic-caching"
]
},
{
"group": "Audit logs",
"pages": ["audit-log/introduction", "audit-log/types"]
Expand Down
Loading
Loading