diff --git a/pom.xml b/pom.xml
index 69f1e5d35..c2a7ef0ce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,6 +17,7 @@
spring-ai-openaispring-ai-azure-openaispring-ai-ollama
+ spring-ai-huggingfacespring-ai-spring-boot-autoconfigurespring-ai-spring-boot-starters/spring-ai-starter-openaispring-ai-spring-boot-starters/spring-ai-starter-azure-openai
@@ -71,8 +72,8 @@
UTF-817
-
- 3.1.2
+
+ 3.1.34.0.20.16.01.0.0-beta.3
diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/concepts.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/concepts.adoc
index ae61940a7..7178cbc40 100644
--- a/spring-ai-docs/src/main/antora/modules/ROOT/pages/concepts.adoc
+++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/concepts.adoc
@@ -191,7 +191,7 @@ One approach involves presenting both the user's request and the AI model's resp
Furthermore, leveraging the information stored in the Vector Database as supplementary data can enhance the evaluation process, aiding in the determination of response relevance.
-The Spring AI project currenlty provides some very basic examples of how you can evaluate the responses in the form of prompts to include in a JUnit test.
+The Spring AI project currently provides some very basic examples of how you can evaluate the responses in the form of prompts to include in a JUnit test.
diff --git a/spring-ai-docs/src/main/antora/modules/ROOT/pages/providers/huggingface/index.adoc b/spring-ai-docs/src/main/antora/modules/ROOT/pages/providers/huggingface/index.adoc
new file mode 100644
index 000000000..c7e19e3af
--- /dev/null
+++ b/spring-ai-docs/src/main/antora/modules/ROOT/pages/providers/huggingface/index.adoc
@@ -0,0 +1,15 @@
+= HuggingFace
+
+== Introduction
+One of the easiest ways you can get access to many Machine Learning and Artificial Intelligence models is by using the https://en.wikipedia.org/wiki/Hugging_Face[HuggingFace's] https://huggingface.co/inference-endpoints[Inference Endpoints].
+
+Hugging Face Hub is a platform providing a collaborative environment for creating and sharing tens of thousands of Open Source ML/AI models, data sets, and demo applications.
+
+Inference Endpoints let you deploy AI Models on dedicated infrastructure with a pay as you go billing model.
+You can use infrastructure provided by Amazon Web Services, Microsoft Azure and Google Cloud Platform.
+Hugging Face lets you run the models on your own machine, but it is quite common to not have enough CPU/GPU resources to run the larger, more AI focused models.
+
+It provides access to Meta's recent (August 2023) Llama 2 and CodeLlama 2 models as well as providing the https://huggingface.co/spaces/HuggingFaceH4/open_llm_leaderboard[Open LLM Leaderboard] where you can quickly discover high quality models.
+
+While Hugging Face has a free hosting tier, which is very useful for quickly evaluating if a specific ML/AI Model fits your needs, they do not let you access many of those models on the free tier using the https://huggingface.co/docs/text-generation-inference/main/en/index[Text Generation Interface API], so since you want to end up on production anyway, with a stable API, pony up a few cents to try out a reliable solution.
+Prices are as low as $0.06 per CPU core/hr and $0.6 per GPU/hr.
diff --git a/spring-ai-huggingface/README.md b/spring-ai-huggingface/README.md
new file mode 100644
index 000000000..580034a0a
--- /dev/null
+++ b/spring-ai-huggingface/README.md
@@ -0,0 +1,56 @@
+# HuggingFace Inference Endpoints with Spring AI
+
+HuggingFace Inference Endpoints allow you to deploy and serve machine learning models in the cloud, making them accessible via an API. Further details on HuggingFace Inference Endpoints can be found [here](https://huggingface.co/docs/inference-endpoints/index).
+
+## Prerequisites
+
+You should get your HuggingFace API key and set it as an environment variable
+
+```shell
+export HUGGINGFACE_API_KEY=your_api_key_here
+```
+
+Note, there is not yet a Spring Boot Starter for this client implementation.
+
+Obtain the endpoint URL of the Inference Endpoint.
+You can find this on the Inference Endpoint's UI [here](https://ui.endpoints.huggingface.co/).
+
+
+## Making a call to the model
+
+```java
+HuggingfaceAiClient client = new HuggingfaceAiClient(apiKey, basePath);
+Prompt prompt = new Prompt("Your text here...");
+AiResponse response = client.generate(prompt);
+System.out.println(response.getGeneration().getText());
+```
+
+## Example
+
+Using the example found [here](https://www.promptingguide.ai/models/mistral-7b)
+
+```java
+String mistral7bInstruct = """
+ [INST] You are a helpful code assistant. Your task is to generate a valid JSON object based on the given information:
+ name: John
+ lastname: Smith
+ address: #1 Samuel St.
+ Just generate the JSON object without explanations:
+ [/INST]""";
+Prompt prompt = new Prompt(mistral7bInstruct);
+AiResponse aiResponse = huggingfaceAiClient.generate(prompt);
+System.out.println(response.getGeneration().getText());
+```
+
+Will produce the output
+
+````
+```json
+{
+ "name": "John",
+ "lastname": "Smith",
+ "address": "#1 Samuel St."
+}
+```
+````
+Note the response itself is in Markdown format.
\ No newline at end of file
diff --git a/spring-ai-huggingface/pom.xml b/spring-ai-huggingface/pom.xml
new file mode 100644
index 000000000..9a1f16fc7
--- /dev/null
+++ b/spring-ai-huggingface/pom.xml
@@ -0,0 +1,118 @@
+
+
+ 4.0.0
+
+ org.springframework.experimental.ai
+ spring-ai
+ 0.7.0-SNAPSHOT
+
+ spring-ai-huggingface
+ jar
+ Spring AI HuggingFace
+ HuggingFace support
+ https://github.com/spring-projects-experimental/spring-ai
+
+
+ https://github.com/spring-projects-experimental/spring-ai
+ git://github.com/spring-projects-experimental/spring-ai.git
+ git@github.com:spring-projects-experimental/spring-ai.git
+
+
+
+
+
+
+ org.springframework.experimental.ai
+ spring-ai-core
+ ${project.parent.version}
+
+
+
+
+ io.swagger.core.v3
+ swagger-annotations
+ 2.2.15
+
+
+
+ javax.annotation
+ javax.annotation-api
+ 1.3.2
+
+
+
+
+
+ org.springframework
+ spring-context-support
+
+
+
+ org.springframework.boot
+ spring-boot-starter-logging
+
+
+
+
+ org.springframework.boot
+ spring-boot-starter-test
+ test
+
+
+
+
+
+
+ io.swagger.codegen.v3
+ swagger-codegen-maven-plugin
+ 3.0.46
+
+
+
+ generate
+
+
+ ${project.basedir}/src/main/resources/openapi.json
+ java
+ resttemplate
+ org.springframework.ai.huggingface.api
+ org.springframework.ai.huggingface.model
+ org.springframework.ai.huggingface.invoker
+ false
+ false
+
+ src/main/java
+ java8
+
+ true
+
+
+
+
+
+
+
+
+ org.codehaus.mojo
+ build-helper-maven-plugin
+ 3.4.0
+
+
+ 01-add-test-sources
+ generate-sources
+
+ add-source
+
+
+
+ ${project.build.directory}/generated-sources/swagger/src/main/java
+
+
+
+
+
+
+
+
+
+
diff --git a/spring-ai-huggingface/src/main/java/org/springframework/ai/huggingface/client/HuggingfaceAiClient.java b/spring-ai-huggingface/src/main/java/org/springframework/ai/huggingface/client/HuggingfaceAiClient.java
new file mode 100644
index 000000000..6ccd47c3c
--- /dev/null
+++ b/spring-ai-huggingface/src/main/java/org/springframework/ai/huggingface/client/HuggingfaceAiClient.java
@@ -0,0 +1,124 @@
+/*
+ * Copyright 2023-2023 the original author or authors.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.springframework.ai.huggingface.client;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+import org.springframework.ai.client.AiClient;
+import org.springframework.ai.client.AiResponse;
+import org.springframework.ai.client.Generation;
+import org.springframework.ai.huggingface.api.TextGenerationInferenceApi;
+import org.springframework.ai.huggingface.invoker.ApiClient;
+import org.springframework.ai.huggingface.model.AllOfGenerateResponseDetails;
+import org.springframework.ai.huggingface.model.GenerateParameters;
+import org.springframework.ai.huggingface.model.GenerateRequest;
+import org.springframework.ai.huggingface.model.GenerateResponse;
+import org.springframework.ai.prompt.Prompt;
+
+/**
+ * An implementation of {@link AiClient} that interfaces with HuggingFace Inference
+ * Endpoints for text generation.
+ *
+ * @author Mark Pollack
+ */
+public class HuggingfaceAiClient implements AiClient {
+
+ /**
+ * Token required for authenticating with the HuggingFace Inference API.
+ */
+ private final String apiToken;
+
+ /**
+ * Client for making API calls.
+ */
+ private ApiClient apiClient = new ApiClient();
+
+ /**
+ * Mapper for converting between Java objects and JSON.
+ */
+ private ObjectMapper objectMapper = new ObjectMapper();
+
+ /**
+ * API for text generation inferences.
+ */
+ private TextGenerationInferenceApi textGenApi = new TextGenerationInferenceApi();
+
+ /**
+ * The maximum number of new tokens to be generated. Note: The total token size for
+ * the Mistral7b instruct model should be less than 1500.
+ */
+ private int maxNewTokens = 1000;
+
+ /**
+ * Constructs a new HuggingfaceAiClient with the specified API token and base path.
+ * @param apiToken The API token for HuggingFace.
+ * @param basePath The base path for API requests.
+ */
+ public HuggingfaceAiClient(final String apiToken, String basePath) {
+ this.apiToken = apiToken;
+ this.apiClient.setBasePath(basePath);
+ this.apiClient.addDefaultHeader("Authorization", "Bearer " + this.apiToken);
+ this.textGenApi.setApiClient(this.apiClient);
+ }
+
+ /**
+ * Generate text based on the provided prompt.
+ * @param prompt The input prompt based on which text is to be generated.
+ * @return AiResponse containing the generated text and other related details.
+ */
+ @Override
+ public AiResponse generate(Prompt prompt) {
+ GenerateRequest generateRequest = new GenerateRequest();
+ generateRequest.setInputs(prompt.getContents());
+ GenerateParameters generateParameters = new GenerateParameters();
+ // TODO - need to expose API to set parameters per call.
+ generateParameters.setMaxNewTokens(maxNewTokens);
+ generateRequest.setParameters(generateParameters);
+ GenerateResponse generateResponse = this.textGenApi.generate(generateRequest);
+ String generatedText = generateResponse.getGeneratedText();
+ List generations = new ArrayList<>();
+ AllOfGenerateResponseDetails allOfGenerateResponseDetails = generateResponse.getDetails();
+ Map detailsMap = objectMapper.convertValue(allOfGenerateResponseDetails,
+ new TypeReference