-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
48c6f98
commit aecd2dc
Showing
16 changed files
with
725 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,31 @@ | ||
<<<<<<< HEAD | ||
# Mixture of Experts | ||
# Mistral.ai | ||
|
||
======= | ||
# Mixture of Experts | ||
French Startup to build mixture of experts based LLMs with open source offering. | ||
|
||
* The open-weights models are Mistral 7B, Mixtral 8x7B, Mixtral 8x22B | ||
* The commercial models (Mistral Small, Mistral Medium, Mistral Large, and Mistral Embeddings (retrieval score of 55 on MTEB), codetral for code generation. | ||
|
||
[Models description and benchmarks notes.](https://docs.mistral.ai/getting-started/models/) | ||
|
||
Model can be fine tuned. | ||
|
||
| model | type of usage | | ||
| --- | --- | | ||
| **Mistral Small** | Classification, Customer support, text gen. | | ||
| **Mistral 8x22B** | intermediate tasks that require moderate reasoning - like Data extraction, Summarizing a Document, Writing a Job Description, or Writing Product Descriptions | | ||
| **Mistral Large** | Complex tasks that require large reasoning capabilities or are highly specialized - like Synthetic Text Generation, Code Generation, RAG, or Agents | | ||
|
||
Function calling is supported by Mistral Small, Large, 8x22B. | ||
|
||
Mistral delivers docker image for the model. To run locally with [skypilot]() | ||
|
||
--- | ||
|
||
## Mixture of Experts | ||
|
||
MoE combines multiple models to make predictions or decisions. Each expert specializes in a specific subset of the input space and provides its own prediction. The predictions of the experts are then combined, typically using a gating network, to produce the final output. | ||
|
||
It is useful when dealing with complex and diverse data, each expert extract different aspects or patterns in the data. | ||
|
||
MoE in language translation may use experts by language pairs | ||
|
||
>>>>>>> 0d6401c17707d5173c4bc1b6e287c4b1ac9c4f0f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from mistralai.client import MistralClient | ||
from mistralai.models.chat_completion import ChatMessage | ||
|
||
from dotenv import load_dotenv | ||
import os | ||
|
||
print("--- Welcome to a basic QA with Mistral") | ||
load_dotenv(dotenv_path="../../.env") | ||
|
||
api_key = os.getenv("MISTRAL_API_KEY") | ||
model = "mistral-large-latest" | ||
|
||
client = MistralClient(api_key=api_key) | ||
|
||
chat_response = client.chat( | ||
model=model, | ||
messages=[ChatMessage(role="user", content="What is the best French cheese?")] | ||
) | ||
|
||
print(chat_response.choices[0].message.content) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
langchain-mistralai | ||
langchain-core | ||
langchain-community | ||
mistralai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
|
||
Jerome Boyer | ||
Santa Clara, CA - USA | ||
Former IBM - Distinguished Engineer | ||
AWS Principal Solution Architect | ||
Master Computer Science Nice University, France [Linkedin]() | ||
|
||
|
||
## Background summary | ||
|
||
For the last ten years as AWS principal solution architect and an IBM distinguished engineer, I help customers adopt hybrid cloud, designing complex solutions around microservices, streaming and data management for AI/ML. I'm currently helping customer adopting Generative AI agents combined with traditional symbolic AI to get real actionable value from AI. | ||
I have years of experience in business process automation and decision automation with rule engine systems. Book authors, conferences speaker, I’m still hands-on to develop MVPs, proof of technology. | ||
|
||
I also contributed to multiple patents and publications on business rule models, IBM BPM and decision management integrations. | ||
|
||
I am looking to guide customers to work on App modernization and cloud migration projects. | ||
|
||
## Skills | ||
|
||
Amazon Cloud Architecture Professional Certified | ||
Event-driven architecture and streaming technologies with Kafka, Flink, Kafka Streams. | ||
Cloud and hybrid technology such as Serverless Lambda, API Gateway, Kubernetes, OpenShift, Java Microprofile and Quarkus | ||
AI: Classification, clustering, Deep Learning with PyTorch, Generative AI with prompt engineering, RAG, LangChain, LangGraph, LlamaIndex anddifferent LLMs | ||
Methodology: Agile dev, Lean Startup, Design Thinking, Event Storming and Domain Driven Design | ||
|
||
|
||
## Professional experience | ||
04/204 - Present: Athena Decision Systems: Principal consultant for Neuro Symbolic AI solution implementations. | ||
09/2022- 03/2024: AWS Principal Solution architect - ISV market support Data & AI ISVs, for serverless, event-driven and streaming or Generative AI, multi-tenancy solutions. | ||
|
||
10/2016-09/2022: Distinguished Engineer, Event-driven architecture CTO, Specialized in hybrid cloud and reactive microservices based solution. Engaged with major IBM strategic accounts. Yearly business impact around 150 M$. | ||
|
||
02/09 – 09/2016: IBM Lab Service - Solution Architect for BPM solution | ||
Worldwide position, involved in complex solution delivery around IBM business process management and business rules management projects. Book author and conference speaker. Around 50+ customer engagements. 20 to 30 M$ impact per year. | ||
|
||
12/99-1/09 ILOG Inc – Professional Service – Technical Director | ||
I led the architect groups worldwide to develop best practices and highly qualified architects to support complex project delivery. Directly involved in the most complex NA consulting engagements.Transform a 10 M$ to 80M$ consulting business in 2 years. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
from crewai import Agent, Task, Crew | ||
from crewai_tools import BaseTool, DirectoryReadTool, FileReadTool, SerperDevTool | ||
import os | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv("../../.env") | ||
SERPER_API_KEY= os.getenv("SERPER_API_KEY") | ||
|
||
""" | ||
A sales_rep_agent works on high value leads while lead sales rep, nurtures those leads. | ||
Both agents use tool callings | ||
""" | ||
|
||
sales_rep_agent = Agent( | ||
role="Sales Representative", | ||
goal="Identify high-value leads that match " | ||
"our ideal customer profile", | ||
backstory=( | ||
"As a part of the dynamic sales team at CrewAI, " | ||
"your mission is to scour " | ||
"the digital landscape for potential leads. " | ||
"Armed with cutting-edge tools " | ||
"and a strategic mindset, you analyze data, " | ||
"trends, and interactions to " | ||
"unearth opportunities that others might overlook. " | ||
"Your work is crucial in paving the way " | ||
"for meaningful engagements and driving the company's growth." | ||
), | ||
allow_delegation=False, | ||
verbose=True | ||
) | ||
|
||
lead_sales_rep_agent = Agent( | ||
role="Lead Sales Representative", | ||
goal="Nurture leads with personalized, compelling communications", | ||
backstory=( | ||
"Within the vibrant ecosystem of CrewAI's sales department, " | ||
"you stand out as the bridge between potential clients " | ||
"and the solutions they need." | ||
"By creating engaging, personalized messages, " | ||
"you not only inform leads about our offerings " | ||
"but also make them feel seen and heard." | ||
"Your role is pivotal in converting interest " | ||
"into action, guiding leads through the journey " | ||
"from curiosity to commitment." | ||
), | ||
allow_delegation=False, | ||
verbose=True | ||
) | ||
|
||
class SentimentAnalysisTool(BaseTool): | ||
name: str ="Sentiment Analysis Tool" | ||
description: str = ("Analyzes the sentiment of text " | ||
"to ensure positive and engaging communication.") | ||
|
||
def _run(self, text: str) -> str: | ||
# Your custom code tool goes here | ||
return "positive" | ||
|
||
sentiment_analysis_tool = SentimentAnalysisTool() | ||
directory_read_tool = DirectoryReadTool(directory='./instructions') | ||
file_read_tool = FileReadTool() | ||
search_tool = SerperDevTool() | ||
|
||
lead_profiling_task = Task( | ||
description=( | ||
"Conduct an in-depth analysis of {lead_name}, " | ||
"a company in the {industry} sector " | ||
"that recently showed interest in our solutions. " | ||
"Utilize all available data sources " | ||
"to compile a detailed profile, " | ||
"focusing on key decision-makers, recent business " | ||
"developments, and potential needs " | ||
"that align with our offerings. " | ||
"This task is crucial for tailoring " | ||
"our engagement strategy effectively.\n" | ||
"Don't make assumptions and " | ||
"only use information you absolutely sure about." | ||
), | ||
expected_output=( | ||
"A comprehensive report on {lead_name}, " | ||
"including company background, " | ||
"key personnel, recent milestones, and identified needs. " | ||
"Highlight potential areas where " | ||
"our solutions can provide value, " | ||
"and suggest personalized engagement strategies." | ||
), | ||
tools=[directory_read_tool, file_read_tool, search_tool], | ||
agent=sales_rep_agent, | ||
) | ||
|
||
personalized_outreach_task = Task( | ||
description=( | ||
"Using the insights gathered from " | ||
"the lead profiling report on {lead_name}, " | ||
"craft a personalized outreach campaign " | ||
"aimed at {key_decision_maker}, " | ||
"the {position} of {lead_name}. " | ||
"The campaign should address their recent {milestone} " | ||
"and how our solutions can support their goals. " | ||
"Your communication must resonate " | ||
"with {lead_name}'s company culture and values, " | ||
"demonstrating a deep understanding of " | ||
"their business and needs.\n" | ||
"Don't make assumptions and only " | ||
"use information you absolutely sure about." | ||
), | ||
expected_output=( | ||
"A series of personalized email drafts " | ||
"tailored to {lead_name}, " | ||
"specifically targeting {key_decision_maker}." | ||
"Each draft should include " | ||
"a compelling narrative that connects our solutions " | ||
"with their recent achievements and future goals. " | ||
"Ensure the tone is engaging, professional, " | ||
"and aligned with {lead_name}'s corporate identity." | ||
), | ||
tools=[sentiment_analysis_tool, search_tool], | ||
agent=lead_sales_rep_agent, | ||
) | ||
|
||
crew = Crew( | ||
agents=[sales_rep_agent, lead_sales_rep_agent], | ||
tasks=[lead_profiling_task, personalized_outreach_task], | ||
verbose=2, | ||
memory=True | ||
) | ||
|
||
inputs = { | ||
"lead_name": "DeepLearningAI", | ||
"industry": "Online Learning Platform", | ||
"key_decision_maker": "Andrew Ng", | ||
"position": "CEO", | ||
"milestone": "product launch" | ||
} | ||
|
||
result = crew.kickoff(inputs=inputs) | ||
print(result) |
Oops, something went wrong.