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

Added models_config and gateway to make it easy to switch betwe… #222

Merged
merged 10 commits into from
Jun 21, 2024

Conversation

innoavator
Copy link
Contributor

…en models

model_config.parameters = {}
return ChatOpenAI(
model=model_config.name.split("/")[1],
temperature=model_config.parameters.get("temperature", 0.1),
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe add an optional model_kwargs

@@ -27,7 +26,6 @@
"query": "Explain in detail different categories of credit cards",
"model_configuration": {
"name": "openai-main/gpt-3-5-turbo",
"provider": "truefoundry",
"parameters": {"temperature": 0.1},
Copy link
Contributor

Choose a reason for hiding this comment

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

What do think on changing this payload similar to ChatOpenAI?

model_config: {
- model_name
- provider
- temperature
- max_tokens
- model_kwargs
}

temperature and max_tokens can go within parameters if required?

backend/types.py Show resolved Hide resolved
models_config.json Show resolved Hide resolved
Comment on lines 28 to 29
AI_GATEWAY = os.getenv("AI_GATEWAY", "openai")
AI_GATEWAY_CONFIG = json.loads(os.getenv("AI_GATEWAY_CONFIG", "{}"))
Copy link
Contributor

Choose a reason for hiding this comment

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

Where is this used?

@innoavator innoavator changed the title [WIP] Added models_config and gateway to make it easy to switch betwe… Added models_config and gateway to make it easy to switch betwe… Jun 20, 2024
if not model_provider_config.api_key_env_var:
api_key = None
else:
api_key = os.environ.get(model_provider_config.api_key_env_var, '')
Copy link
Contributor

Choose a reason for hiding this comment

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

we can use vars from settings.py?

@innoavator innoavator merged commit db0ef77 into main Jun 21, 2024
@innoavator innoavator deleted the model_gateway branch June 21, 2024 06:23
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.

3 participants