# AI use cases for Osw (yinxulai/osw)

Repo: [yinxulai/osw](https://github.com/yinxulai/osw) | Use cases: 4 | Page: https://dedupedai.com/use-cases/yinxulai-osw/

OSW is a local proxy that puts all your LLM channels behind one address and fails over to the next channel when one goes down.

This file holds every use case of this repo. Each one starts with a "## " heading and ends with its URL.

- Keep AI coding tools running when one provider fails: https://dedupedai.com/use-cases/yinxulai-osw/keep-coding-tools-running-through-provider-outages/
- Compare provider speed and reliability from request logs: https://dedupedai.com/use-cases/yinxulai-osw/see-which-provider-actually-serves-each-request/
- Send hard requests to a strong model and easy ones to a cheap model: https://dedupedai.com/use-cases/yinxulai-osw/route-requests-to-channel-groups-by-rule/
- Fix a provider's header or field quirk with rewrite rules: https://dedupedai.com/use-cases/yinxulai-osw/fix-provider-quirks-without-writing-code/

## How to keep AI coding tools running when one provider fails with Osw

Repo: [yinxulai/osw](https://github.com/yinxulai/osw) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Register several channels in OSW so your client keeps getting answers when one provider breaks.

**Who it is for:** A developer whose daily coding assistant stops whenever one provider has an outage, rate limit, or exhausted quota.

**The problem:** Each AI tool is configured against a single provider. When that provider returns errors or times out, you must manually switch keys, URLs, and model names in every tool.

**The outcome:** Your tools point at one local address, and OSW moves each request to the next channel in your queue when a channel fails.

### Steps

1. Download the installer for your platform from the latest release on the OSW GitHub page and install it.
2. Open Model Management, choose New provider, and enter the name, API key, timeout, and default endpoint for each provider you use.
3. Add the real model IDs under each provider and tick the protocols each model supports.
4. Open Logical Models, drag the models into the order you want them tried, and switch off any you want to skip.
5. In your AI client, set the base URL to http://127.0.0.1:9300/v1 for OpenAI compatible tools, or http://127.0.0.1:9300 for Anthropic clients.
6. Run `curl http://127.0.0.1:9300/v1/models` to confirm the service is alive.

### Prompt to paste into your agent

```text
Using the OSW repo at yinxulai/osw, configure a local proxy with the channels for <provider-list>, then point <client-name> at http://127.0.0.1:9300/v1. Expected output: a list of model names from `curl http://127.0.0.1:9300/v1/models`. Verify that the models endpoint returns a response before reporting success.
```

### Caveat

Failover only moves a request to the next channel in your queue, and a response that has already started streaming is aborted rather than finished by another channel.

Risk, credentials: OSW stores the API keys for every channel you add, so only enter keys for accounts you are allowed to use through this proxy.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/yinxulai-osw/keep-coding-tools-running-through-provider-outages/

## How to compare provider speed and reliability from request logs with Osw

Repo: [yinxulai/osw](https://github.com/yinxulai/osw) | Difficulty: Beginner | Time: 15 minutes | Basis: From the README

Use per-request logs and analytics to see which channel answered and how fast it responded.

**Who it is for:** A developer or team lead deciding which providers and models deserve to sit at the top of the queue.

**The problem:** Provider claims about speed and uptime rarely match what your own traffic experiences, and most clients do not show which upstream served a request.

**The outcome:** You can see the provider and model that served each request, the attempt that succeeded, first-token time, tokens per second, and failure reasons, then reorder channels based on that data.

### Steps

1. Route your normal AI client traffic through the OSW address for a few days of ordinary use.
2. Open Request Logs and expand a row to read the full execution detail and raw usage for a request.
3. Open Analytics and review success rate, latency, TTFT, TPS, cache hits, model ranking, and failure reasons.
4. Open Logical Models and read the last success time, consecutive failure count, TPS, and TTFT for each model.
5. Drag the best-performing models to the top of the queue and switch off the ones that fail most often.

### Prompt to paste into your agent

```text
Using the OSW repo at yinxulai/osw, review the request logs and analytics for the models in <logical-model-name>. Expected output: a ranked list of models with success rate, TTFT, and TPS. Verify that each figure comes from the Analytics screen before listing it.
```

### Caveat

The request logs and analytics exist only after traffic has passed through OSW, so the comparison needs a few days of real use to be meaningful.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/yinxulai-osw/see-which-provider-actually-serves-each-request/

## How to send hard requests to a strong model and easy ones to a cheap model with Osw

Repo: [yinxulai/osw](https://github.com/yinxulai/osw) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Use Smart Routing to split traffic into channel groups by model name, client, or request complexity.

**Who it is for:** A developer or operator who pays for a strong model and wants routine requests to use a cheaper channel automatically.

**The problem:** Every request goes to the same default channel, so simple requests use an expensive model and hard requests may not get the stronger one.

**The outcome:** Requests land in different channel groups according to a rule table or a workflow graph, and each saved policy can be rolled back to an earlier version.

### Steps

1. Set up at least two logical models in OSW with different strengths and costs.
2. Open Smart Routing and choose between Workflow graph and Rule table in the page header.
3. In Workflow graph, drop the LLM request complexity policy onto the canvas, or in Rule table, add one rule per condition with its landing channel.
4. Save the policy and send a few test requests of different difficulty through the OSW address.
5. Check Request Logs to confirm which channel served each request, then adjust the rules if the split is wrong.

### Prompt to paste into your agent

```text
Using the OSW repo at yinxulai/osw, build a Smart Routing policy that sends requests matching <condition> to <channel-group> and everything else to the fallback. Expected output: a saved policy and request log rows showing the chosen channel for each test request. Verify with at least one test request per group before reporting the policy as working.
```

### Caveat

The complexity policy relies on a model to judge difficulty, so it adds a call before routing and its judgments need checking against your own requests.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/yinxulai-osw/route-requests-to-channel-groups-by-rule/

## How to fix a provider's header or field quirk with rewrite rules with Osw

Repo: [yinxulai/osw](https://github.com/yinxulai/osw) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Add, drop, or pin request fields for one provider using rewrite rules and a built-in test check.

**Who it is for:** A developer whose provider rejects requests unless a header is set or a field has a specific value.

**The problem:** Some providers need a custom User-Agent, reject a header a client sends, or expect a fixed parameter value, and the client tool offers no setting for this.

**The outcome:** A request rewrite rule changes the outgoing request for that provider only, and the editor's test case confirms the change before you rely on it.

### Steps

1. Open Request Rewrite and pick a template behind New rule, or start a blank rule.
2. Set the change you need, such as adding a User-Agent header, dropping a header, or pinning a field to a value.
3. Run the test case in the editor to confirm the rewritten request looks correct.
4. Save the rule and send a request through the OSW address to the affected provider.
5. Check Request Logs to confirm the provider accepted the request.

### Prompt to paste into your agent

```text
Using the OSW repo at yinxulai/osw, create a request rewrite rule that <change> for the provider <provider-name>. Expected output: a saved rule and a successful request in Request Logs. Verify that the editor test case passes before saving.
```

### Caveat

Rewrite rules change outgoing requests, so a wrong rule can cause a provider to reject every request it touches until the rule is fixed or removed.

Disclaimer: Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk. Full text: https://dedupedai.com/disclaimer/

URL: https://dedupedai.com/use-cases/yinxulai-osw/fix-provider-quirks-without-writing-code/
