Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 9 additions & 11 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
# Contribution

We would love feedback on our [Roadmap](https://github.com/orgs/katanemo/projects/1) and we welcome contributions to **Plano**!
We would love feedback on our [Roadmap](https://github.com/orgs/katanemo/projects/1) and we welcome contributions to **Plano**!
Whether you're fixing bugs, adding new features, improving documentation, or creating tutorials, your help is much appreciated.

## How to Contribute

### 1. Fork the Repository

Fork the repository to create your own version of **Plano**:
Fork the repository to create your own version of **Plano**:

- Navigate to the [Plano GitHub repository](https://github.com/katanemo/plano).
- Navigate to the [Plano GitHub repository](https://github.com/katanemo/plano).
- Click the "Fork" button in the upper right corner.
- This will create a copy of the repository under your GitHub account.
Expand Down Expand Up @@ -75,7 +78,8 @@ This creates a virtual environment in `.venv` and installs all dependencies.
Optionally, install planoai globally in editable mode:

```bash
$ uv tool install --editable .
$ git clone https://github.com/katanemo/plano.git
$ cd plano
```

Now you can use `planoai` commands from anywhere, or use `uv run planoai` from the `cli` directory.
Expand Down Expand Up @@ -123,19 +127,13 @@ $ uv run pytest -v
Before committing, you can run all pre-commit checks manually:

```bash
$ pre-commit run --all-files
cd plano
cargo test
```

This ensures your code passes all checks before you commit.

### 9. Push Changes and Create a Pull Request

Once your changes are tested and committed:

```bash
$ git push origin <your-branch-name>
```
### 6. Push changes, and create a Pull request

Go back to the original Plano repository, and you should see a "Compare & pull request" button. Click that to submit a Pull Request (PR). In your PR description, clearly explain the changes you made and why they are necessary.
Go back to the original Plano repository, and you should see a "Compare & pull request" button. Click that to submit a Pull Request (PR). In your PR description, clearly explain the changes you made and why they are necessary.

We will review your pull request and provide feedback. Once approved, your contribution will be merged into the main repository!
Expand Down
46 changes: 37 additions & 9 deletions cli/planoai/config_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,21 @@ def validate_and_render_schema():

model_name = model_provider.get("model")
print("Processing model_provider: ", model_provider)
if model_name in model_name_keys:

# Check if this is a wildcard model (provider/*)
is_wildcard = False
if "/" in model_name:
model_name_tokens = model_name.split("/")
if len(model_name_tokens) >= 2 and model_name_tokens[-1] == "*":
is_wildcard = True

if model_name in model_name_keys and not is_wildcard:
raise Exception(
f"Duplicate model name {model_name}, please provide unique model name for each model_provider"
)
model_name_keys.add(model_name)

if not is_wildcard:
model_name_keys.add(model_name)
if model_provider.get("name") is None:
model_provider["name"] = model_name

Expand All @@ -202,7 +212,21 @@ def validate_and_render_schema():
raise Exception(
f"Invalid model name {model_name}. Please provide model name in the format <provider>/<model_id>."
)
provider = model_name_tokens[0]
provider = model_name_tokens[0].strip()

# Check if this is a wildcard (provider/*)
is_wildcard = model_name_tokens[-1].strip() == "*"

# Validate wildcard constraints
if is_wildcard:
if model_provider.get("default", False):
raise Exception(
f"Model {model_name} is configured as default but uses wildcard (*). Default models cannot be wildcards."
)
if model_provider.get("routing_preferences"):
raise Exception(
f"Model {model_name} has routing_preferences but uses wildcard (*). Models with routing preferences cannot be wildcards."
)

# Validate azure_openai and ollama provider requires base_url
if (provider in SUPPORTED_PROVIDERS_WITH_BASE_URL) and model_provider.get(
Expand All @@ -213,7 +237,9 @@ def validate_and_render_schema():
)

model_id = "/".join(model_name_tokens[1:])
if provider not in SUPPORTED_PROVIDERS:

# For wildcard providers, allow any provider name
if not is_wildcard and provider not in SUPPORTED_PROVIDERS:
if (
model_provider.get("base_url", None) is None
or model_provider.get("provider_interface", None) is None
Expand All @@ -227,11 +253,13 @@ def validate_and_render_schema():
f"Please provide provider interface as part of model name {model_name} using the format <provider>/<model_id>. For example, use 'openai/gpt-3.5-turbo' instead of 'gpt-3.5-turbo' "
)

if model_id in model_name_keys:
raise Exception(
f"Duplicate model_id {model_id}, please provide unique model_id for each model_provider"
)
model_name_keys.add(model_id)
# For wildcard models, don't add model_id to the keys since it's "*"
if not is_wildcard:
if model_id in model_name_keys:
raise Exception(
f"Duplicate model_id {model_id}, please provide unique model_id for each model_provider"
)
model_name_keys.add(model_id)

for routing_preference in model_provider.get("routing_preferences", []):
if routing_preference.get("name") in model_usage_name_keys:
Expand Down
2 changes: 1 addition & 1 deletion cli/planoai/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def stop_docker_container(service=PLANO_DOCKER_NAME):


def start_cli_agent(arch_config_file=None, settings_json="{}"):
"""Start a CLI client connected to Arch."""
"""Start a CLI client connected to Plano."""

with open(arch_config_file, "r") as file:
arch_config = file.read()
Expand Down
12 changes: 6 additions & 6 deletions cli/planoai/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def main(ctx, version):
log.info(f"Starting plano cli version: {get_version()}")

if ctx.invoked_subcommand is None:
click.echo("""Arch (The Intelligent Prompt Gateway) CLI""")
click.echo("""Plano (AI-native proxy and dataplane for agentic apps) CLI""")
click.echo(logo)
click.echo(ctx.get_help())

Expand Down Expand Up @@ -121,16 +121,16 @@ def build():
@click.command()
@click.argument("file", required=False) # Optional file argument
@click.option(
"--path", default=".", help="Path to the directory containing arch_config.yaml"
"--path", default=".", help="Path to the directory containing config.yaml"
)
@click.option(
"--foreground",
default=False,
help="Run Arch in the foreground. Default is False",
help="Run Plano in the foreground. Default is False",
is_flag=True,
)
def up(file, path, foreground):
"""Starts Arch."""
"""Starts Plano."""
# Use the utility function to find config file
arch_config_file = find_config_file(path, file)

Expand Down Expand Up @@ -270,15 +270,15 @@ def logs(debug, follow):
help="Additional settings as JSON string for the CLI agent.",
)
def cli_agent(type, file, path, settings):
"""Start a CLI agent connected to Arch.
"""Start a CLI agent connected to Plano.

CLI_AGENT: The type of CLI agent to start (currently only 'claude' is supported)
"""

# Check if plano docker container is running
archgw_status = docker_container_status(PLANO_DOCKER_NAME)
if archgw_status != "running":
log.error(f"archgw docker container is not running (status: {archgw_status})")
log.error(f"plano docker container is not running (status: {archgw_status})")
log.error("Please start plano using the 'planoai up' command.")
sys.exit(1)

Expand Down
6 changes: 3 additions & 3 deletions config/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ cargo test
```

## Local development
- Build docker image for arch gateway. Note this needs to be built once.
- Build docker image for Plano. Note this needs to be built once.
```
$ sh build_filter_image.sh
```
Expand All @@ -27,9 +27,9 @@ $ cargo test
```
$ cargo build --target wasm32-wasip1 --release
```
- Start envoy with arch_config.yaml and test,
- Start envoy with config.yaml and test,
```
$ docker compose -f docker-compose.dev.yaml up archgw
$ docker compose -f docker-compose.dev.yaml up plano
```
- dev version of docker-compose file uses following files that are mounted inside the container. That means no docker rebuild is needed if any of these files change. Just restart the container and chagne will be picked up,
- envoy.template.yaml
Expand Down
94 changes: 94 additions & 0 deletions crates/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading