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

Muxing Support for Model Routing #566

Open
lukehinds opened this issue Jan 13, 2025 · 1 comment
Open

Muxing Support for Model Routing #566

lukehinds opened this issue Jan 13, 2025 · 1 comment

Comments

@lukehinds
Copy link
Contributor

lukehinds commented Jan 13, 2025

Introduce support for "Muxing" in CodeGate, enabling users to route specific types of logic to different large language models (LLMs) based on file type, individual files, or the context of a Git codebase. This would provide cost savings , a common complaint from users is the expense of tokens and how to optimise those costs.

For example:

  • Per File Type: Documentation files (e.g., .md, .rst) could be processed by a free, local model, while source code files (e.g., .py, .js) are handled by an advanced model like Claude Sonnet 3.5.
  • Per File: Users could specify models for particular files within a project based on complexity or other criteria.
  • Per Repository: For one Git codebase, users might choose a local model for privacy reasons, while another repository could leverage a different model for advanced coding tasks.

Why is this feature important?

  1. Granular Control: Developers can tune model usage based on file type or project needs.
  2. Resource Efficiency: Allocate lightweight or local models to simpler tasks, while reserving advanced models for more complex challenges, providing more cost efficiency.
  3. Git Integration: Aligns with the workflow of managing multiple repositories, providing seamless configuration across projects. See

NOTE: As always, start small, simple and validate, the following acts as a guideline of where this could lead.

Possible Solution

Expand CodeGate’s functionality to include:

  1. File-Type-Based Routing:

    • Route tasks based on file extensions or MIME types.
    • Example: .md -> local_model, .py -> claude_sonnet_3.5.
  2. Per-File Routing:

    • Allow specific files in a project to be linked to a designated model.
    • Example: config.py -> local_model_v2.
  3. Repository-Level Configuration:

    • Enable users to set model preferences for an entire repository.
    • Example: Repository A -> local_model, Repository B -> advanced_model.

Challenges and Considerations

  • Git Context Awareness: Ensure the muxing system can recognize the active repository and apply the appropriate routing.
  • Conflict Resolution: Define how conflicts between repository-level and file-level rules are handled.
  • Latency and Performance: Optimize routing logic to prevent delays in large or multi-repository setups.
  • User Experience: Provide clear documentation and possibly a UI component for managing these configurations.
@lukehinds
Copy link
Contributor Author

Moving this to ready, as I think we can at least start prototyping and thinking about this, albeit we should land #454 first to really make it useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant