Pular para o conteúdo principal

Postagens

Mostrando postagens com o rótulo llm

Quarkus Langchain4J support to MCP Servers is AMAZING

 We talked about Tools and then MCP . In this post let's talk how to use Quarkus and  lanchaing4j to connect your intelligent application to MCP servers! Requirements Java Open JDK   (24 is preferred) Maven Ollama with at least one LLM model that you can locally. Notice that you could use other providers such as ramalama  and vllm , but you will need to use the correct dependencies for OpenAI API. jbang , npx or other tool required top run the MCP server The LLM client application Our application simple needs the dependencies quarkus-langchain4j-mcp ,  quarkus-langchain4j-ollama and quarkus-rest . You can generate your application online using Code Quarkus . About the code, you only need one single interface: import dev . langchain4j . service . SystemMessage ; import io . quarkiverse . langchain4j . RegisterAiService ; @ RegisterAiService public interface AIService { @ SystemMessage ( "You are a nice and helpful assistant." ) String input ( S...

LLM-Powered Java Development: Using Quarkus and Langchain4J to Run Python-Generated Code

Code on my github   You may have heard that Auto Regressive LLMs (Large Language Models) are not good with certain tasks, given wrong or inaccurate results. Classical examples is the prompt: count the number of r in word strawberry Asking local llama 3.2 to count the number of 'r' on word 'strawberry' and it wrongly says 2 Or which number is bigger: 9.11 or 9.9 Asking Llama 3.2 the prompt which number is bigger: 9.11 or 9.9 and it wrongly says that 9.11 is bigger Of course modern LLMs may be trained to target such cases and may get it right, but if you try similar prompts you may get inaccurate results or even make the LLM "think" that they should answer something else and change the answer to something wrong. But still, there are issues that LLMs simply can't solve due the tokenization process and the context lenght. This is discussed in depth in recent Andrej Karpathy video about LLMs: In this same video Karpathy suggests the use of code to solve such ...