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

feat: add venice.ai api model provider #1008

Merged
merged 5 commits into from
Dec 13, 2024
Merged

Conversation

proteanx
Copy link
Contributor

integrates venice api

Risks

Low, just an additional API option (that's really fast)

Background

Venice.ai is an artificial intelligence platform that provides access to advanced AI models, prioritizing user privacy by storing data only in the user's browser. It offers a paid version, Venice Pro, with higher limits and customization options, which is also available for free to users holding 1 Morpheus (MOR) token. The platform supports document uploads and image generation, and has a presence on Twitter, Farcaster, and Instagram.

What does this PR do?

Adds the Venice AI API for accessing its supported models (really fast)

What kind of change is this?

Feature (non-breaking change which adds functionality)

Documentation changes needed?

My changes do not require a change to the project documentation. Usage is pretty straightforward.

Testing

Where should a reviewer start?

I tested with the default characters (by changing API option to venice)

Detailed testing steps

Configure VENICE_API_KEY in .env
Change a character json to use modelProvider "venice"
Test text generation using configured model pnpm start --characters=/path/to/chararacter

Discord username

same as github: @proteanx

integrates venice api
@proteanx proteanx changed the title add venice api model provider feat: add venice.ai api model provider Dec 12, 2024
Comment on lines 463 to 466
[ModelClass.SMALL]: "llama-3.3-70b",
[ModelClass.MEDIUM]: "llama-3.3-70b",
[ModelClass.LARGE]: "llama-3.1-405b",
[ModelClass.IMAGE]: "fluently-xl",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe allow users to configure them through .env? E.g., https://github.com/ai16z/eliza/pull/999/files

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call and done!

@odilitime odilitime added the ModelProvider_new New model provider plugin PR label Dec 12, 2024
will submit new pr for this
will add back if/when this is added to the api
@proteanx
Copy link
Contributor Author

I didn't test the image generation and it looks like it will require more work so I removed it for now and will make a new PR to add it later.

It also appears venice doesn't use frequency or presence penalty parameters (yet at least) so I removed that (for now).

This PR should be good now

@proteanx
Copy link
Contributor Author

@odilitime should I push the pnpm-lock.yaml back in to fix merge conflict?

@odilitime odilitime deleted the branch elizaOS:develop December 13, 2024 02:37
@odilitime odilitime closed this Dec 13, 2024
@odilitime odilitime reopened this Dec 13, 2024
to fix conflict
@@ -479,6 +479,29 @@ export async function generateText({
break;
}

case ModelProviderName.VENICE: {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can just add this as a case around line 149, as venice follow the openAI api spec.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea I tested this as well (definitely works) but I plan to add the venice_parameters that are exclusive to venice as they come out.

model: {
[ModelClass.SMALL]: settings.SMALL_VENICE_MODEL || "llama-3.3-70b",
[ModelClass.MEDIUM]: settings.MEDIUM_VENICE_MODEL || "llama-3.3-70b",
[ModelClass.LARGE]: settings.LARGE_VENICE_MODEL || "llama-3.1-405b",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably add an image model here like flux-dev-unsencored as the default with the option to control in the .env file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally had image generation in here but it needs more work so I figured I'd add it in a later PR. In the first commit here it's included though.

@lalalune
Copy link
Member

Merging this so we can stay up to date, expecting there's another PR coming for more Venice stuff. Great work on this.

@lalalune lalalune merged commit 9192179 into elizaOS:develop Dec 13, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ModelProvider_new New model provider plugin PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants