-
Notifications
You must be signed in to change notification settings - Fork 894
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
f/generic model support #24
Merged
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
5079f33
f/generic-model-support
creatorrr 439f465
Update docker-compose.yml to include model-serving instead of model-api
alt-glitch e26ee10
Fix type annotation in Entry content field for function caling (duct …
alt-glitch ba69eb3
compatibility for julep models
alt-glitch 9a14341
refactor: function calling + model support
alt-glitch 765d66f
Merge branch 'dev' into f/generic-model-support-
alt-glitch ea3af3c
Merge branch 'dev' into f/generic-model-support-
alt-glitch a50bf9a
feat: differentiated usage between openai_client and julep_client for…
alt-glitch 3e9b87c
Merge branch 'dev' into f/generic-model-support-
alt-glitch 262e92b
chore: handle invalid agent models
alt-glitch 0c59769
remove unnecessary validation
alt-glitch daf1b35
wip: handling extra_body settings for julep models
alt-glitch 1ba71b1
wip: fix tests for model parameter being required in `create_agent_qu…
alt-glitch e4cd146
wip: updated model-registry to add gpt-4-turbo
alt-glitch 1855edb
Merge branch 'dev' into f/generic-model-support-
alt-glitch de6fe90
refactor: pytype + lint
alt-glitch d6df6ee
fix: remov unnecessary additions to.gitignore
alt-glitch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,7 @@ ngrok* | |
*.env | ||
*.pyc | ||
*/node_modules/ | ||
.devcontainer | ||
node_modules/ | ||
package-lock.json | ||
package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
""" | ||
Model Registry maintains a list of supported models and their configs. | ||
""" | ||
from typing import Dict, List, Optional | ||
|
||
GPT4_MODELS: Dict[str, int] = { | ||
# stable model names: | ||
# resolves to gpt-4-0314 before 2023-06-27, | ||
# resolves to gpt-4-0613 after | ||
"gpt-4": 8192, | ||
"gpt-4-32k": 32768, | ||
# turbo models (Turbo, JSON mode) | ||
"gpt-4-1106-preview": 128000, | ||
"gpt-4-0125-preview": 128000, | ||
"gpt-4-turbo-preview": 128000, | ||
# multimodal model | ||
"gpt-4-vision-preview": 128000, | ||
# 0613 models (function calling): | ||
# https://openai.com/blog/function-calling-and-other-api-updates | ||
"gpt-4-0613": 8192, | ||
"gpt-4-32k-0613": 32768, | ||
# 0314 models | ||
"gpt-4-0314": 8192, | ||
"gpt-4-32k-0314": 32768, | ||
} | ||
|
||
TURBO_MODELS: Dict[str, int] = { | ||
# stable model names: | ||
# resolves to gpt-3.5-turbo-0301 before 2023-06-27, | ||
# resolves to gpt-3.5-turbo-0613 until 2023-12-11, | ||
# resolves to gpt-3.5-turbo-1106 after | ||
"gpt-3.5-turbo": 4096, | ||
# resolves to gpt-3.5-turbo-16k-0613 until 2023-12-11 | ||
# resolves to gpt-3.5-turbo-1106 after | ||
"gpt-3.5-turbo-16k": 16384, | ||
# 0125 (2024) model (JSON mode) | ||
"gpt-3.5-turbo-0125": 16385, | ||
# 1106 model (JSON mode) | ||
"gpt-3.5-turbo-1106": 16384, | ||
# 0613 models (function calling): | ||
# https://openai.com/blog/function-calling-and-other-api-updates | ||
"gpt-3.5-turbo-0613": 4096, | ||
"gpt-3.5-turbo-16k-0613": 16384, | ||
# 0301 models | ||
"gpt-3.5-turbo-0301": 4096, | ||
} | ||
|
||
GPT3_5_MODELS: Dict[str, int] = { | ||
"text-davinci-003": 4097, | ||
"text-davinci-002": 4097, | ||
# instruct models | ||
"gpt-3.5-turbo-instruct": 4096, | ||
} | ||
|
||
GPT3_MODELS: Dict[str, int] = { | ||
"text-ada-001": 2049, | ||
"text-babbage-001": 2040, | ||
"text-curie-001": 2049, | ||
"ada": 2049, | ||
"babbage": 2049, | ||
"curie": 2049, | ||
"davinci": 2049, | ||
} | ||
|
||
|
||
DISCONTINUED_MODELS = { | ||
"code-davinci-002": 8001, | ||
"code-davinci-001": 8001, | ||
"code-cushman-002": 2048, | ||
"code-cushman-001": 2048, | ||
} | ||
|
||
CLAUDE_MODELS: Dict[str, int] = { | ||
"claude-instant-1": 100000, | ||
"claude-instant-1.2": 100000, | ||
"claude-2": 100000, | ||
"claude-2.0": 100000, | ||
"claude-2.1": 200000, | ||
"claude-3-opus-20240229": 180000, | ||
"claude-3-sonnet-20240229": 180000, | ||
"claude-3-haiku-20240307": 180000, | ||
} | ||
|
||
CHAT_MODELS = { | ||
**GPT4_MODELS, | ||
**TURBO_MODELS, | ||
**CLAUDE_MODELS | ||
} | ||
|
||
ALL_AVAILABLE_MODELS = { | ||
**GPT4_MODELS, | ||
**TURBO_MODELS, | ||
**GPT3_5_MODELS, | ||
**GPT3_MODELS, | ||
**CLAUDE_MODELS, | ||
alt-glitch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
|
||
def validate_configuration(): | ||
alt-glitch marked this conversation as resolved.
Show resolved
Hide resolved
|
||
""" | ||
function that validates the config based on the model | ||
""" | ||
pass | ||
|
||
|
||
def validate_request(): | ||
""" | ||
function that validates the config based on the model | ||
""" | ||
pass | ||
|
||
def prepare_request(): | ||
""" | ||
creatorrr marked this conversation as resolved.
Show resolved
Hide resolved
|
||
method that given the request in extended openai format | ||
""" | ||
pass | ||
|
||
def parse_response(): | ||
""" | ||
method that converts the response from the provider back into the openai format | ||
""" | ||
pass | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why are these gitignored? be careful