-
Notifications
You must be signed in to change notification settings - Fork 203
use openrouter (or any other provider) directly instead of vercel ai-gateway #37
-
is this possible? any plans in the future?
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1
Replies: 3 comments 1 reply
-
Yes, it's possible but it could get some better documentation on how to do that and what culprits there are.
You have to install the @openrouter/ai-sdk-provider package.
import { defineAgent } from "eve"; import { createOpenRouter } from '@openrouter/ai-sdk-provider'; const openrouter = createOpenRouter({ apiKey: 'sk-xxxxxxxxx', // Don't commit your API Key, this is just for demonstration purposes }); export default defineAgent({ model: openrouter("deepseek/deepseek-v4-flash"), // Change model as you see fit modelContextWindowTokens: 1_000_000, // THIS IS IMPORTANT, without this, Eve returns an error });
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 5
-
oh, that's cool, thx!
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
So i guess you could do the same with github copilot or anthropic directly too ? A lot of companies are using those and need to go directly throught them for data privacy reasons, etc. If yes do you know how to do it ?
Beta Was this translation helpful? Give feedback.
All reactions
-
I was able to get a self-hosted LiteLLM proxy working by using @ai-sdk/openai-compatible:
import { defineAgent } from "eve"; import { createOpenAICompatible } from '@ai-sdk/openai-compatible'; // Create a custom provider pointing to your LiteLLM proxy const litellm = createOpenAICompatible({ name: "anthropic", baseURL: process.env.LITELLM_PROXY_BASE_URL || 'http://localhost:4000/v1', apiKey: process.env.LITELLM_PROXY_API_KEY || 'your-proxy-key', }); export default defineAgent({ model: litellm("claude-sonnet-4-6"), // use the model name as in LiteLLM compaction: { thresholdPercent: 0.75, }, });
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 2