Skip to content

custom models CRUD for SDK - #10

Open
Sofistika wants to merge 1 commit into
lightonai:mainfrom
Sofistika:feat/company-models
Open

custom models CRUD for SDK#10
Sofistika wants to merge 1 commit into
lightonai:mainfrom
Sofistika:feat/company-models

Conversation

@Sofistika

Copy link
Copy Markdown

Adds CompanyModel, an SDK resource for managing a company's custom LLM registrations.

Until now the SDK had no way to reach them: the only way to use one was to hardcode its technical name (custom-{company_id}-{uuid}) into an ask() call. There was no way to discover what was registered, inspect it, or change it without leaving Python. CompanyModel covers the full lifecycle against /api/v3/company/models: list, get, create, save and delete. It follows the same active-record pattern as ApiKey, so it inherits list/get/refresh/delete and adds create() and save(). Reading is open to any member of the company; creating, updating and deleting require the Company Admin role and raise PermissionDeniedError otherwise.

Three server behaviours are handled explicitly: litellm_model, endpoint and api_key are fixed at creation (the API ignores attempts to change them rather than rejecting them), api_key is write-only and never returned, and the collection endpoint returns a bare array rather than a paginated envelope.

@tdurey-lighton
tdurey-lighton self-requested a review August 20, 2026 14:47

@tdurey-lighton tdurey-lighton left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, but we need to wait for the activation on the feature on prod

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants