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

[Task]: Add rules to match by type of request, i.e. chat or FIM #944

Closed
aponcedeleonch opened this issue Feb 5, 2025 · 1 comment
Closed
Assignees

Comments

@aponcedeleonch
Copy link
Contributor

Description

This is a low hanging fruit that can be implemented with our initial set of rules

Additional Context

No response

@aponcedeleonch aponcedeleonch self-assigned this Feb 6, 2025
aponcedeleonch added a commit that referenced this issue Feb 6, 2025
Closes: #885 and #944

This PR introduces the necessary changes for:
1. Muxing to match on a specific filename (`main.py`) or file type (`.py`)
2. Muxing on a specific request type, i.e. chat or FIM

The matching is tightly coupled with the priority of the muxing rules.
A match will occur on the first possible rule.

Example:
Muxing rule 1 -> match all `.py` files -> go to `chat-gpt`
Muxing rule 2 -> match all `.md` files -> go to `ollama`

If in a request we recieve a `README.md` and a `main.py` file the
request will be routed to `chat-gpt` since it's the match with
the highest priority in the list.

To introduce above changes there were some minor changes:
1. Separate FIM detection into its own class. Before it used to be part of `BaseProvider`
2. Detect if a request is FIM or not before calling `process_request` method.

Both of them were necessary in order to re-use the logic to create the
matcher for request type
aponcedeleonch added a commit that referenced this issue Feb 6, 2025
Closes: #885 and #944

This PR introduces the necessary changes for:
1. Muxing to match on a specific filename (`main.py`) or file type (`.py`)
2. Muxing on a specific request type, i.e. chat or FIM

The matching is tightly coupled with the priority of the muxing rules.
A match will occur on the first possible rule.

Example:
Muxing rule 1 -> match all `.py` files -> go to `chat-gpt`
Muxing rule 2 -> match all `.md` files -> go to `ollama`

If in a request we recieve a `README.md` and a `main.py` file the
request will be routed to `chat-gpt` since it's the match with
the highest priority in the list.

To introduce above changes there were some minor changes:
1. Separate FIM detection into its own class. Before it used to be part of `BaseProvider`
2. Detect if a request is FIM or not before calling `process_request` method.

Both of them were necessary in order to re-use the logic to create the
matcher for request type
aponcedeleonch added a commit that referenced this issue Feb 7, 2025
Closes: #885 and #944

This PR introduces the necessary changes for:
1. Muxing to match on a specific filename (`main.py`) or file type (`.py`)
2. Muxing on a specific request type, i.e. chat or FIM

The matching is tightly coupled with the priority of the muxing rules.
A match will occur on the first possible rule.

Example:
Muxing rule 1 -> match all `.py` files -> go to `chat-gpt`
Muxing rule 2 -> match all `.md` files -> go to `ollama`

If in a request we recieve a `README.md` and a `main.py` file the
request will be routed to `chat-gpt` since it's the match with
the highest priority in the list.

To introduce above changes there were some minor changes:
1. Separate FIM detection into its own class. Before it used to be part of `BaseProvider`
2. Detect if a request is FIM or not before calling `process_request` method.

Both of them were necessary in order to re-use the logic to create the
matcher for request type
aponcedeleonch added a commit that referenced this issue Feb 7, 2025
Closes: #885 and #944

This PR introduces the necessary changes for:
1. Muxing to match on a specific filename (`main.py`) or file type (`.py`)
2. Muxing on a specific request type, i.e. chat or FIM

The matching is tightly coupled with the priority of the muxing rules.
A match will occur on the first possible rule.

Example:
Muxing rule 1 -> match all `.py` files -> go to `chat-gpt`
Muxing rule 2 -> match all `.md` files -> go to `ollama`

If in a request we recieve a `README.md` and a `main.py` file the
request will be routed to `chat-gpt` since it's the match with
the highest priority in the list.

To introduce above changes there were some minor changes:
1. Separate FIM detection into its own class. Before it used to be part of `BaseProvider`
2. Detect if a request is FIM or not before calling `process_request` method.

Both of them were necessary in order to re-use the logic to create the
matcher for request type
@JAORMX
Copy link
Contributor

JAORMX commented Feb 11, 2025

This is done

@JAORMX JAORMX closed this as completed Feb 11, 2025
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

2 participants