Skip to content

Add embedding profile size aliases (small/base/large)#10

Merged
M9nx merged 20 commits intomainfrom
copilot/allow-model-selection-option
Apr 1, 2026
Merged

Add embedding profile size aliases (small/base/large)#10
M9nx merged 20 commits intomainfrom
copilot/allow-model-selection-option

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

  • Centralizes CLI profile choices in the registry so aliases and allowed options stay in sync (including default/quality/code).
  • Expands codexa init --profile help text to mention both size and named aliases now accepted.
  • Updates codexa models profiles guidance to show canonical profiles with a concise alias note.
  • Parameterizes the init profile alias test to cover all aliases uniformly and assert resolved profiles via output/config.

Copilot AI assigned Copilot and M9nx Apr 1, 2026
Copilot AI linked an issue Apr 1, 2026 that may be closed by this pull request
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/4f105fb2-0732-4ca7-9d69-3c45b6efed46

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Copilot AI changed the title [WIP] Add option for users to select embedding model Add embedding profile size aliases (small/base/large) Apr 1, 2026
Copilot finished work on behalf of M9nx April 1, 2026 05:01
Copilot AI requested a review from M9nx April 1, 2026 05:01
@M9nx M9nx requested a review from Copilot April 1, 2026 05:08
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds size-oriented embedding profile aliases to make codexa init --profile easier to choose on constrained hardware, while keeping resolution consistent via the model registry.

Changes:

  • Extend embedding profile alias mapping to include base → balanced and large → precise (alongside small → fast).
  • Update codexa init --profile option validation/help text to accept and describe the new aliases.
  • Add docs and CLI tests covering the new alias selections.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
semantic_code_intelligence/tests/test_cli.py Adds a new CLI test ensuring small/base/large map to the expected underlying profiles.
semantic_code_intelligence/embeddings/model_registry.py Extends PROFILE_ALIASES to include base and large aliases.
semantic_code_intelligence/cli/commands/init_cmd.py Expands Click --profile choices and updates help text to mention aliases.
README.md Documents the new alias mappings in the init section.
docs/guide/quickstart.md Adds a quickstart note listing the alias mappings.

Comment thread semantic_code_intelligence/tests/test_cli.py Outdated
@M9nx
Copy link
Copy Markdown
Owner

M9nx commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Added explicit output checks so the base alias must resolve and emit the profile message; test now fails if resolution silently falls back (d5126fc).

Copilot AI and others added 3 commits April 1, 2026 05:16
Copilot finished work on behalf of M9nx April 1, 2026 05:19
@M9nx M9nx marked this pull request as ready for review April 1, 2026 05:19
@M9nx M9nx requested a review from Copilot April 1, 2026 05:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread semantic_code_intelligence/cli/commands/init_cmd.py
Comment thread semantic_code_intelligence/tests/test_cli.py Outdated
@M9nx
Copy link
Copy Markdown
Owner

M9nx commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Updated init CLI to consume centralized profile choices from the registry (including aliases) and parameterized the profile alias test for easier future additions; covered in 1752a7d.

Copilot AI and others added 2 commits April 1, 2026 05:27
Copilot AI and others added 2 commits April 1, 2026 05:28
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/570de38e-a8b7-47cc-87a0-675875c17a17

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/570de38e-a8b7-47cc-87a0-675875c17a17

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
@M9nx M9nx requested a review from Copilot April 1, 2026 05:29
Copilot AI and others added 2 commits April 1, 2026 05:29
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/570de38e-a8b7-47cc-87a0-675875c17a17

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/570de38e-a8b7-47cc-87a0-675875c17a17

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Copilot AI and others added 5 commits April 1, 2026 05:30
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/570de38e-a8b7-47cc-87a0-675875c17a17

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/570de38e-a8b7-47cc-87a0-675875c17a17

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/570de38e-a8b7-47cc-87a0-675875c17a17

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/570de38e-a8b7-47cc-87a0-675875c17a17

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment on lines +144 to +146
CORE_PROFILES: list[str] = ["fast", "balanced", "precise"]
ALL_PROFILE_NAMES = set(PROFILE_ALIASES.keys()) | set(MODEL_PROFILES.keys())
CLI_PROFILE_CHOICES: list[str] = [
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

all_profile_names is a module-level constant used to build CLI_PROFILE_CHOICES, but it’s named like a local variable while surrounding constants are uppercase (PROFILE_ALIASES, CORE_PROFILES, CLI_PROFILE_CHOICES). Renaming it to ALL_PROFILE_NAMES (or inlining it) would keep naming consistent and make it clearer this is part of the public/constant configuration.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

@copilot apply changes based on this feedback

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed the profile-name union constant to ALL_PROFILE_NAMES and kept it alongside the other registry constants; changes in f1cf67d.

type=click.Choice(CLI_PROFILE_CHOICES, case_sensitive=False),
default=None,
help="Embedding model profile: fast (tiny, low RAM), balanced (default), precise (code-optimised).",
help="Embedding model profile: fast (low RAM), balanced (default), or precise (code-optimized). Size aliases (small/base/large) are supported.",
Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

The --profile option now accepts all values in CLI_PROFILE_CHOICES, which (via PROFILE_ALIASES) includes aliases like default, quality, and code in addition to small/base/large. The help text only mentions the size aliases, so CLI help/error output can suggest values that aren’t described. Either update the help text to mention the full alias set, or narrow CLI_PROFILE_CHOICES to only the intended user-facing aliases.

Suggested change
help="Embedding model profile: fast (low RAM), balanced (default), or precise (code-optimized). Size aliases (small/base/large) are supported.",
help=(
"Embedding model profile: fast (low RAM), balanced (default), or precise (code-optimized). "
"Size aliases (small/base/large) and named aliases (default, quality, code) are supported."
),

Copilot uses AI. Check for mistakes.
Comment on lines 220 to 222
print_info(f"Use: codexa init --profile <{'|'.join(CLI_PROFILE_CHOICES)}>")


Copy link

Copilot AI Apr 1, 2026

Choose a reason for hiding this comment

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

Printing Use: codexa init --profile <...> by joining CLI_PROFILE_CHOICES can produce a long/cryptic list (e.g., including default|quality|code alongside canonical profiles), which may be confusing since models profiles itself only displays the canonical profiles. Consider formatting this as fast|balanced|precise plus a short note listing the supported aliases/mappings, rather than dumping every accepted token.

Suggested change
print_info(f"Use: codexa init --profile <{'|'.join(CLI_PROFILE_CHOICES)}>")
canonical_names = sorted({p.name for p in MODEL_PROFILES.values()})
print_info(f"Use: codexa init --profile <{'|'.join(canonical_names)}>")
# Show a concise note about additional aliases, if any, without dumping every token inline.
alias_map: dict[str, set[str]] = {}
for choice in CLI_PROFILE_CHOICES:
try:
profile = resolve_profile(choice)
except Exception:
# Be defensive: ignore any unexpected tokens rather than breaking CLI output.
continue
if profile is None:
continue
if choice == profile.name:
# Skip canonical names; we already show them above.
continue
alias_map.setdefault(profile.name, set()).add(choice)
if alias_map:
alias_parts = []
for name in sorted(alias_map.keys()):
aliases = "/".join(sorted(alias_map[name]))
alias_parts.append(f"{name} ({aliases})")
print_info(f"Aliases also supported: {', '.join(alias_parts)}")

Copilot uses AI. Check for mistakes.
@M9nx
Copy link
Copy Markdown
Owner

M9nx commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/137ecca9-e42d-46a5-84a8-b3f5282baf82

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 1, 2026

@copilot apply changes based on the comments in this thread

Expanded the init help text to mention all supported aliases and updated models profiles guidance to show canonical profiles with a concise alias note (see f1cf67d).

Agent-Logs-Url: https://github.com/M9nx/CodexA/sessions/137ecca9-e42d-46a5-84a8-b3f5282baf82

Co-authored-by: M9nx <90654832+M9nx@users.noreply.github.com>
Copilot finished work on behalf of M9nx April 1, 2026 05:40
Copy link
Copy Markdown
Owner

@M9nx M9nx left a comment

Choose a reason for hiding this comment

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

Seems good !

@M9nx M9nx merged commit c8b84cd into main Apr 1, 2026
7 checks passed
@M9nx M9nx added bug Something isn't working enhancement New feature or request help wanted Extra attention is needed labels Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow users to select embedding model

3 participants