use openrouter (or any other provider) directly instead of vercel ai-gateway #37
EverStarck
started this conversation in
General
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 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
}); |
1 reply
|
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 ? |
0 replies
|
I was able to get a self-hosted LiteLLM proxy working by using 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,
},
}); |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
is this possible? any plans in the future?
All reactions