Skip to content

MOSH-2469: Add adapter management to endpoints SDK and CLI#379

Closed
nikita-smetanin wants to merge 7 commits into
mainfrom
nikita/v1-set-lora-adapter
Closed

MOSH-2469: Add adapter management to endpoints SDK and CLI#379
nikita-smetanin wants to merge 7 commits into
mainfrom
nikita/v1-set-lora-adapter

Conversation

@nikita-smetanin

@nikita-smetanin nikita-smetanin commented May 21, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds LoRA adapter management methods to the Python SDK and CLI, scoped to endpoints.

SDK (src/together/resources/endpoints.py)

Three methods on both EndpointsResource (sync) and AsyncEndpointsResource:

client.endpoints.add_adapter(endpoint_id="...", model_id="endpoint:adapter")
client.endpoints.list_adapters(endpoint_id="...")
client.endpoints.remove_adapter(endpoint_id="...", model_id="endpoint:adapter")

All hit POST/GET/DELETE /v1/endpoints/{endpoint_id}/adapters.

CLI (src/together/lib/cli/api/endpoints/adapters/)

tg endpoints adapters add ENDPOINT_ID MODEL_ID
tg endpoints adapters list ENDPOINT_ID
tg endpoints adapters remove ENDPOINT_ID MODEL_ID

Registered as a subcommand group under endpoints in CLI init.

Changes

  • src/together/resources/endpoints.py — 6 methods (3 sync + 3 async)
  • src/together/lib/cli/__init__.py — adapter subcommand registration
  • src/together/lib/cli/api/endpoints/adapters/add.py, list.py, remove.py

Related PRs

  • DE backend: togethercomputer/together-dedicated-endpoints#480 (merged)
  • OpenAPI: togethercomputer/openapi#300
  • Web UI: togethercomputer/together-web#7795
  • Docs: togethercomputer/mintlify-docs#878
  • Inference routing: togethercomputer/inference-pop#1971 (merged)

Test plan

  • client.endpoints.add_adapter(endpoint_id="x", model_id="ep:adapter") sends POST with {"model_id": "ep:adapter"}
  • client.endpoints.list_adapters(endpoint_id="x") returns list
  • client.endpoints.remove_adapter(endpoint_id="x", model_id="ep:adapter") sends DELETE
  • Async variants work identically
  • CLI commands invoke correct SDK methods

@nikita-smetanin nikita-smetanin changed the title Add set_lora_adapter method to endpoints resource MOSH-2469: Add set_lora_adapter method to endpoints resource May 21, 2026
nikita-smetanin and others added 5 commits June 2, 2026 16:39
client.endpoints.set_lora_adapter(
    adapter_model_name="user/adapter-model",
    endpoint_name="user/endpoint-name",
)

Calls POST /v1/endpoints/lora-adapter with clear field names.
Both sync and async versions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SDK still accepts base_model + adapter_name params, combines them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nikita-smetanin nikita-smetanin changed the title MOSH-2469: Add set_lora_adapter method to endpoints resource MOSH-2469: Add set_lora_adapter, list_adapters, delete_adapter to endpoints resource Jun 2, 2026
@nikita-smetanin nikita-smetanin force-pushed the nikita/v1-set-lora-adapter branch from 9ef8412 to 0986d3e Compare June 2, 2026 16:32
tg endpoints adapters add BASE_MODEL ADAPTER_NAME
tg endpoints adapters list
tg endpoints adapters remove BASE_MODEL ADAPTER_NAME

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nikita-smetanin nikita-smetanin force-pushed the nikita/v1-set-lora-adapter branch from 0986d3e to 2b0b227 Compare June 2, 2026 16:35
SDK: set_lora_adapter -> add_adapter, delete_adapter -> remove_adapter
All methods now take endpoint_id + model_id params.
CLI: updated to match (tg endpoints adapters add/list/remove ENDPOINT_ID ...).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nikita-smetanin nikita-smetanin marked this pull request as ready for review June 12, 2026 11:43
@nikita-smetanin nikita-smetanin changed the title MOSH-2469: Add set_lora_adapter, list_adapters, delete_adapter to endpoints resource MOSH-2469: Add adapter management to endpoints SDK and CLI Jun 12, 2026
@zainhas zainhas self-requested a review June 12, 2026 19:16
cast_to=EndpointListHardwareResponse,
)

def add_adapter(

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.

This should not be manually added. It should be generated by stainless.

@blainekasten

Copy link
Copy Markdown
Contributor

@nikita-smetanin can we close this PR?

SDK methods were added via stlc already, and my agent generated this PR to add CLI commands - can we work with that PR? #401

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.

3 participants