# AI use cases for Baize (Xu123-Bob/Baize)

Repo: [Xu123-Bob/Baize](https://github.com/Xu123-Bob/Baize) | Use cases: 4 | Page: https://dedupedai.com/use-cases/xu123-bob-baize/

Baize is an open-source coding agent CLI, written in Python, that talks to several LLM backends, redacts sensitive data before it reaches the model, and can drive SPSS and SQL databases through MCP servers.

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

- Refactor code across a whole repo from one plain-language request: https://dedupedai.com/use-cases/xu123-bob-baize/bulk-refactor-repo-code-from-plain-language/
- Analyze SPSS .sav data files by describing the analysis: https://dedupedai.com/use-cases/xu123-bob-baize/analyze-spss-sav-files-in-natural-language/
- Query a SQL database while redacting personal data before the LLM sees it: https://dedupedai.com/use-cases/xu123-bob-baize/query-sql-database-with-pii-redaction/
- Run Baize on a local Ollama model so data never leaves your machine: https://dedupedai.com/use-cases/xu123-bob-baize/run-private-analysis-on-a-local-ollama-model/

## How to refactor code across a whole repo from one plain-language request with Baize

Repo: [Xu123-Bob/Baize](https://github.com/Xu123-Bob/Baize) | Difficulty: Intermediate | Time: 30 minutes | Basis: From the README

Describe a code change in plain language and let Baize find and edit every matching file in the repository.

**Who it is for:** A developer maintaining a Python project who needs the same change made in many files, such as swapping one HTTP library for another.

**The problem:** Finding and editing every usage of a library by hand is slow and easy to get wrong.

**The outcome:** Baize searches the repo, edits the matching files, and reports what it changed.

### Steps

1. `pip install https://github.com/Xu123-Bob/Baize.git`
2. Open `~/.baize/config.toml`, set `active_provider` to the backend you have a key for, and save your key in `~/.baize/.env`. (inferred, check the README)
3. Change into the repository you want to edit, then run `baize`. (inferred, check the README)
4. At the `>>> Decree:` prompt, type: Find all places in this repository that use requests and change them to httpx
5. Run your tests or a `grep` for the old library name to confirm the change.

### Prompt to paste into your agent

```text
Using the Baize CLI from the Xu123-Bob/Baize repo, run the instruction 'Find all places in <repo-path> that use requests and change them to httpx' inside <repo-path>. Expected output: a list of edited files. Verify that no file in <repo-path> still imports requests.
```

### Caveat

Baize needs a working LLM backend, so you must add an API key or run Ollama before the first decree works.

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/xu123-bob-baize/bulk-refactor-repo-code-from-plain-language/

## How to analyze SPSS .sav data files by describing the analysis with Baize

Repo: [Xu123-Bob/Baize](https://github.com/Xu123-Bob/Baize) | Difficulty: Advanced | Time: 1 hour | Basis: From the README

Point Baize at an SPSS data file and ask for summaries or statistics in plain language.

**Who it is for:** A researcher or analyst with a survey or study dataset stored as an SPSS .sav file.

**The problem:** Running SPSS analyses requires learning the menus or syntax for each new question.

**The outcome:** Baize reads the .sav file through the SPSS MCP server and answers analysis questions in the terminal.

### Steps

1. `pip install https://github.com/Xu123-Bob/Baize.git`
2. `pip install -r requirements-data.txt`
3. Install IBM SPSS Statistics (versions 20 to 31) with a valid license, then set the `SPSS_INSTALL_PATH` environment variable to the SPSS install folder. Full statistical analysis is mainly supported on Windows; on Linux or macOS only file mode is available.
4. `baize`
5. At the `>>> Decree:` prompt, describe the file and the analysis you want, for example reading the variable list and a descriptive summary.

### Prompt to paste into your agent

```text
Using the Baize CLI from the Xu123-Bob/Baize repo, ask it to open <path-to-sav-file> and produce a descriptive summary of its variables. Expected output: a variable list and summary statistics. Verify that the variable names in the output match the names shown in the file metadata.
```

### Caveat

Full SPSS statistical analysis needs a locally installed and licensed IBM SPSS Statistics, and on Linux or macOS the tool only supports file mode.

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/xu123-bob-baize/analyze-spss-sav-files-in-natural-language/

## How to query a SQL database while redacting personal data before the LLM sees it with Baize

Repo: [Xu123-Bob/Baize](https://github.com/Xu123-Bob/Baize) | Difficulty: Advanced | Time: 1.5 hours | Basis: From the README

Ask questions about a PostgreSQL, MySQL, SQL Server, Oracle, or Dameng database with privacy protection on.

**Who it is for:** A data analyst who needs answers from a company database that contains phone numbers, emails, or ID numbers.

**The problem:** Sending raw database rows with personal data to a cloud LLM exposes that data.

**The outcome:** Baize queries the database through the RDBMS MCP server, redacts personal fields before the LLM sees them, and restores the original text in its answers.

### Steps

1. `pip install -r requirements-data.txt`
2. For SQL Server only: install Microsoft ODBC Driver 18 for SQL Server at the system level, because `pyodbc` alone is not enough.
3. Add your database connection to the MCP server settings; the README names the MCP protocol but does not show the exact config format, so check the project documentation. (inferred, check the README)
4. `baize`
5. At the `>>> Decree:` prompt, type `/privacy` to confirm privacy protection is on, then ask your question about the database.

### Prompt to paste into your agent

```text
Using the Baize CLI from the Xu123-Bob/Baize repo with privacy protection on, ask it to count rows in <table-name> of <database-name> and summarize the result. Expected output: a row count and a short summary with no raw personal values. Verify that no phone number or email appears in the LLM-facing prompt log.
```

### Caveat

The README does not show how to configure the RDBMS MCP server, so the connection step must be confirmed from the project documentation.

Risk, credentials: Database connection details and passwords are required, and the README only describes where the LLM API keys are stored in `.env`, so confirm where database credentials are kept before you add them.

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/xu123-bob-baize/query-sql-database-with-pii-redaction/

## How to run Baize on a local Ollama model so data never leaves your machine with Baize

Repo: [Xu123-Bob/Baize](https://github.com/Xu123-Bob/Baize) | Difficulty: Intermediate | Time: 45 minutes | Basis: From the README

Use a local Ollama model as the backend for coding or analysis on sensitive material at zero API cost.

**Who it is for:** A developer or analyst working with confidential code or data who does not want to send it to a cloud API.

**The problem:** Cloud LLM backends require sending prompts to a remote provider, which may be unacceptable for sensitive work.

**The outcome:** Baize runs its agent loop against a local model served by Ollama, with no API key needed.

### Steps

1. Install Ollama from https://ollama.com/download
2. `ollama pull qwen2.5:7b`
3. `ollama serve`
4. Open `~/.baize/config.toml` and set `active_provider = "ollama"`, then save the file. (inferred, check the README)
5. `baize`

### Prompt to paste into your agent

```text
Using the Baize CLI from the Xu123-Bob/Baize repo with active_provider set to ollama, ask it to summarize the files in <project-path>. Expected output: a summary generated by the local qwen2.5:7b model. Verify that Ollama is serving on localhost:11434 before the decree runs.
```

### Caveat

A 7B local model is less capable than the cloud backends, and the README recommends qwen2.5:7b for strong Chinese while listing llama3.1:8b and deepseek-r1:7b as alternatives.

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/xu123-bob-baize/run-private-analysis-on-a-local-ollama-model/
