Skip to content

Switch base endpoint to github.ai #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions cookbooks/python/langchain/lc_openai_getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@
" raise ValueError(\"GITHUB_TOKEN is not set\")\n",
"\n",
"os.environ[\"OPENAI_API_KEY\"] = os.getenv(\"GITHUB_TOKEN\")\n",
"os.environ[\"OPENAI_BASE_URL\"] = \"https://models.inference.ai.azure.com/\"\n",
"os.environ[\"OPENAI_BASE_URL\"] = \"https://models.github.ai/inference\"\n",
"\n",
"GPT_MODEL = \"gpt-4o-mini\"\n",
"GPT_MODEL = \"openai/gpt-4o-mini\"\n",
"\n",
"llm = ChatOpenAI(model=GPT_MODEL)"
]
Expand Down Expand Up @@ -359,7 +359,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "gh-cookbook",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
2 changes: 1 addition & 1 deletion cookbooks/python/llamaindex/rag_getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "gh-cookbook",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
14 changes: 7 additions & 7 deletions cookbooks/python/mistralai/evaluation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"github_token = os.environ[\"GITHUB_TOKEN\"]\n",
"\n",
"# We can use some defaults for the other two variables\n",
"endpoint = \"https://models.inference.ai.azure.com\"\n",
"model_name = \"mistral-large\""
"endpoint = \"https://models.github.ai/inference\"\n",
"model_name = \"mistral-ai/mistral-large\""
]
},
{
Expand Down Expand Up @@ -100,7 +100,7 @@
"from mistralai.models.chat_completion import ChatMessage\n",
"\n",
"\n",
"def run_mistral(user_message, model=\"mistral-small\"):\n",
"def run_mistral(user_message, model=\"mistral-ai/mistral-small\"):\n",
" client = MistralClient(api_key=github_token, endpoint=endpoint)\n",
" messages = [ChatMessage(role=\"user\", content=user_message)]\n",
" chat_response = client.chat(\n",
Expand Down Expand Up @@ -225,7 +225,7 @@
"from mistralai.models.chat_completion import ChatMessage\n",
"\n",
"\n",
"def run_mistral(user_message, model=\"mistral-small\"):\n",
"def run_mistral(user_message, model=\"mistral-ai/mistral-small\"):\n",
" client = MistralClient(api_key=github_token, endpoint=endpoint)\n",
" messages = [ChatMessage(role=\"user\", content=user_message)]\n",
" chat_response = client.chat(model=model, messages=messages)\n",
Expand Down Expand Up @@ -379,7 +379,7 @@
"from mistralai.models.chat_completion import ChatMessage\n",
"\n",
"\n",
"def run_mistral(user_message, model=\"mistral-small\", is_json=False):\n",
"def run_mistral(user_message, model=\"mistral-ai/mistral-small\", is_json=False):\n",
" client = MistralClient(api_key=github_token, endpoint=endpoint)\n",
" messages = [ChatMessage(role=\"user\", content=user_message)]\n",
"\n",
Expand Down Expand Up @@ -502,7 +502,7 @@
" scoring_prompt.format(\n",
" news=news, summary=summary, metric=i[\"metric\"], rubrics=i[\"rubrics\"]\n",
" ),\n",
" model=\"mistral-small\",\n",
" model=\"mistral-ai/mistral-small\",\n",
" is_json=True,\n",
" )\n",
" print(eval_output)"
Expand All @@ -511,7 +511,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
8 changes: 4 additions & 4 deletions cookbooks/python/mistralai/function_calling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
"github_token = os.environ[\"GITHUB_TOKEN\"]\n",
"\n",
"# We can use some defaults for the other two variables\n",
"endpoint = \"https://models.inference.ai.azure.com\"\n",
"model_name = \"mistral-large\"\n",
"endpoint = \"https://models.github.ai/inference\"\n",
"model_name = \"mistral-ai/mistral-small\"\n",
"\n",
"\n",
"# Assuming we have the following data\n",
Expand Down Expand Up @@ -216,7 +216,7 @@
"source": [
"from mistralai.client import MistralClient\n",
"\n",
"model = \"mistral-large\"\n",
"model = \"mistral-ai/mistral-small\"\n",
"\n",
"client = MistralClient(api_key=github_token, endpoint=endpoint)\n",
"\n",
Expand Down Expand Up @@ -335,7 +335,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
Expand Down
Loading