Skip to content

chore(wren-ai-service): Introduce Model Aliases for Simplified Pipeline Configuration#1371

Merged
paopa merged 6 commits into
mainfrom
chore/update-ollama-config-example
Mar 7, 2025
Merged

chore(wren-ai-service): Introduce Model Aliases for Simplified Pipeline Configuration#1371
paopa merged 6 commits into
mainfrom
chore/update-ollama-config-example

Conversation

@paopa
Copy link
Copy Markdown
Contributor

@paopa paopa commented Mar 6, 2025

This PR add a model alias to simplify and standardize model references across pipeline configurations. The changes include:

  • Added 'alias: default' to LLM and embedder model configurations
  • Updated all pipeline configurations to use the new alias reference system
  • Replaced explicit model names with '.default' references in all pipeline configurations
  • Applied changes consistently across deployment, docker, and Azure configurations
  • Modified prefix to ollama_chat to ensure the json schema output in ollama example config

Benefits:

  • Simplified model reference management
  • Easier model swapping without updating multiple pipeline references
  • Reduced configuration maintenance overhead
  • More consistent configuration across different environments

The changes maintain full functionality while making the configuration more maintainable and flexible for future updates.

Reference:

Summary by CodeRabbit

Summary by CodeRabbit

  • Documentation
    • Updated configuration examples to standardize model references with a new alias field, enhancing maintainability.
    • Restructured model definitions for clarity, ensuring consistent usage of the default alias across configurations.
    • The overall configuration structure and existing settings remain unchanged.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 6, 2025

Walkthrough

The pull request introduces modifications across multiple configuration files, primarily adding an alias key set to default for various models, including LLMs and embedders. The api_base for certain models has been updated to remove the /v1 suffix. References to specific model names are updated to use the new default alias throughout the configurations, streamlining the model references and enhancing maintainability without altering existing parameters.

Changes

File Change Summary
wren-ai-service/docs/config_examples/config.ollama.yaml Updated api_base for models and added alias: default for ollama_chat/phi4:14b and ollama/nomic-embed-text; updated references to litellm_llm.default and litellm_embedder.default.
wren-ai-service/tools/config/config.example.yaml Added alias: default for models gpt-4o-mini-2024-07-18 and text-embedding-3-large; updated pipeline references to litellm_llm.default and litellm_embedder.default.
deployment/kustomizations/base/cm.yaml Added alias: default for models in litellm_llm and litellm_embedder; updated pipeline references to use litellm_llm.default and litellm_embedder.default.
docker/config.example.yaml Added alias: default for models gpt-4o-mini-2024-07-18 and text-embedding-3-large; updated references to litellm_llm.default and litellm_embedder.default.
wren-ai-service/docs/config_examples/config.azure.yaml Added alias: default for azure/gpt-4 and azure/text-embedding-ada-002; updated pipeline references to litellm_llm.default and litellm_embedder.default.
wren-ai-service/docs/config_examples/config.deepseek.yaml Added alias: default for various deepseek models; updated pipeline references to litellm_llm.default and litellm_embedder.default.
wren-ai-service/docs/config_examples/config.google_ai_studio.yaml Added alias: default for gemini/gemini-2.0-flash-exp and gemini/text-embedding-004; updated pipeline references to litellm_llm.default and litellm_embedder.default.
wren-ai-service/docs/config_examples/config.groq.yaml Added alias: default for groq/llama-3.3-70b-specdec and text-embedding-3-large; updated pipeline references to litellm_llm.default and litellm_embedder.default.
wren-ai-service/tools/config/config.full.yaml Added alias: default for models; updated pipeline references to litellm_llm.default and litellm_embedder.default.

Possibly related PRs

Suggested labels

ci/ai-service

Suggested reviewers

  • cyyeh

Poem

I'm a rabbit, hopping through lines of YAML code,
With a new key nestled in the configuration load.
API keys aligned like carrots in a row,
Each change making the system smoothly go.
I twitch my nose and cheer with glee,
Celebrating each tweak in our tech family.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
wren-ai-service/docs/config_examples/config.azure.yaml (1)

134-134: Pipeline Settings Update:
The flag allow_using_db_schemas_without_pruning has been explicitly set (with an accompanying comment explaining its effect). Please review this setting to ensure that the trade-off between performance and schema safety meets your expectations.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2115a2a and 98a22c3.

📒 Files selected for processing (8)
  • deployment/kustomizations/base/cm.yaml (3 hunks)
  • docker/config.example.yaml (3 hunks)
  • wren-ai-service/docs/config_examples/config.azure.yaml (3 hunks)
  • wren-ai-service/docs/config_examples/config.deepseek.yaml (3 hunks)
  • wren-ai-service/docs/config_examples/config.google_ai_studio.yaml (3 hunks)
  • wren-ai-service/docs/config_examples/config.groq.yaml (3 hunks)
  • wren-ai-service/docs/config_examples/config.ollama.yaml (3 hunks)
  • wren-ai-service/tools/config/config.full.yaml (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (31)
wren-ai-service/docs/config_examples/config.groq.yaml (5)

10-17: Enhanced LLM Model Configuration
The addition of alias: default standardizes the model reference in the LLM section. The guiding comment about setting GROQ_API_KEY in the environment helps clarify API key usage.


23-28: Embedder Model Configuration Update
The embedder section now uniformly uses alias: default, which aligns with the new configuration standards. The inline comments provide clear instructions on setting the OPENAI_API_KEY.


39-39: Document Store Parameter Clarification
Introducing embedding_model_dim: 3072 explicitly documents the model dimension, which is useful for downstream processing. Ensure that this matches the requirements of your embedding service.


49-127: Pipeline Model Reference Uniformity
All pipeline entries have been updated to reference models using the default alias (e.g., litellm_llm.default and litellm_embedder.default). This change improves consistency across the configuration and simplifies model management. Verify that all consumers of these configurations have been updated to use the new alias.


133-133: Settings Consistency Check
The explicit setting allow_using_db_schemas_without_pruning: false indicates a deliberate performance or safety choice. Please confirm that this configuration aligns with your intended operational behavior and performance considerations.

wren-ai-service/docs/config_examples/config.azure.yaml (4)

10-20: LLM Model Configuration Update:
The configuration for the Azure LLM model now explicitly defines a default alias (default) along with dedicated parameters (such as api_base, api_version, timeout, and kwargs). This standardizes the model reference and improves clarity. Please verify that the Azure endpoint (https://endpoint.openai.azure.com) and API version (2024-02-15-preview) are correct for your deployment.


25-30: Embedder Model Configuration Update:
The embedder section for the Azure text-embedding model now includes a default alias (default) and its own API settings. Ensure that the specified API base and API version match your Azure environment requirements.


38-39: Document Store Settings Check:
The document store configuration now sets embedding_model_dim to 1536 with a note to ensure it matches the embedder’s output. Please confirm that this dimension is appropriate for your chosen model.


48-129: Pipeline References Standardization:
All pipeline steps have been updated to refer to models via their default aliases (e.g. litellm_llm.default and litellm_embedder.default). This change reduces duplication and simplifies further maintenance. Verify that these updated references work seamlessly with any service or script that relies on them.

wren-ai-service/docs/config_examples/config.deepseek.yaml (3)

10-20: Deepseek LLM Configuration Update:
The Deepseek LLM models now include a default alias (default) and standard API settings. The configuration for the deepseek/deepseek-reasoner (and the similar subsequent entries for chat and coder) now clearly defines timeout and kwargs values. Please confirm that the common API base (https://api.deepseek.com/v1) is correct for all these endpoints.


40-46: Deepseek Embedder Update:
The embedder configuration for text-embedding-3-large now includes a default alias and points to an OpenAI API endpoint. Verify that the API base (https://api.openai.com/v1) and the timeout setting are aligned with your embedding model provider’s requirements.


63-138: Pipeline References Consistency:
The pipeline declaration has been updated to consistently reference both the LLM and embedder models via their default aliases. This uniformity should streamline downstream integration. Please ensure that all service interactions use these updated names.

wren-ai-service/docs/config_examples/config.google_ai_studio.yaml (5)

10-17: Primary LLM Model Update:
The Gemini LLM model (gemini/gemini-2.0-flash-exp) now has a default alias (default) along with its timeout and kwargs settings. This update standardizes the model reference. Confirm that these parameters meet your expected performance benchmarks.


18-24: Alternate LLM Alias Usage:
An alternate configuration for the Gemini LLM is maintained with an alias (gemini-llm-for-chart), which is likely used for specialized pipelines (such as chart generation). Ensure that pipeline references explicitly target the intended alias where needed.


29-33: Embedder Model Configuration Update:
The embedder model for Google AI Studio now includes a default alias and a custom api_base pointing to the Google endpoint. Please verify that the API base URL (https://generativelanguage.googleapis.com/v1beta/openai) is current and correct.


39-44: Document Store Verification:
The document store settings specify an embedding_model_dim of 768. Make sure this dimensionality correctly reflects the output size of your chosen embedder model.


50-126: Pipeline References Standardization:
The pipeline section has been comprehensively updated to use the default model aliases (and, where needed, the alternate alias for chart-related tasks). This consistency improves readability and maintainability. Double-check that all references correctly map to the intended models.

docker/config.example.yaml (3)

5-9: LLM Model – Default Alias Addition:
For the gpt-4o-mini-2024-07-18 model, a default alias (default) has been added alongside its API settings. This will help simplify pipeline references. Please verify that this change aligns with your multi-model deployment strategy.


37-41: Embedder Model – Default Alias Addition:
The embedder section now assigns a default alias to the text-embedding-3-large model. This change creates consistency between the LLM and embedder configurations. Ensure that the API key name (EMBEDDER_OPENAI_API_KEY) is correctly set in your environment.


59-136: Pipeline References Standardization:
The pipeline definitions have been updated to use litellm_llm.default and litellm_embedder.default consistently across all pipes. This refactoring promotes a clean and unified configuration. Please test that these updates do not disrupt the service discovery process.

deployment/kustomizations/base/cm.yaml (3)

56-60: LLM Model Update in ConfigMap:
Within the inline configuration (config.yaml), the gpt-4o-mini-2024-07-18 model configuration now includes the default alias and API key name. This aligns with the changes made in other configuration files. Verify that this alias is used throughout your deployment for consistency.


86-90: Embedder Model Update in ConfigMap:
The embedder model (text-embedding-3-large) now carries the default alias along with its API settings. Please confirm that this configuration is in sync with your embedder service’s integration requirements.


107-169: Pipeline References in ConfigMap:
The pipeline section in the ConfigMap has been updated to refer to models via the default aliases (litellm_llm.default and litellm_embedder.default). This change streamlines model selection across the deployment. Ensure that any internal service calls or scripts reference these aliases correctly.

wren-ai-service/docs/config_examples/config.ollama.yaml (3)

10-18: LLM Model Configuration Enhancement

The addition of alias: default and api_key_name: OPENAI_API_KEY in the LLM model block clearly defines the default model and the API key to use. This change improves clarity and streamlines API key management.


24-29: Embedder Model Configuration Update

The embedder configuration now includes both alias: default and api_key_name: OPENAI_API_KEY, ensuring consistency with the LLM configuration. This makes it easier to manage credentials across models.


49-63: Pipeline References Standardization

The pipeline section has been updated to reference models using the default alias (e.g. llm: litellm_llm.default and embedder: litellm_embedder.default). This standardization helps reduce configuration ambiguity. Please verify that all downstream components correctly recognize these updated aliases.

wren-ai-service/tools/config/config.full.yaml (5)

5-14: Primary LLM Model Configuration Update

For the first LLM model entry ("gpt-4o-mini-2024-07-18"), the configuration now includes alias: default along with api_key_name: LLM_OPENAI_API_KEY. This clear designation supports the new default API key mechanism.


15-23: Secondary LLM Model Configuration Consideration

The second LLM model entry ("gpt-4o-2024-08-06") has been updated with the API key details but does not include an alias field. If this is intentional (to reserve the default alias for one primary model), please confirm. Otherwise, consider adding an alias for consistency.


24-31: Tertiary LLM Model Configuration Review

The third LLM model ("o3-mini-2025-01-31") is configured with API key support but similarly omits an alias. Consistency is key here; if only one model is meant to be default, this is fine, but documentation should clarify the selection mechanism.


37-41: Embedder Model Configuration Confirmation

The embedder model ("text-embedding-3-large") now includes both alias: default and api_key_name: EMBEDDER_OPENAI_API_KEY, which aligns well with the overall objective of streamlining API key and model identification.


72-152: Pipeline Configuration Consistency Check

The entire pipeline section has been updated so that all model references use the new default aliases (e.g. llm: litellm_llm.default and embedder: litellm_embedder.default). This uniformity should simplify maintenance and reduce misconfiguration risks. Please verify that these references integrate seamlessly with downstream processing components.

@paopa paopa added the module/ai-service ai-service related label Mar 6, 2025
@paopa paopa changed the title chore(wren-ai-service): Add API Key Configuration Support for Ollama Models with OpenAI compatible format chore(wren-ai-service): Introduce Model Aliases for Simplified Pipeline Configuration Mar 6, 2025
@paopa paopa requested a review from wwwy3y3 March 6, 2025 09:15
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
wren-ai-service/docs/config_examples/config.ollama.yaml (2)

10-16: Review: LLM Model Configuration Update

The LLM configuration has been updated to use the new model alias system and the model name has been changed to ollama_chat/phi4:14b. The new key alias: default is added along with the existing settings (timeout, kwargs). One nitpick is that the inline comment on the api_base field still instructs that the API base should be <ollama_url>/v1, while the configuration now omits the /v1 suffix. Consider updating the comment to avoid any confusion.

-  - api_base: http://host.docker.internal:11434 # change this to your ollama host, api_base should be <ollama_url>/v1
+  - api_base: http://host.docker.internal:11434 # change this to your ollama host; note: `/v1` suffix has been removed as per the new configuration

22-25: Review: Embedder Model Configuration Update

The embedder configuration is updated by switching the model to ollama/nomic-embed-text and adding the new alias: default key. As with the LLM configuration, the inline comment on the api_base field still indicates a /v1 suffix, which may now be misleading. It’s recommended to update that comment for clarity.

-    api_base: http://host.docker.internal:11434 # change this to your ollama host, api_base should be <ollama_url>/v1
+    api_base: http://host.docker.internal:11434 # change this to your ollama host; note: `/v1` suffix has been removed as per the new configuration
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 98a22c3 and 322ed77.

📒 Files selected for processing (1)
  • wren-ai-service/docs/config_examples/config.ollama.yaml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (go)
🔇 Additional comments (3)
wren-ai-service/docs/config_examples/config.ollama.yaml (3)

36-36: Review: Document Store Configuration Update

The addition of embedding_model_dim: 768 explicitly configures the expected dimension for embeddings. Ensure that this value is compatible with the outputs of your embedding model.


46-124: Review: Pipeline Configuration Alias Updates

The pipeline configuration has been updated comprehensively:

  • References for both LLMs and embedders have been replaced with the alias-based references (litellm_llm.default and litellm_embedder.default).
  • The consistency across various pipeline definitions (e.g., db_schema_retrieval, sql_generation, intent_classification, etc.) simplifies future model updates.

Verify that these alias mappings correctly correspond to your intended models and that no legacy model names remain in any downstream configuration files.


130-130: Review: Settings Configuration Update

The settings now explicitly include allow_using_db_schemas_without_pruning: false with an accompanying comment. Confirm that this configuration value aligns with your performance and architectural requirements regarding database schema usage.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
wren-ai-service/docs/config_examples/config.ollama.yaml (1)

130-130: Settings Default Verification
The setting allow_using_db_schemas_without_pruning: false now appears with a guiding comment about performance. Verify that this default choice has been correctly communicated to users and matches your intended behavior for environments that may prefer performance improvements.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 322ed77 and e9adfc4.

📒 Files selected for processing (1)
  • wren-ai-service/docs/config_examples/config.ollama.yaml (3 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Analyze (go)
🔇 Additional comments (4)
wren-ai-service/docs/config_examples/config.ollama.yaml (4)

10-16: LLM Model Configuration Update
This section now uses the updated model identifier (ollama_chat/phi4:14b) and introduces the alias: default key along with the unchanged timeout and kwargs settings. This aligns well with the PR objective for simplified model reference management.


22-25: Embedder Configuration Alignment
The embedder model is updated to use ollama/nomic-embed-text with the new alias: default and the modified api_base. These changes maintain consistency with the LLM configuration and support simplified pipeline references.


36-36: Document Store Parameter Addition
The addition of embedding_model_dim: 768 provides an explicit configuration for the dimension of the embedding model. Please ensure that this value matches the expected dimension of your embedding model and is synchronized with any indexing setup in Qdrant.


47-124: Pipeline Configuration Standardization
Across the various pipeline definitions, explicit model names have been replaced with alias references (litellm_llm.default and litellm_embedder.default). This update simplifies model swapping and reduces maintenance overhead as intended by the PR. Double-check that all pipeline components (e.g., llm, embedder, engine, document_store) correctly interpret the new alias references.

@paopa paopa merged commit 3f0f7a6 into main Mar 7, 2025
@paopa paopa deleted the chore/update-ollama-config-example branch March 7, 2025 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module/ai-service ai-service related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants