custom models CRUD for SDK - #10
Open
Sofistika wants to merge 1 commit into
Open
Conversation
tdurey-lighton
self-requested a review
August 20, 2026 14:47
tdurey-lighton
approved these changes
Aug 20, 2026
tdurey-lighton
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, but we need to wait for the activation on the feature on prod
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.