Skip to content

feat: add provider management support to sdk #72

@nouamanecodes

Description

@nouamanecodes

What I'm trying to do

I need to manage LLM providers programmatically through the SDK - registering custom providers like local Ollama instances and getting lettactl to manage these as well

What I tried

I started implementing this manually:

  • Created src/resources/providers/providers.ts with the Providers class and types
  • Created src/resources/providers/index.ts for exports
  • Updated src/resources/index.ts to export providers
  • Updated src/client.ts to register the resource

Then I realized the SDK is Stainless-generated, so manual changes would just get overwritten or cause merge conflicts😅

The issue

The server's OpenAPI spec includes these endpoints, but the SDK doesn't expose them. Looks like the Stainless spec just needs to be synced.

What I'd like to see

const client = new Letta({ baseURL: 'http://localhost:8283' });

const provider = await client.providers.create({
  name: 'local-ollama',
  provider_type: 'ollama',
  api_key: 'not-needed-for-ollama',
  base_url: 'http://localhost:11434'
});

const providers = await client.providers.list();

await client.providers.delete(provider.id);

Related

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions