Skip to content

Conversation

cdoern
Copy link
Contributor

@cdoern cdoern commented Sep 18, 2025

What does this PR do?

now that we consolidated the providerspec types and got rid of AdapterSpec, adjust external.md

BREAKING CHANGE: external providers must update their get_provider_spec function to use RemoteProviderSpec properly

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 18, 2025
Copy link
Collaborator

@leseb leseb left a comment

Choose a reason for hiding this comment

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

Thanks for the followup! Please also update docs/source/providers/external/external-providers-guide.md.

- aiohttp
config_class: llama_stack_ollama_provider.config.OllamaImplConfig
module: llama_stack_ollama_provider
adapter_type: custom_ollama
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we actually update the doc to refer to the usage of the module field instead of the custom YAML files?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed everything around the external_providers_dir method. However, I think we should keep the yaml examples as they are useful for folks when writing their get_provider_spec functions since that now uses the RemoteProviderspec and InlineProviderSpec constructors.

Comment on lines 209 to 250
### Example using `external_providers_dir`: Custom Ollama Provider

Here's a complete example of creating and using a custom Ollama provider:

1. First, create the provider package:

```bash
mkdir -p llama-stack-provider-ollama
cd llama-stack-provider-ollama
git init
uv init
```

2. Edit `pyproject.toml`:

```toml
[project]
name = "llama-stack-provider-ollama"
version = "0.1.0"
description = "Ollama provider for Llama Stack"
requires-python = ">=3.12"
dependencies = ["llama-stack", "pydantic", "ollama", "aiohttp"]
```

3. Create the provider specification:

```yaml
# ~/.llama/providers.d/remote/inference/custom_ollama.yaml
adapter:
adapter_type: custom_ollama
pip_packages: ["ollama", "aiohttp"]
config_class: llama_stack_provider_ollama.config.OllamaImplConfig
module: llama_stack_provider_ollama
api_dependencies: []
optional_api_dependencies: []
```

4. Install the provider:

```bash
uv pip install -e .
```
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe this part is still relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

let me add parts of this back.

I removed due to the ~/.llama/providers.d/remote/inference/custom_ollama.yaml part. the rest needs to be added back, sorry thanks for catching this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

unaddressed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added back specifically 4. Install the provider: if this is what you mean.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be good now

@cdoern
Copy link
Contributor Author

cdoern commented Sep 24, 2025

@leseb let me know how this looks!

@leseb
Copy link
Collaborator

leseb commented Sep 25, 2025

@cdoern cdoern force-pushed the external-docs branch 2 times, most recently from 6548af6 to f261705 Compare October 2, 2025 20:18
@leseb
Copy link
Collaborator

leseb commented Oct 3, 2025

@cdoern one more rebase :)

now that we consolidated the providerspec types and got rid of `AdapterSpec`, adjust external.md and external-provider-guide.md

external_providers_guide.md specifically needed some updates around the proper fields required in a ProviderSpec beyond the changes in this PR.

BREAKING CHANGE: external providers must update their `get_provider_spec` function to use `RemoteProviderSpec` properly

Signed-off-by: Charlie Doern <[email protected]>
@cdoern
Copy link
Contributor Author

cdoern commented Oct 3, 2025

@leseb that should do it!

@leseb leseb merged commit a09e30b into llamastack:main Oct 3, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants