「.NET 開発基盤部会 Wiki」は、「Open棟梁Project」,「OSSコンソーシアム .NET開発基盤部会」によって運営されています。
コミュニティの活動状況を確認。
OSS LLMのメンテナンス体制とサポート体制を確認。
モデルのトレーニングや推論に使用するデータの保護を確認。
BigScience?という協力的AI研究ワークショップによって開発
アブダビのTechnology Innovation Institute(TII)によって開発
草の根の非営利の人工知能研究グループによって開発
Mistral AIによって開発
Salesforceが提供するLLM
AI/BI系のプラットフォームベンダで、色々なOSSをホストしている。
MicrosoftがSLM(Small Language Model)として開発したPhi-3
ollama
ollama run gemma2 ollama run llama3
curl https://ollama.ai/install.sh | sh
ollama serve
ollama run llama2
success >>> こんにちは、あなたは誰ですか? こんにちは!I'm LLaMA, a large language model trained by a team of researcher at Meta AI. My primary function is to understand and respond to human input in a helpful and informative manner. I can converse on a wide range of topics, from science and history to entertainment and culture. I'm constantly learning and improving my abilities, so please bear with me if I make any mistakes. Nice to meet you!
curl -X POST -H "Content-Type:application/json" http://localhost:11434/api/chat -d "{\"model\": \"llama3\", \"messages\": [{ \"role\": \"user\", \"content\": \"why is the sky blue?\" }]}"
>ipconfig イーサネット アダプター vEthernet (WSL): 接続固有の DNS サフィックス . . . . .: リンクローカル IPv6 アドレス. . . . .: ... IPv4 アドレス . . . . . . . . . . . .: 172.xxx.xxx.1 サブネット マスク . . . . . . . . . .: 255.255.240.0 デフォルト ゲートウェイ . . . . . . .:
OLLAMA_HOST OLLAMA_ORIGINS
curl http://localhost:11434/api/chat -d '{ "model": "llama3", "messages": [ { "role": "user", "content": "why is the sky blue?" } ] }'
import requests url = "http://localhost:11434/api/chat" payload = { "model": "llama3", "messages": [ {"role": "user", "content": "why is the sky blue?"} ] } response = requests.post(url, json=payload) print(response.text) # print(response.json())LangChain
!pip install pandas langchain ollama langchain_community import pandas as pd from langchain_community.llms import Ollama from langchain.chains import LLMChain from langchain.prompts import PromptTemplate # サンプルデータとしてタイタニックのデータセットを読み込む df = pd.read_csv( "https://raw.githubusercontent.com/pandas-dev/pandas/main/doc/data/titanic.csv" ) # LLMのインスタンスを作成 llm = Ollama(model="llama3") # PromptTemplateを作成 template = """ {{question}} ### Document {{dataframe}} ### Answer """ prompt = PromptTemplate(template=template, input_variables=["dataframe", "question"]) # LLMChainを作成 llm_chain = LLMChain(prompt=prompt, llm=llm) # DataFrameを文字列に変換 dataframe_str = df.to_string() # 質問を定義 question = "how many rows are there in PassengerId?" # 質問を投げて回答を得る response = llm_chain.run(dataframe=dataframe_str, question=question) print("Answer:", response)