From 61f1dcd8f83c5279ddfc030d66291a6df416f430 Mon Sep 17 00:00:00 2001 From: Darshana Date: Mon, 12 Jan 2026 22:51:22 +0530 Subject: [PATCH 1/5] update cli pyproject config file --- CLI_PYPROJECT.toml => highflame_cli/pyproject.toml | 11 ++++------- pyproject.toml | 4 ---- 2 files changed, 4 insertions(+), 11 deletions(-) rename CLI_PYPROJECT.toml => highflame_cli/pyproject.toml (66%) diff --git a/CLI_PYPROJECT.toml b/highflame_cli/pyproject.toml similarity index 66% rename from CLI_PYPROJECT.toml rename to highflame_cli/pyproject.toml index fc1d33e..bf23f89 100644 --- a/CLI_PYPROJECT.toml +++ b/highflame_cli/pyproject.toml @@ -1,18 +1,15 @@ -# This file shows what the future CLI-only package pyproject.toml would look like -# Once CLI is separated into its own package: highflame-cli -# This serves as a reference for the CLI package separation plan - [tool.poetry] name = "highflame-cli" version = "2.0.0" description = "Command-line interface for Highflame - LLM Gateway Management" authors = ["Sharath Rajasekar "] -readme = "README.md" +readme = "../README.md" license = "Apache-2.0" homepage = "https://highflame.com" -repository = "https://github.com/highflame-ai/highflame-cli" +repository = "https://github.com/highflame-ai/highflame-python" +keywords = ["cli", "llm", "gateway", "ai", "command-line"] packages = [ - { include = "highflame_cli" }, + { include = "highflame_cli", from = ".." }, ] [tool.poetry.scripts] diff --git a/pyproject.toml b/pyproject.toml index b5b7422..082daec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,13 +9,9 @@ homepage = "https://highflame.com" repository = "https://github.com/highflame-ai/highflame-python" keywords = ["llm", "gateway", "ai", "api", "routing"] packages = [ - { include = "highflame_cli" }, { include = "highflame" }, ] -[tool.poetry.scripts] -highflame = "highflame_cli.cli:main" - [tool.poetry.dependencies] python = "^3.9" httpx = "^0.27.2" From 93d67bc679e2462650d339610197b27cfe124be8 Mon Sep 17 00:00:00 2001 From: Darshana Date: Mon, 12 Jan 2026 23:01:25 +0530 Subject: [PATCH 2/5] update documentation --- README.md | 30 ++++++++++++++++++++++++++++- highflame_cli/_internal/commands.py | 2 ++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 533278d..5589f95 100644 --- a/README.md +++ b/README.md @@ -17,12 +17,24 @@ Highflame Documentation: [https://docs.highflame.ai/](https://docs.highflame.ai/ ### Installation +**SDK:** + ```bash pip install highflame ``` +**CLI:** + +```bash +pip install highflame-cli +``` + +> **Note:** The CLI package (`highflame-cli`) depends on the SDK package (`highflame`), so installing the CLI will automatically install the SDK as well. + ### Basic Usage +**Using the SDK:** + ```python from highflame import Highflame, Config import os @@ -38,6 +50,22 @@ response = client.query_route( ) ``` +**Using the CLI:** + +```bash +# Authenticate +highflame auth + +# List routes +highflame routes list + +# Create a route +highflame routes create --name my_route --file route.json + +# Get route details +highflame routes get --name my_route +``` + --- ## What Changed @@ -549,7 +577,7 @@ logger.setLevel(logging.INFO) ### CLI Improvements -- [ ] **CLI Separation**: Separate CLI into its own `highflame-cli` package. Create separate repository, package, and PyPI distribution. +- [x] **CLI Separation**: Separate CLI into its own `highflame-cli` package. Package structure separated, ready for independent distribution. - [ ] **CLI Error Messages**: Improve CLI error messages with troubleshooting hints and actionable guidance. diff --git a/highflame_cli/_internal/commands.py b/highflame_cli/_internal/commands.py index 419c884..68dd73f 100644 --- a/highflame_cli/_internal/commands.py +++ b/highflame_cli/_internal/commands.py @@ -1,6 +1,8 @@ import json from pathlib import Path +# CLI imports from the public SDK API - this ensures CLI works as a separate package +# that depends on the highflame SDK package from highflame.client import Highflame from highflame.exceptions import ( BadRequest, From 479c69ae20e5c410f362b381c079989a0909f7b4 Mon Sep 17 00:00:00 2001 From: Darshana Date: Mon, 12 Jan 2026 23:13:21 +0530 Subject: [PATCH 3/5] update commands --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5589f95..d83ec34 100644 --- a/README.md +++ b/README.md @@ -57,13 +57,13 @@ response = client.query_route( highflame auth # List routes -highflame routes list +highflame route list # Create a route -highflame routes create --name my_route --file route.json +highflame route create --name my_route --file route.json # Get route details -highflame routes get --name my_route +highflame route get --name my_route ``` --- @@ -211,7 +211,7 @@ javelin routes list ```bash highflame auth -highflame routes list +highflame route list ``` ### Exception Handling Changes From 04cb82f78a631d6a5f462c3d2eafebe0e416a950 Mon Sep 17 00:00:00 2001 From: Darshana Date: Mon, 12 Jan 2026 23:58:45 +0530 Subject: [PATCH 4/5] refactor: separate SDK and CLI into sdk/ and cli/ directories per Option A structure in v2 branch --- Makefile | 26 ++++++++++++++++--- .../highflame_cli}/__init__.py | 0 .../highflame_cli}/__main__.py | 0 .../highflame_cli}/_internal/__init__.py | 0 .../highflame_cli}/_internal/commands.py | 0 {highflame_cli => cli/highflame_cli}/cli.py | 0 .../highflame_cli}/pyproject.toml | 4 +-- {highflame => sdk/highflame}/__init__.py | 0 .../highflame}/chat_completions.py | 0 {highflame => sdk/highflame}/client.py | 0 {highflame => sdk/highflame}/exceptions.py | 0 .../highflame}/model_adapters.py | 0 {highflame => sdk/highflame}/models.py | 0 {highflame => sdk/highflame}/py.typed | 0 .../highflame}/services/aispm_service.py | 0 .../highflame}/services/gateway_service.py | 0 .../highflame}/services/guardrails_service.py | 0 .../highflame}/services/modelspec_service.py | 0 .../highflame}/services/provider_service.py | 0 .../highflame}/services/route_service.py | 0 .../highflame}/services/secret_service.py | 0 .../highflame}/services/template_service.py | 0 .../highflame}/services/trace_service.py | 0 {highflame => sdk/highflame}/tracing_setup.py | 0 pyproject.toml => sdk/pyproject.toml | 2 +- 25 files changed, 26 insertions(+), 6 deletions(-) rename {highflame_cli => cli/highflame_cli}/__init__.py (100%) rename {highflame_cli => cli/highflame_cli}/__main__.py (100%) rename {highflame_cli => cli/highflame_cli}/_internal/__init__.py (100%) rename {highflame_cli => cli/highflame_cli}/_internal/commands.py (100%) rename {highflame_cli => cli/highflame_cli}/cli.py (100%) rename {highflame_cli => cli/highflame_cli}/pyproject.toml (91%) rename {highflame => sdk/highflame}/__init__.py (100%) rename {highflame => sdk/highflame}/chat_completions.py (100%) rename {highflame => sdk/highflame}/client.py (100%) rename {highflame => sdk/highflame}/exceptions.py (100%) rename {highflame => sdk/highflame}/model_adapters.py (100%) rename {highflame => sdk/highflame}/models.py (100%) rename {highflame => sdk/highflame}/py.typed (100%) rename {highflame => sdk/highflame}/services/aispm_service.py (100%) rename {highflame => sdk/highflame}/services/gateway_service.py (100%) rename {highflame => sdk/highflame}/services/guardrails_service.py (100%) rename {highflame => sdk/highflame}/services/modelspec_service.py (100%) rename {highflame => sdk/highflame}/services/provider_service.py (100%) rename {highflame => sdk/highflame}/services/route_service.py (100%) rename {highflame => sdk/highflame}/services/secret_service.py (100%) rename {highflame => sdk/highflame}/services/template_service.py (100%) rename {highflame => sdk/highflame}/services/trace_service.py (100%) rename {highflame => sdk/highflame}/tracing_setup.py (100%) rename pyproject.toml => sdk/pyproject.toml (98%) diff --git a/Makefile b/Makefile index 29be6bd..00d8c65 100644 --- a/Makefile +++ b/Makefile @@ -19,15 +19,35 @@ test: poetry run pytest tests build: - poetry build + @echo "Building SDK..." + cd sdk && poetry build + @echo "Building CLI..." + cd cli/highflame_cli && poetry build + +build-sdk: + cd sdk && poetry build + +build-cli: + cd cli/highflame_cli && poetry build clean: rm -rf dist/ rm -rf build/ rm -rf *.egg-info/ + rm -rf sdk/dist/ sdk/build/ sdk/*.egg-info/ + rm -rf cli/highflame_cli/dist/ cli/highflame_cli/build/ cli/highflame_cli/*.egg-info/ install: - poetry install + @echo "Installing SDK..." + cd sdk && poetry install + @echo "Installing CLI..." + cd cli/highflame_cli && poetry install + +install-sdk: + cd sdk && poetry install + +install-cli: + cd cli/highflame_cli && poetry install install-wheel: - pip install dist/highflame_sdk-*.whl --force-reinstall + pip install sdk/dist/highflame-*.whl --force-reinstall diff --git a/highflame_cli/__init__.py b/cli/highflame_cli/__init__.py similarity index 100% rename from highflame_cli/__init__.py rename to cli/highflame_cli/__init__.py diff --git a/highflame_cli/__main__.py b/cli/highflame_cli/__main__.py similarity index 100% rename from highflame_cli/__main__.py rename to cli/highflame_cli/__main__.py diff --git a/highflame_cli/_internal/__init__.py b/cli/highflame_cli/_internal/__init__.py similarity index 100% rename from highflame_cli/_internal/__init__.py rename to cli/highflame_cli/_internal/__init__.py diff --git a/highflame_cli/_internal/commands.py b/cli/highflame_cli/_internal/commands.py similarity index 100% rename from highflame_cli/_internal/commands.py rename to cli/highflame_cli/_internal/commands.py diff --git a/highflame_cli/cli.py b/cli/highflame_cli/cli.py similarity index 100% rename from highflame_cli/cli.py rename to cli/highflame_cli/cli.py diff --git a/highflame_cli/pyproject.toml b/cli/highflame_cli/pyproject.toml similarity index 91% rename from highflame_cli/pyproject.toml rename to cli/highflame_cli/pyproject.toml index bf23f89..0a26b6c 100644 --- a/highflame_cli/pyproject.toml +++ b/cli/highflame_cli/pyproject.toml @@ -3,13 +3,13 @@ name = "highflame-cli" version = "2.0.0" description = "Command-line interface for Highflame - LLM Gateway Management" authors = ["Sharath Rajasekar "] -readme = "../README.md" +readme = "../../README.md" license = "Apache-2.0" homepage = "https://highflame.com" repository = "https://github.com/highflame-ai/highflame-python" keywords = ["cli", "llm", "gateway", "ai", "command-line"] packages = [ - { include = "highflame_cli", from = ".." }, + { include = "highflame_cli" }, ] [tool.poetry.scripts] diff --git a/highflame/__init__.py b/sdk/highflame/__init__.py similarity index 100% rename from highflame/__init__.py rename to sdk/highflame/__init__.py diff --git a/highflame/chat_completions.py b/sdk/highflame/chat_completions.py similarity index 100% rename from highflame/chat_completions.py rename to sdk/highflame/chat_completions.py diff --git a/highflame/client.py b/sdk/highflame/client.py similarity index 100% rename from highflame/client.py rename to sdk/highflame/client.py diff --git a/highflame/exceptions.py b/sdk/highflame/exceptions.py similarity index 100% rename from highflame/exceptions.py rename to sdk/highflame/exceptions.py diff --git a/highflame/model_adapters.py b/sdk/highflame/model_adapters.py similarity index 100% rename from highflame/model_adapters.py rename to sdk/highflame/model_adapters.py diff --git a/highflame/models.py b/sdk/highflame/models.py similarity index 100% rename from highflame/models.py rename to sdk/highflame/models.py diff --git a/highflame/py.typed b/sdk/highflame/py.typed similarity index 100% rename from highflame/py.typed rename to sdk/highflame/py.typed diff --git a/highflame/services/aispm_service.py b/sdk/highflame/services/aispm_service.py similarity index 100% rename from highflame/services/aispm_service.py rename to sdk/highflame/services/aispm_service.py diff --git a/highflame/services/gateway_service.py b/sdk/highflame/services/gateway_service.py similarity index 100% rename from highflame/services/gateway_service.py rename to sdk/highflame/services/gateway_service.py diff --git a/highflame/services/guardrails_service.py b/sdk/highflame/services/guardrails_service.py similarity index 100% rename from highflame/services/guardrails_service.py rename to sdk/highflame/services/guardrails_service.py diff --git a/highflame/services/modelspec_service.py b/sdk/highflame/services/modelspec_service.py similarity index 100% rename from highflame/services/modelspec_service.py rename to sdk/highflame/services/modelspec_service.py diff --git a/highflame/services/provider_service.py b/sdk/highflame/services/provider_service.py similarity index 100% rename from highflame/services/provider_service.py rename to sdk/highflame/services/provider_service.py diff --git a/highflame/services/route_service.py b/sdk/highflame/services/route_service.py similarity index 100% rename from highflame/services/route_service.py rename to sdk/highflame/services/route_service.py diff --git a/highflame/services/secret_service.py b/sdk/highflame/services/secret_service.py similarity index 100% rename from highflame/services/secret_service.py rename to sdk/highflame/services/secret_service.py diff --git a/highflame/services/template_service.py b/sdk/highflame/services/template_service.py similarity index 100% rename from highflame/services/template_service.py rename to sdk/highflame/services/template_service.py diff --git a/highflame/services/trace_service.py b/sdk/highflame/services/trace_service.py similarity index 100% rename from highflame/services/trace_service.py rename to sdk/highflame/services/trace_service.py diff --git a/highflame/tracing_setup.py b/sdk/highflame/tracing_setup.py similarity index 100% rename from highflame/tracing_setup.py rename to sdk/highflame/tracing_setup.py diff --git a/pyproject.toml b/sdk/pyproject.toml similarity index 98% rename from pyproject.toml rename to sdk/pyproject.toml index 082daec..7d3c2af 100644 --- a/pyproject.toml +++ b/sdk/pyproject.toml @@ -3,7 +3,7 @@ name = "highflame" version = "2.0.0" description = "Python SDK for Highflame - Enterprise-Scale LLM Gateway" authors = ["Sharath Rajasekar "] -readme = "README.md" +readme = "../README.md" license = "Apache-2.0" homepage = "https://highflame.com" repository = "https://github.com/highflame-ai/highflame-python" From f9614e01a3be2da3e5017b7bb24a163a778a83a2 Mon Sep 17 00:00:00 2001 From: Darshana Date: Tue, 13 Jan 2026 15:26:48 +0530 Subject: [PATCH 5/5] update cli command --- README.md | 14 +++++++------- cli/highflame_cli/cli.py | 4 ++-- cli/highflame_cli/pyproject.toml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index d83ec34..468c788 100644 --- a/README.md +++ b/README.md @@ -54,16 +54,16 @@ response = client.query_route( ```bash # Authenticate -highflame auth +highflame-cli auth # List routes -highflame route list +highflame-cli route list # Create a route -highflame route create --name my_route --file route.json +highflame-cli route create --name my_route --file route.json # Get route details -highflame route get --name my_route +highflame-cli route get --name my_route ``` --- @@ -210,8 +210,8 @@ javelin routes list **v2:** ```bash -highflame auth -highflame route list +highflame-cli auth +highflame-cli route list ``` ### Exception Handling Changes @@ -339,7 +339,7 @@ async with Highflame(config) as client: 5. ✅ Update configuration field names: `javelin_api_key` → `api_key` 6. ✅ Update API endpoint if using custom base URL 7. ✅ Update exception imports: `JavelinClientError` → `ClientError` -8. ✅ Update CLI commands: `javelin` → `highflame` +8. ✅ Update CLI commands: `javelin` → `highflame-cli` 9. ✅ Update cache directory references if any **Note:** HTTP headers are backward compatible - both old and new headers are sent automatically, so no immediate changes needed for header handling. The v2 SDK maintains **full API compatibility** with v1 in terms of functionality - all methods, parameters, and responses remain the same, only naming conventions have changed. diff --git a/cli/highflame_cli/cli.py b/cli/highflame_cli/cli.py index 760dc89..5e117bb 100644 --- a/cli/highflame_cli/cli.py +++ b/cli/highflame_cli/cli.py @@ -69,7 +69,7 @@ def check_permissions(): cache_file = get_cache_file() if not cache_file.exists(): - print("❌ Not authenticated. Please run 'highflame auth' first.") + print("❌ Not authenticated. Please run 'highflame-cli auth' first.") sys.exit(1) try: @@ -93,7 +93,7 @@ def check_permissions(): def main(): # Fetch the version dynamically from the package package_version = importlib.metadata.version( - "highflame-sdk" + "highflame" ) parser = argparse.ArgumentParser( diff --git a/cli/highflame_cli/pyproject.toml b/cli/highflame_cli/pyproject.toml index 0a26b6c..2a476d4 100644 --- a/cli/highflame_cli/pyproject.toml +++ b/cli/highflame_cli/pyproject.toml @@ -13,7 +13,7 @@ packages = [ ] [tool.poetry.scripts] -highflame = "highflame_cli.cli:main" +highflame-cli = "highflame_cli.cli:main" [tool.poetry.dependencies] python = "^3.9"