feat(image-processor): switch to OpenRouter Vision for smart crop and remove heavy models

This commit is contained in:
2026-02-22 23:24:22 +01:00
parent 1bbe89c879
commit 2a169f1dfc
4 changed files with 113 additions and 89 deletions

View File

@@ -35,11 +35,9 @@ fastify.get("/process", async (request, reply) => {
try {
const response = await fetch(url);
if (!response.ok) {
return reply
.status(response.status)
.send({
error: `Failed to fetch source image: ${response.statusText}`,
});
return reply.status(response.status).send({
error: `Failed to fetch source image: ${response.statusText}`,
});
}
const arrayBuffer = await response.arrayBuffer();
@@ -50,6 +48,7 @@ fastify.get("/process", async (request, reply) => {
height,
format,
quality,
openRouterApiKey: process.env.OPENROUTER_API_KEY,
});
reply.header("Content-Type", `image/${format}`);