Skip to content

feat(cassandra): add llm_config column to nvcf_api schema - #643

Merged
along-2017 merged 2 commits into
mainfrom
feat/cassandra/add-llm-config-column
Aug 4, 2026
Merged

feat(cassandra): add llm_config column to nvcf_api schema#643
along-2017 merged 2 commits into
mainfrom
feat/cassandra/add-llm-config-column

Conversation

@along-2017

@along-2017 along-2017 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

TL;DR

Adds the llm_config column to functions_v3 in the self-hosted nvcf_api keyspace, so the self-hosted schema matches the managed NVCF API schema. Without it, a self-hosted NVCF API build that carries the LLM invocation config fails against its own database.

Additional Details

The column is added in two places because fresh installs and existing clusters take different paths:

  • 03_init_tables.up.sql is the canonical schema that fresh installs apply.
  • 08_add_llm_config.up.sql is for existing clusters. It uses ADD IF NOT EXISTS, so it is also a no-op on fresh installs that already have the column.

The keyspaces/README.md pin for nvcf_api moves to the managed release that introduced the column. Both READMEs listed the deltas as 04_*, 05_*, 06_*, which was already stale before this change and would be more so with 08 added, so they now say 04_* and later.

For the Reviewer

The pin row in keyspaces/README.md moves from v1.5.1/7a422ff1 to v1.10.0/fcaea0c1, the release that introduced llm_config.

For QA

No QA needed for this change on its own; it takes effect with the migrations image release.

Verified locally: migrations/cassandra/tests/test-execute-sqls.sh passes, and a column-level comparison against the managed schema file shows no remaining differences, with llm_config at the same ordinal position in both. The repo's migration test harness inventories migration files and validates the runner; it has no schema-content assertions, so there is no test to extend for a new column.

Issues

Closes #622

Checklist

  • I am familiar with the Contributing Guidelines.
  • I have signed off my commits for Developer Certificate of Origin (DCO) compliance.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Summary by CodeRabbit

  • New Features

    • Added support for storing language model configuration with functions.
    • Updated the database schema to include the new configuration field.
  • Documentation

    • Clarified migration guidance, including the distinction between schema updates and seeded data.
    • Updated the documented schema source version for improved accuracy.

@along-2017 along-2017 self-assigned this Aug 3, 2026
@along-2017
along-2017 requested review from a team as code owners August 3, 2026 23:06
@coderabbitai

coderabbitai Bot commented Aug 3, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 799fd51c-db78-4f6d-a85e-667655156f89

📥 Commits

Reviewing files that changed from the base of the PR and between 9b5de7a and 7bda1b8.

📒 Files selected for processing (4)
  • migrations/cassandra/README.md
  • migrations/cassandra/keyspaces/README.md
  • migrations/cassandra/keyspaces/nvcf_api/03_init_tables.up.sql
  • migrations/cassandra/keyspaces/nvcf_api/08_add_llm_config.up.sql
🚧 Files skipped from review as they are similar to previous changes (4)
  • migrations/cassandra/keyspaces/nvcf_api/08_add_llm_config.up.sql
  • migrations/cassandra/keyspaces/nvcf_api/03_init_tables.up.sql
  • migrations/cassandra/keyspaces/README.md
  • migrations/cassandra/README.md

📝 Walkthrough

Walkthrough

The Cassandra schema adds llm_config to nvcf_api.functions_v3 for fresh installs and rolling upgrades. Migration documentation now references the updated schema source and uses generic patterns for later migration files.

Changes

nvcf_api schema synchronization

Layer / File(s) Summary
Schema and upgrade migration
migrations/cassandra/keyspaces/nvcf_api/03_init_tables.up.sql, migrations/cassandra/keyspaces/nvcf_api/08_add_llm_config.up.sql
Fresh installs define llm_config TEXT on functions_v3. The numbered migration adds the same column with an idempotent alteration.
Migration documentation
migrations/cassandra/README.md, migrations/cassandra/keyspaces/README.md
The documentation references schema version v1.10.0 and describes later migration files with generic patterns and DDL classifications.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: nvjmcnamee

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title uses the required Conventional Commits format and accurately describes the schema feature.
Linked Issues check ✅ Passed The changes add the column to fresh-install and upgrade migrations and update the schema pin and documentation as required by issue #622.
Out of Scope Changes check ✅ Passed All changes directly support issue #622 and the stated migration, schema synchronization, and documentation objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/cassandra/add-llm-config-column

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@migrations/cassandra/keyspaces/nvcf_api/08_add_llm_config.up.sql`:
- Around line 1-6: Add executable migration coverage for the ALTER TABLE
statement in the migration test suite, validating fresh installation, upgrade
from a schema without llm_config, and repeated execution when llm_config already
exists. If existing tests already exercise these paths, document that coverage
in the PR instead of adding duplicates.

In `@migrations/cassandra/README.md`:
- Line 157: Align migration terminology in both README files: in
migrations/cassandra/README.md at line 157, replace or qualify “DDL deltas” with
“incremental migrations” so it accurately covers all keyspaces; in
migrations/cassandra/keyspaces/README.md at line 46, clarify that
03_init_tables.up.sql is the canonical schema for fresh installations and
subsequent files apply as incremental changes to existing clusters.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ee5f7d40-7dfc-4cc8-9110-4fa2e8c58d85

📥 Commits

Reviewing files that changed from the base of the PR and between 3d76cd5 and 0d0eb06.

📒 Files selected for processing (4)
  • migrations/cassandra/README.md
  • migrations/cassandra/keyspaces/README.md
  • migrations/cassandra/keyspaces/nvcf_api/03_init_tables.up.sql
  • migrations/cassandra/keyspaces/nvcf_api/08_add_llm_config.up.sql

Comment thread migrations/cassandra/keyspaces/nvcf_api/08_add_llm_config.up.sql
Comment thread migrations/cassandra/README.md Outdated
@along-2017
along-2017 removed the request for review from nvaghela-oss August 3, 2026 23:45
Sync the self-hosted nvcf_api keyspace with the managed NVCF API schema,
which stores function-level LLM configuration in functions_v3.llm_config.
Without the column, a self-hosted NVCF API build that carries the LLM
invocation config fails against its own database.

Fresh installs get the column from 03_init_tables.up.sql. Existing clusters
never replay 03, so 08_add_llm_config.up.sql adds it on upgrade using
ADD IF NOT EXISTS, which is a no-op where 03 already created it. With this
change the self-hosted schema matches the managed one column for column.

Closes #622

Signed-off-by: along <along@nvidia.com>
Not every delta is DDL: ess_api/04_* is a data seed. Call the later
numbered files incremental migrations and name the exception.

Signed-off-by: along <along@nvidia.com>
@along-2017
along-2017 force-pushed the feat/cassandra/add-llm-config-column branch from 9b5de7a to 7bda1b8 Compare August 4, 2026 15:04

@sanjay-saxena sanjay-saxena left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@along-2017
along-2017 added this pull request to the merge queue Aug 4, 2026
Merged via the queue into main with commit 23d3d8b Aug 4, 2026
16 checks passed
@along-2017
along-2017 deleted the feat/cassandra/add-llm-config-column branch August 4, 2026 17:51
@balajinvda

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version nvcf-cassandra-migrations-v0.15.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add llm_config column to the self-hosted nvcf_api Cassandra schema

3 participants