-
Notifications
You must be signed in to change notification settings - Fork 44.6k
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
Fix the incompatibility bug of azure deployment id configuration with gpt4/3-only #4098
Fix the incompatibility bug of azure deployment id configuration with gpt4/3-only #4098
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
The underlying issue is addressed in #3144. @IANTHEREAL Shall we close this and collaborate there? |
@lc0rp Hi,but I think these two PRs don't solve the same problem |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #4098 +/- ##
==========================================
- Coverage 50.04% 49.98% -0.06%
==========================================
Files 116 116
Lines 4826 4825 -1
Branches 650 650
==========================================
- Hits 2415 2412 -3
- Misses 2227 2228 +1
- Partials 184 185 +1
☔ View full report in Codecov by Sentry. |
Well, not exactly the same, but parts of this PR overlap with #3144 and this PR may be fixed by #3144. So, I should have said they're related. In this PR, you suggest that if we're in gpt4only mode, we should pull settings from the CFG.smart_llm_model and vice-versa. In PR #3144, we ignore the config when we select an exclusive mode at the command line. It shouldn't matter whether the smart_llm_model is set to 3.5 or 4 - in gpt4only mode, we should use GPT-4. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple of comments. Happy to hop on a discord chat/call.
@lc0rp Hi My background is that I'm develop an online service, and neither errors nor performance degradation are acceptable to me. For example, when setting 'gpt4only': The same applies when setting 'gpt3only'. Encountering an error due to the smart model token limit being 8000 is something I'd rather not see. At present, my modifications have only mitigated these issues, but this isn't the best solution. Incorporating these related parameters into two separate GPT configuration objects will be more nature, thus avoiding these discussions that I see as somewhat compromised. I apologize if my response is a bit rushed. If you have thoughts, I'd be happy to discuss further on the community discord after I finish a project in the next couple of days. To add to that, I've just tested your code with gpt4only=True, and it seems that the function get_azure_deployment_id_for_model() isn't working as expected. |
Proposal for a Structured Configuration Object for GPT ModelsIn the current implementation of Auto-GPT, there are multiple parameters related to GPT-3 and GPT-4 models that can be set independently. This can lead to unexpected behavior when the deployment ID for the model is fetched using the ProposalThe proposal is to introduce a @dataclass
class GPTConfig:
model: str
api_key: str
token_limit: int = 4000
temperature: float = 0
api_deployment_id: Optional[str] = None With this data class, we can create separate configuration objects for GPT-3 and GPT-4 models from ENV: gpt3 = GPTConfig(model='gpt-3', api_key='gpt3_api_key', api_deployment_id='gpt-3_deployment_id')
gpt4 = GPTConfig(model='gpt-4', api_key='gpt4_api_key', api_deployment_id='gpt-4_deployment_id') To manage these configurations, a class Config:
def __init__(self):
self.model_config = {
'gpt-3': gpt3,
'gpt-4': gpt4,
}
self.fast_llm_model = 'gpt-3'
self.smart_llm_model = 'gpt-3'
def set_fast_llm_model(self, model: str):
# check whether model is in self.model_config
if model in self.model_config:
self.fast_llm_model = model
else:
raise ValueError(f"Model {model} is not in the configuration") Benefits
|
@lc0rp How do you feel about it? Do you think you could take on the implementation of this proposal? I would really appreciate your assistance with this. |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
Oops, I was absent these past few days. However, I agree with you regarding the matter of multiple independent variables that need to be linked, and I must say, your proposal looks fantastic! I am pleased to note that the re-architectural design has also reached similar conclusions, and your proposal resembles the re-architectural code. The re-architectural code is situated in a separate branch as all the loose ends have been tied. It is almost ready for release. Take a look at the LLM base models through this link: https://github.com/Significant-Gravitas/Auto-GPT/blob/agent-state-encapsulation/autogpt/llm/base.py and let me know your thoughts. If you'd like to continue the proposal afterward, I'd be happy to collaborate. We'll move it to a new DRAFT issue and invite feedback before PR submission. |
@lc0rp Similar to how the static attributes of GPT are preserved in the LLM base models: https://github.com/Significant-Gravitas/Auto-GPT/blob/agent-state-encapsulation/autogpt/llm/base.py, I think we can implement a similar GPT dynamic attributes configuration. I'd like to convert this PR into a draft and try to modify it. If you have any other plans or thoughts, please feel free to share with me at any time. |
@IANTHEREAL Is this still valid? If so, we're prepping for release v0.4.3. Please resolve conflicts and stand by as we merge. |
… set-gpt3/4-only
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
✅ Deploy Preview for auto-gpt-docs canceled.
|
@lc0rp Yes, I have resolved it |
This pull request has conflicts with the base branch, please resolve those so we can evaluate the pull request. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config module was overhauled in #4803, causing conflicts with this PR (again). I'm not sure why this PR wasn't included in an earlier release yet, it looks like it was mergeable.
Anyhow, it seems that #4803 also broke support for Azure by removing Config.get_azure_deployment_id_for_model()
. Instead of resolving the merge conflicts on this PR, maybe it's easier to make a new PR fixing Azure support altogether in a new PR.
Update: @collijk will look into patching basic Azure support first, and then we can check if the issue addressed by this PR still exists.
Update 2: looks like this PR fixes Azure support: #4875
Conflicts have been resolved! 🎉 A maintainer will review the pull request shortly. |
* Fix --gpt3only and --gpt4only * Fix and consolidate test_config.py::test_azure_config (x2) --------- Co-authored-by: Luke K (pr-0f3t) <[email protected]> Co-authored-by: Ryan <[email protected]> Co-authored-by: Reinier van der Leer <[email protected]>
Background
When I use the azure openai api and set the set gpt4 only, auto gpt will fail because the deployment id is incorrect.
azure.yaml
min test script
output
But it should be
Changes
When the user sets set gpt4 only, modify the corresponding fast llm model related configuration
Documentation
Test Plan
PR Quality Checklist