Skip to content
Open
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
2 changes: 1 addition & 1 deletion codeflash/api/aiservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def __init__(self) -> None:
self.headers = {"Authorization": f"Bearer {get_codeflash_api_key()}", "Connection": "close"}
self.llm_call_counter = count(1)
self.is_local = self.base_url == "http://localhost:8000"
self.timeout: float | None = None if self.is_local else 90
self.timeout: float | None = 300 if self.is_local else 90

def get_next_sequence(self) -> int:
"""Get the next LLM call sequence number."""
Expand Down
10 changes: 10 additions & 0 deletions codeflash/cli_cmds/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import os
import sys
from argparse import SUPPRESS, ArgumentParser, Namespace
from pathlib import Path
Expand Down Expand Up @@ -107,6 +108,12 @@ def parse_args() -> Namespace:
action="store_true",
help="(Deprecated) Async function optimization is now enabled by default. This flag is ignored.",
)
parser.add_argument(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this over the env var method?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't really want to make this part of the user interface for codeflash cli

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A/B testing, i want the flexibility so that I don't have to touch my env vars

"--server",
type=str,
choices=["local", "prod"],
help="AI service server to use: 'local' for localhost:8000, 'prod' for app.codeflash.ai",
)

args, unknown_args = parser.parse_known_args()
sys.argv[:] = [sys.argv[0], *unknown_args]
Expand All @@ -121,6 +128,9 @@ def process_and_validate_cmd_args(args: Namespace) -> Namespace:
)
from codeflash.code_utils.github_utils import require_github_app_or_exit

if args.server:
os.environ["CODEFLASH_AIS_SERVER"] = args.server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can go wrong because there is no validation of user input to be only prod/local

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's meant to be for internal use only so I think we'll be ok


is_init: bool = args.command.startswith("init") if args.command else False
if args.verbose:
logging_config.set_level(logging.DEBUG, echo_setting=not is_init)
Expand Down
Loading