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

Add model alias configuration support and documentation #941

Merged
merged 2 commits into from
Dec 13, 2024

Conversation

pelikhan
Copy link
Member

@pelikhan pelikhan commented Dec 13, 2024

Introduce support for model aliases, allowing users to define friendly names for models. Update documentation to reflect the new feature and provide examples for configuration.


  • 📚 Documentation Enhancements:

    • Added links to model aliases for better navigation and understanding.
    • Expanded the explanation of how model aliases can be overridden using CLI, environment variables, or configuration files.
    • Introduced a new documentation page for "Model Aliases" explaining how to define and use them.
  • 🆕 Feature Addition:

    • Implemented a new system for managing model aliases within the NodeHost class, allowing for more flexible and organized alias configurations.
    • Introduced methods to set and retrieve model aliases from different sources (CLI, environment, configuration).
  • 🔧 Refactor:

    • Moved setModelAlias functionality into the NodeHost class for better encapsulation and maintainability.
    • Updated various components to utilize the new model alias management system.
  • 🧪 Testing Configuration Updates:

    • Modified TestHost to support the new setModelAlias method for testing purposes.
  • 🗂️ Configuration File Update:

    • Added sample model aliases in genaiscript.config.json to demonstrate usage of the new alias system.

generated by prd


Certainly! Below is a high-level summary of the key changes in the codebase based on the provided GIT_DIFF output:

  • Enhanced Configuration Flexibility: The addition of modelAliases in the global configuration file (genaiscript.config.json) allows users to define custom aliases for language models. This makes it easier to reference specific models using concise names.

  • Improved Model Configuration Details: When tracing connections to language models, detailed information now includes not only the model but also its configured temperature if applicable. This provides better visibility and control over how models are used in different scenarios.

  • API Update for TestHost: The TestHost class has been updated to include a method for setting model aliases, aligning with the new configuration schema.

  • Validation of Configuration Format: By updating the JSON schema (hostconfiguration.schema.json), the system now validates the structure of the global configuration file, ensuring that modelAliases are correctly formatted and can accept either simple string values or complex configurations.

These changes aim to improve both usability (through clearer model references) and traceability (by providing more detailed information about model usage).

generated by pr-describe

@github-actions github-actions bot deleted a comment from pelikhan Dec 13, 2024
Copy link

LGTM 🚀

The changes you've introduced in this pull request provide a comprehensive way to configure model aliases for different sources (config, env, cli). It also enhances the readability of these aliases in trace logs when connected to language models. This should lead to more flexibility and maintainability in managing model configurations across different environments or use cases.

No specific functional issues were found in the changes described. The updated diff provides a high-level overview of how the functionality has been improved, with proper TypeScript interfaces and type safety maintained.

Let's get these changes merged! 🚀

generated by pr-review

@pelikhan pelikhan merged commit 4aa8f89 into main Dec 13, 2024
12 checks passed
@pelikhan pelikhan deleted the modeliasconnection branch December 13, 2024 01:34
@pelikhan
Copy link
Member Author

If you click on configuration, then model aliases in the trace, you will see all aliases and their source (cli, env, ...)

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.

1 participant