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: Decentralized Inference for rig #171

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

genesis-0000
Copy link

@genesis-0000 genesis-0000 commented Dec 27, 2024

Add onchain-verifiable, decentralized inference for rig with onchain Llama, onchain Hermes, and onchain Intellect.

@genesis-0000 genesis-0000 changed the title feat: Decentralized Inference for Zerepy Agents feat: Decentralized Inference for rig Dec 27, 2024
Copy link
Contributor

@0xMochan 0xMochan left a comment

Choose a reason for hiding this comment

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

Hey, we appreciate this integration in this PR! Wanna quickly note that the failing test case is not due to this project, but due to the API keys to test other providers are not available on your github repo. This is an oversight in our intergration testing on our end that we'll address Q1 '25.

You will have to address the failing fmt CI, checkout our CONTRIBUTING.md for more instructions!


Make sure you include an example in the examples repo. A good one to copy is the agent_with_grok.rs one as it tests every major feature. I tested this locally and got basic completion working, but could not get any tools to work, might need to check that.

It seems like a lot of this API sits on top of the openai integration. It might be suitable to actually reuse a lot of the openai models and implementations. Theoretically, you could add extra params similar to how additional_params works for the chain_id and the response onchain_data. I'm not entirely certain if the goal of this platform is for direct openai compatibility or if they plan deviating in the future, but at the very least, some set of openai models could be used to simplify this integration.

tl;dr

  • Address the changes I've suggested
  • Consider some amount of OpenAI reuse
  • Add an example (based on agent_with_grok)
  • Test all features (basically just have agent_with_grok but run with eternalai).

Let me know if you have any specific questions are if you need help in any step, I'd be happy to help! Also feel free to reach out to me on our Discord as well!

Copy link
Contributor

Choose a reason for hiding this comment

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

You can add Eternal AI to the docstring on line 9 (I realize we forgot xAI there too).

Copy link
Author

@genesis-0000 genesis-0000 Dec 30, 2024

Choose a reason for hiding this comment

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

yes, I will

DONE

/// .temperature(0.0)
/// .build();
/// ```
pub fn agent(&mut self, model: &str, chain_id: Option<&str>) -> AgentBuilder<CompletionModel> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pub fn agent(&mut self, model: &str, chain_id: Option<&str>) -> AgentBuilder<CompletionModel> {
pub fn agent(&self, model: &str, chain_id: Option<&str>) -> AgentBuilder<CompletionModel> {

There's no need for &mut self unless there was a specific reason here (if so, leave a comment).

Copy link
Author

@genesis-0000 genesis-0000 Dec 30, 2024

Choose a reason for hiding this comment

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

haha, this is an typo mistake from my IDE. I just made a new updating code.

DONE

Copy link
Author

Choose a reason for hiding this comment

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

I also added rig-core/examples/agent_with_eternalai.rs as a example like your suggestion

@0xMochan
Copy link
Contributor

Also, quick notes:

  • Our next release will be after the holidays, when the whole team is active again so there won't be a release until the first week of January.
  • In the future, please make an issue before creating a PR so we can better keep track of the feature, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants