Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

use openrouter (or any other provider) directly instead of vercel ai-gateway #37

EverStarck started this conversation in General
Discussion options

is this possible? any plans in the future?

You must be logged in to vote

Replies: 3 comments 1 reply

Comment options

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
});
You must be logged in to vote
1 reply
Comment options

oh, that's cool, thx!

Comment options

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 ?

You must be logged in to vote
0 replies
Comment options

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,
 },
});
You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

AltStyle によって変換されたページ (->オリジナル) /