Skip to content

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Jun 10, 2025

Add an option to pass a custom endpoint URL for inference snippets generation.

snippets.getInferenceSnippets(
	model,
	selectedProvider,
	{
		hfModelId: ...,
		providerId: ...,
		status: "live",
		task: pipeline,
	},
	{
		streaming,
		endpointURL: "http://localhost:8080/v1",
	}
)

cc @gary149

@Wauplin Wauplin requested a review from gary149 June 10, 2025 13:41
@Wauplin Wauplin requested review from Copilot and removed request for julien-c June 10, 2025 13:42
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for specifying a custom endpoint URL when generating inference snippets.

  • Adds an "endpointUrl" option to the snippet generation functions.
  • Updates fixture files and templates for shell, Python, and JavaScript clients.
  • Modifies test cases and documentation to reflect the new option.

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/tasks-gen/snippets-fixtures/* New fixture files using the custom endpoint URL in shell, Python, and JS examples.
packages/tasks-gen/scripts/generate-snippets-fixtures.ts Adds a new test case for the custom endpoint option.
packages/inference/src/snippets/templates/* Updates templates across languages to conditionally include the custom endpoint URL.
packages/inference/src/snippets/getInferenceSnippets.ts Integrates the endpointUrl option into snippet request arguments and token replacement logic.
packages/inference/README.md Updates documentation to showcase usage of the new endpoint URL option.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@Wauplin Wauplin merged commit 62137bd into main Jun 10, 2025
6 checks passed
@Wauplin Wauplin deleted the inference-snippets-endpoint-url branch June 10, 2025 15:58
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.

4 participants