import{s as ko,o as xo,n as E}from"../chunks/scheduler.f6319a2a.js";import{S as Ao,i as Eo,g as c,s as a,r as g,A as No,h as d,f as s,c as r,j as C,u,x as w,k,y as p,a as o,v as M,d as h,t as f,w as y}from"../chunks/index.85aa684c.js";import{T as Vt}from"../chunks/Tip.3d397a88.js";import{D as A,E as P}from"../chunks/ExampleCodeBlock.3d8cc3b7.js";import{C as I}from"../chunks/CodeBlock.3400fc53.js";import{H as L,E as qo}from"../chunks/getInferenceSnippets.55a93fbe.js";function Lo(j){let l,T=`Smolagents is an experimental API which is subject to change at any time. Results returned by the agents
can vary as the APIs or underlying models are prone to change.`;return{c(){l=c("p"),l.textContent=T},l(i){l=d(i,"P",{"data-svelte-h":!0}),w(l)!=="svelte-19v5hvw"&&(l.textContent=T)},m(i,m){o(i,l,m)},p:E,d(i){i&&s(l)}}}function Bo(j){let l,T="Example:",i,m,J;return m=new I({props:{code:"Y2xhc3MlMjBDdXN0b21Nb2RlbChNb2RlbCklM0ElMEElMjAlMjAlMjAlMjBkZWYlMjBnZW5lcmF0ZShzZWxmJTJDJTIwbWVzc2FnZXMlMkMlMjAqKmt3YXJncyklM0ElMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjMlMjBJbXBsZW1lbnRhdGlvbiUyMHNwZWNpZmljJTIwdG8lMjB5b3VyJTIwbW9kZWwlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjBwYXNz",highlighted:`<span class="hljs-keyword">class</span> <span class="hljs-title class_">CustomModel</span>(<span class="hljs-title class_ inherited__">Model</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">generate</span>(<span class="hljs-params">self, messages, **kwargs</span>):
        <span class="hljs-comment"># Implementation specific to your model</span>
        <span class="hljs-keyword">pass</span>`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-11lpom8"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function Zo(j){let l,T="You must have <code>transformers</code> and <code>torch</code> installed on your machine. Please run <code>pip install &#39;smolagents[transformers]&#39;</code> if it’s not the case.";return{c(){l=c("p"),l.innerHTML=T},l(i){l=d(i,"P",{"data-svelte-h":!0}),w(l)!=="svelte-2avciv"&&(l.innerHTML=T)},m(i,m){o(i,l,m)},p:E,d(i){i&&s(l)}}}function Qo(j){let l,T="You must have <code>transformers</code> and <code>torch</code> installed on your machine. Please run <code>pip install &#39;smolagents[transformers]&#39;</code> if it’s not the case.";return{c(){l=c("p"),l.innerHTML=T},l(i){l=d(i,"P",{"data-svelte-h":!0}),w(l)!=="svelte-2avciv"&&(l.innerHTML=T)},m(i,m){o(i,l,m)},p:E,d(i){i&&s(l)}}}function Wo(j){let l,T="Example:",i,m,J;return m=new I({props:{code:"ZW5naW5lJTIwJTNEJTIwVHJhbnNmb3JtZXJzTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBkZXZpY2UlM0QlMjJjdWRhJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWF4X25ld190b2tlbnMlM0Q1MDAwJTJDJTBBKSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyRXhwbGFpbiUyMHF1YW50dW0lMjBtZWNoYW5pY3MlMjBpbiUyMHNpbXBsZSUyMHRlcm1zLiUyMiU3RCU1RCUwQXJlc3BvbnNlJTIwJTNEJTIwZW5naW5lKG1lc3NhZ2VzJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJFTkQlMjIlNUQpJTBBcHJpbnQocmVzcG9uc2Up",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>engine = TransformersModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
<span class="hljs-meta">... </span>    device=<span class="hljs-string">&quot;cuda&quot;</span>,
<span class="hljs-meta">... </span>    max_new_tokens=<span class="hljs-number">5000</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Explain quantum mechanics in simple terms.&quot;</span>}]
<span class="hljs-meta">&gt;&gt;&gt; </span>response = engine(messages, stop_sequences=[<span class="hljs-string">&quot;END&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(response)
<span class="hljs-string">&quot;Quantum mechanics is the branch of physics that studies...&quot;</span>`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-11lpom8"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function So(j){let l,T="Example:",i,m,J;return m=new I({props:{code:"ZW5naW5lJTIwJTNEJTIwSW5mZXJlbmNlQ2xpZW50TW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJRd2VuJTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QlMjIlMkMlMEElMjAlMjAlMjAlMjBwcm92aWRlciUzRCUyMm5lYml1cyUyMiUyQyUwQSUyMCUyMCUyMCUyMHRva2VuJTNEJTIyeW91cl9oZl90b2tlbl9oZXJlJTIyJTJDJTBBJTIwJTIwJTIwJTIwbWF4X3Rva2VucyUzRDUwMDAlMkMlMEEpJTBBbWVzc2FnZXMlMjAlM0QlMjAlNUIlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJFeHBsYWluJTIwcXVhbnR1bSUyMG1lY2hhbmljcyUyMGluJTIwc2ltcGxlJTIwdGVybXMuJTIyJTdEJTVEJTBBcmVzcG9uc2UlMjAlM0QlMjBlbmdpbmUobWVzc2FnZXMlMkMlMjBzdG9wX3NlcXVlbmNlcyUzRCU1QiUyMkVORCUyMiU1RCklMEFwcmludChyZXNwb25zZSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>engine = InferenceClientModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</span>,
<span class="hljs-meta">... </span>    provider=<span class="hljs-string">&quot;nebius&quot;</span>,
<span class="hljs-meta">... </span>    token=<span class="hljs-string">&quot;your_hf_token_here&quot;</span>,
<span class="hljs-meta">... </span>    max_tokens=<span class="hljs-number">5000</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Explain quantum mechanics in simple terms.&quot;</span>}]
<span class="hljs-meta">&gt;&gt;&gt; </span>response = engine(messages, stop_sequences=[<span class="hljs-string">&quot;END&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(response)
<span class="hljs-string">&quot;Quantum mechanics is the branch of physics that studies...&quot;</span>`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-11lpom8"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function Vo(j){let l,T="Example:",i,m,J;return m=new I({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMENvZGVBZ2VudCUyQyUyMFdlYlNlYXJjaFRvb2wlMkMlMjBMaXRlTExNUm91dGVyTW9kZWwlMEFvcy5lbnZpcm9uJTVCJTIyT1BFTkFJX0FQSV9LRVklMjIlNUQlMjAlM0QlMjAlMjIlMjIlMEFvcy5lbnZpcm9uJTVCJTIyQVdTX0FDQ0VTU19LRVlfSUQlMjIlNUQlMjAlM0QlMjAlMjIlMjIlMEFvcy5lbnZpcm9uJTVCJTIyQVdTX1NFQ1JFVF9BQ0NFU1NfS0VZJTIyJTVEJTIwJTNEJTIwJTIyJTIyJTBBb3MuZW52aXJvbiU1QiUyMkFXU19SRUdJT04lMjIlNUQlMjAlM0QlMjAlMjIlMjIlMEFsbG1fbG9hZGJhbGFuY2VyX21vZGVsX2xpc3QlMjAlM0QlMjAlNUIlMEElMjAlMjAlMjAlMjAlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJtb2RlbF9uYW1lJTIyJTNBJTIwJTIybW9kZWwtZ3JvdXAtMSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmxpdGVsbG1fcGFyYW1zJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybW9kZWwlMjIlM0ElMjAlMjJncHQtNG8tbWluaSUyMiUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmFwaV9rZXklMjIlM0ElMjBvcy5nZXRlbnYoJTIyT1BFTkFJX0FQSV9LRVklMjIpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybW9kZWxfbmFtZSUyMiUzQSUyMCUyMm1vZGVsLWdyb3VwLTElMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJsaXRlbGxtX3BhcmFtcyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMm1vZGVsJTIyJTNBJTIwJTIyYmVkcm9jayUyRmFudGhyb3BpYy5jbGF1ZGUtMy1zb25uZXQtMjAyNDAyMjktdjElM0EwJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyYXdzX2FjY2Vzc19rZXlfaWQlMjIlM0ElMjBvcy5nZXRlbnYoJTIyQVdTX0FDQ0VTU19LRVlfSUQlMjIpJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyYXdzX3NlY3JldF9hY2Nlc3Nfa2V5JTIyJTNBJTIwb3MuZ2V0ZW52KCUyMkFXU19TRUNSRVRfQUNDRVNTX0tFWSUyMiklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJhd3NfcmVnaW9uX25hbWUlMjIlM0ElMjBvcy5nZXRlbnYoJTIyQVdTX1JFR0lPTiUyMiklMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlN0QlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEElNUQlMEFtb2RlbCUyMCUzRCUyMExpdGVMTE1Sb3V0ZXJNb2RlbCglMEElMjAlMjAlMjBtb2RlbF9pZCUzRCUyMm1vZGVsLWdyb3VwLTElMjIlMkMlMEElMjAlMjAlMjBtb2RlbF9saXN0JTNEbGxtX2xvYWRiYWxhbmNlcl9tb2RlbF9saXN0JTJDJTBBJTIwJTIwJTIwY2xpZW50X2t3YXJncyUzRCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvdXRpbmdfc3RyYXRlZ3klMjIlM0ElMjJzaW1wbGUtc2h1ZmZsZSUyMiUwQSUyMCUyMCUyMCU3RCUwQSklMEFhZ2VudCUyMCUzRCUyMENvZGVBZ2VudCh0b29scyUzRCU1QldlYlNlYXJjaFRvb2woKSU1RCUyQyUyMG1vZGVsJTNEbW9kZWwpJTBBYWdlbnQucnVuKCUyMkhvdyUyMG1hbnklMjBzZWNvbmRzJTIwd291bGQlMjBpdCUyMHRha2UlMjBmb3IlMjBhJTIwbGVvcGFyZCUyMGF0JTIwZnVsbCUyMHNwZWVkJTIwdG8lMjBydW4lMjB0aHJvdWdoJTIwUG9udCUyMGRlcyUyMEFydHMlM0YlMjIp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> os
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> CodeAgent, WebSearchTool, LiteLLMRouterModel
<span class="hljs-meta">&gt;&gt;&gt; </span>os.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>] = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>os.environ[<span class="hljs-string">&quot;AWS_ACCESS_KEY_ID&quot;</span>] = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>os.environ[<span class="hljs-string">&quot;AWS_SECRET_ACCESS_KEY&quot;</span>] = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>os.environ[<span class="hljs-string">&quot;AWS_REGION&quot;</span>] = <span class="hljs-string">&quot;&quot;</span>
<span class="hljs-meta">&gt;&gt;&gt; </span>llm_loadbalancer_model_list = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">&quot;model-group-1&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;litellm_params&quot;</span>: {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;gpt-4o-mini&quot;</span>,
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;api_key&quot;</span>: os.getenv(<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>),
<span class="hljs-meta">... </span>        },
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">&quot;model-group-1&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;litellm_params&quot;</span>: {
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;bedrock/anthropic.claude-3-sonnet-20240229-v1:0&quot;</span>,
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;aws_access_key_id&quot;</span>: os.getenv(<span class="hljs-string">&quot;AWS_ACCESS_KEY_ID&quot;</span>),
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;aws_secret_access_key&quot;</span>: os.getenv(<span class="hljs-string">&quot;AWS_SECRET_ACCESS_KEY&quot;</span>),
<span class="hljs-meta">... </span>            <span class="hljs-string">&quot;aws_region_name&quot;</span>: os.getenv(<span class="hljs-string">&quot;AWS_REGION&quot;</span>),
<span class="hljs-meta">... </span>        },
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">&gt;&gt;&gt; </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>model = LiteLLMRouterModel(
<span class="hljs-meta">... </span>   model_id=<span class="hljs-string">&quot;model-group-1&quot;</span>,
<span class="hljs-meta">... </span>   model_list=llm_loadbalancer_model_list,
<span class="hljs-meta">... </span>   client_kwargs={
<span class="hljs-meta">... </span>       <span class="hljs-string">&quot;routing_strategy&quot;</span>:<span class="hljs-string">&quot;simple-shuffle&quot;</span>
<span class="hljs-meta">... </span>   }
<span class="hljs-meta">&gt;&gt;&gt; </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>agent = CodeAgent(tools=[WebSearchTool()], model=model)
<span class="hljs-meta">&gt;&gt;&gt; </span>agent.run(<span class="hljs-string">&quot;How many seconds would it take for a leopard at full speed to run through Pont des Arts?&quot;</span>)`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-11lpom8"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function Ro(j){let l,T=`API key support requires <code>boto3 &gt;= 1.39.0</code>.
For users not relying on API key authentication, the minimum supported version is <code>boto3 &gt;= 1.36.18</code>.`;return{c(){l=c("p"),l.innerHTML=T},l(i){l=d(i,"P",{"data-svelte-h":!0}),w(l)!=="svelte-ll4rxl"&&(l.innerHTML=T)},m(i,m){o(i,l,m)},p:E,d(i){i&&s(l)}}}function zo(j){let l,T="Creating a model instance with default settings:",i,m,J;return m=new I({props:{code:"YmVkcm9ja19tb2RlbCUyMCUzRCUyMEFtYXpvbkJlZHJvY2tTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCd1cy5hbWF6b24ubm92YS1wcm8tdjElM0EwJyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>bedrock_model = AmazonBedrockServerModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&#x27;us.amazon.nova-pro-v1:0&#x27;</span>
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-1368o2k"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function Xo(j){let l,T="Creating a model instance with a custom boto3 client:",i,m,J;return m=new I({props:{code:"aW1wb3J0JTIwYm90bzMlMEFjbGllbnQlMjAlM0QlMjBib3RvMy5jbGllbnQoJ2JlZHJvY2stcnVudGltZSclMkMlMjByZWdpb25fbmFtZSUzRCd1cy13ZXN0LTInKSUwQWJlZHJvY2tfbW9kZWwlMjAlM0QlMjBBbWF6b25CZWRyb2NrU2VydmVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QndXMuYW1hem9uLm5vdmEtcHJvLXYxJTNBMCclMkMlMEElMjAlMjAlMjAlMjBjbGllbnQlM0RjbGllbnQlMEEp",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-keyword">import</span> boto3
<span class="hljs-meta">&gt;&gt;&gt; </span>client = boto3.client(<span class="hljs-string">&#x27;bedrock-runtime&#x27;</span>, region_name=<span class="hljs-string">&#x27;us-west-2&#x27;</span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>bedrock_model = AmazonBedrockServerModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&#x27;us.amazon.nova-pro-v1:0&#x27;</span>,
<span class="hljs-meta">... </span>    client=client
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-11isg5i"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function Fo(j){let l,T="Creating a model instance with client_kwargs for internal client creation:",i,m,J;return m=new I({props:{code:"YmVkcm9ja19tb2RlbCUyMCUzRCUyMEFtYXpvbkJlZHJvY2tTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCd1cy5hbWF6b24ubm92YS1wcm8tdjElM0EwJyUyQyUwQSUyMCUyMCUyMCUyMGNsaWVudF9rd2FyZ3MlM0QlN0IncmVnaW9uX25hbWUnJTNBJTIwJ3VzLXdlc3QtMiclMkMlMjAnZW5kcG9pbnRfdXJsJyUzQSUyMCdodHRwcyUzQSUyRiUyRmN1c3RvbS1lbmRwb2ludC5jb20nJTdEJTBBKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>bedrock_model = AmazonBedrockServerModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&#x27;us.amazon.nova-pro-v1:0&#x27;</span>,
<span class="hljs-meta">... </span>    client_kwargs={<span class="hljs-string">&#x27;region_name&#x27;</span>: <span class="hljs-string">&#x27;us-west-2&#x27;</span>, <span class="hljs-string">&#x27;endpoint_url&#x27;</span>: <span class="hljs-string">&#x27;https://custom-endpoint.com&#x27;</span>}
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-1s85quz"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function Go(j){let l,T="Creating a model instance with inference and guardrail configurations:",i,m,J;return m=new I({props:{code:"YWRkaXRpb25hbF9hcGlfY29uZmlnJTIwJTNEJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIyaW5mZXJlbmNlQ29uZmlnJTIyJTNBJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybWF4VG9rZW5zJTIyJTNBJTIwMzAwMCUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMmd1YXJkcmFpbENvbmZpZyUyMiUzQSUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMmd1YXJkcmFpbElkZW50aWZpZXIlMjIlM0ElMjAlMjJpZGVudGlmeTElMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJndWFyZHJhaWxWZXJzaW9uJTIyJTNBJTIwJ3YxJyUwQSUyMCUyMCUyMCUyMCU3RCUyQyUwQSU3RCUwQWJlZHJvY2tfbW9kZWwlMjAlM0QlMjBBbWF6b25CZWRyb2NrU2VydmVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QnYW50aHJvcGljLmNsYXVkZS0zLWhhaWt1LTIwMjQwMzA3LXYxJTNBMCclMkMlMEElMjAlMjAlMjAlMjAqKmFkZGl0aW9uYWxfYXBpX2NvbmZpZyUwQSk=",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>additional_api_config = {
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;inferenceConfig&quot;</span>: {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;maxTokens&quot;</span>: <span class="hljs-number">3000</span>
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">... </span>    <span class="hljs-string">&quot;guardrailConfig&quot;</span>: {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;guardrailIdentifier&quot;</span>: <span class="hljs-string">&quot;identify1&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;guardrailVersion&quot;</span>: <span class="hljs-string">&#x27;v1&#x27;</span>
<span class="hljs-meta">... </span>    },
<span class="hljs-meta">... </span>}
<span class="hljs-meta">&gt;&gt;&gt; </span>bedrock_model = AmazonBedrockServerModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&#x27;anthropic.claude-3-haiku-20240307-v1:0&#x27;</span>,
<span class="hljs-meta">... </span>    **additional_api_config
<span class="hljs-meta">... </span>)`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-4kd7m4"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function Ho(j){let l,T="You must have <code>mlx-lm</code> installed on your machine. Please run <code>pip install &#39;smolagents[mlx-lm]&#39;</code> if it’s not the case.";return{c(){l=c("p"),l.innerHTML=T},l(i){l=d(i,"P",{"data-svelte-h":!0}),w(l)!=="svelte-1u8nbd9"&&(l.innerHTML=T)},m(i,m){o(i,l,m)},p:E,d(i){i&&s(l)}}}function Po(j){let l,T="You must have <code>mlx-lm</code> installed on your machine. Please run <code>pip install &#39;smolagents[mlx-lm]&#39;</code> if it’s not the case.";return{c(){l=c("p"),l.innerHTML=T},l(i){l=d(i,"P",{"data-svelte-h":!0}),w(l)!=="svelte-1u8nbd9"&&(l.innerHTML=T)},m(i,m){o(i,l,m)},p:E,d(i){i&&s(l)}}}function Yo(j){let l,T="Example:",i,m,J;return m=new I({props:{code:"ZW5naW5lJTIwJTNEJTIwTUxYTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJtbHgtY29tbXVuaXR5JTJGUXdlbjIuNS1Db2Rlci0zMkItSW5zdHJ1Y3QtNGJpdCUyMiUyQyUwQSUyMCUyMCUyMCUyMG1heF90b2tlbnMlM0QxMDAwMCUyQyUwQSklMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIyY29udGVudCUyMiUzQSUyMCUyMkV4cGxhaW4lMjBxdWFudHVtJTIwbWVjaGFuaWNzJTIwaW4lMjBzaW1wbGUlMjB0ZXJtcy4lMjIlMEElMjAlMjAlMjAlMjAlN0QlMEElNUQlMEFyZXNwb25zZSUyMCUzRCUyMGVuZ2luZShtZXNzYWdlcyUyQyUyMHN0b3Bfc2VxdWVuY2VzJTNEJTVCJTIyRU5EJTIyJTVEKSUwQXByaW50KHJlc3BvbnNlKQ==",highlighted:`<span class="hljs-meta">&gt;&gt;&gt; </span>engine = MLXModel(
<span class="hljs-meta">... </span>    model_id=<span class="hljs-string">&quot;mlx-community/Qwen2.5-Coder-32B-Instruct-4bit&quot;</span>,
<span class="hljs-meta">... </span>    max_tokens=<span class="hljs-number">10000</span>,
<span class="hljs-meta">... </span>)
<span class="hljs-meta">&gt;&gt;&gt; </span>messages = [
<span class="hljs-meta">... </span>    {
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>,
<span class="hljs-meta">... </span>        <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Explain quantum mechanics in simple terms.&quot;</span>
<span class="hljs-meta">... </span>    }
<span class="hljs-meta">... </span>]
<span class="hljs-meta">&gt;&gt;&gt; </span>response = engine(messages, stop_sequences=[<span class="hljs-string">&quot;END&quot;</span>])
<span class="hljs-meta">&gt;&gt;&gt; </span><span class="hljs-built_in">print</span>(response)
<span class="hljs-string">&quot;Quantum mechanics is the branch of physics that studies...&quot;</span>`,wrap:!1}}),{c(){l=c("p"),l.textContent=T,i=a(),g(m.$$.fragment)},l(n){l=d(n,"P",{"data-svelte-h":!0}),w(l)!=="svelte-11lpom8"&&(l.textContent=T),i=r(n),u(m.$$.fragment,n)},m(n,b){o(n,l,b),o(n,i,b),M(m,n,b),J=!0},p:E,i(n){J||(h(m.$$.fragment,n),J=!0)},o(n){f(m.$$.fragment,n),J=!1},d(n){n&&(s(l),s(i)),y(m,n)}}}function Do(j){let l,T="You must have <code>vllm</code> installed on your machine. Please run <code>pip install &#39;smolagents[vllm]&#39;</code> if it’s not the case.";return{c(){l=c("p"),l.innerHTML=T},l(i){l=d(i,"P",{"data-svelte-h":!0}),w(l)!=="svelte-7jvy4l"&&(l.innerHTML=T)},m(i,m){o(i,l,m)},p:E,d(i){i&&s(l)}}}function Oo(j){let l,T,i,m,J,n,b,ws,fe,kl=`To learn more about agents and tools make sure to read the <a href="../index">introductory guide</a>. This page
contains the API docs for the underlying classes.`,Ts,ye,Js,we,xl=`All model classes in smolagents support passing additional keyword arguments (like <code>temperature</code>, <code>max_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time.
These parameters are automatically forwarded to the underlying model’s completion calls, allowing you to configure model behavior such as creativity, response length, and sampling strategies.`,bs,Te,js,Je,Al="The <code>Model</code> class serves as the foundation for all model implementations, providing the core interface that custom models must implement to work with agents.",_s,U,be,Bn,Rt,El="Base class for all language model implementations.",Zn,zt,Nl=`This abstract class defines the core interface that all model implementations must follow
to work with agents. It provides common functionality for message handling, tool integration,
and model configuration while allowing subclasses to implement their specific generation logic.`,Qn,Xt,ql=`Note:
This is an abstract base class. Subclasses must implement the <code>generate()</code> method
to provide actual model inference capabilities.`,Wn,Y,Sn,D,je,Vn,Ft,Ll="Process the input messages and return the model’s response.",Rn,O,_e,zn,Gt,Bl="Sometimes APIs do not return the tool call as a specific object, so we need to parse it.",Xn,K,$e,Fn,Ht,Zl="Converts the model into a JSON-compatible dictionary.",$s,Ie,Is,Ue,Ql="The <code>ApiModel</code> class serves as the foundation for all API-based model implementations, providing common functionality for external API interactions, rate limiting, and client management that API-specific models inherit.",Us,B,ve,Gn,Pt,Wl="Base class for API-based language models.",Hn,Yt,Sl=`This class serves as a foundation for implementing models that interact with
external APIs. It handles the common functionality for managing model IDs,
custom role mappings, and API client connections.`,Pn,ee,Ce,Yn,Dt,Vl="Create the API client for the specific service.",vs,ke,Cs,xe,Rl="For convenience, we have added a <code>TransformersModel</code> that implements the points above by building a local <code>transformers</code> pipeline for the model_id given at initialization.",ks,Ae,xs,Ee,As,Ne,zl="You can pass any keyword arguments supported by the underlying model (such as <code>temperature</code>, <code>max_new_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time. These are forwarded to the model completion call:",Es,qe,Ns,te,qs,N,Le,Dn,Ot,Xl="A class that uses Hugging Face’s Transformers library for language model interaction.",On,Kt,Fl="This model allows you to load and use Hugging Face’s models locally using the Transformers library. It supports features like stop sequences and grammar customization.",Kn,se,el,ne,Ls,Be,Bs,Ze,Gl='The <code>InferenceClientModel</code> wraps huggingface_hub’s <a href="https://huggingface.co/docs/huggingface_hub/main/en/guides/inference" rel="nofollow">InferenceClient</a> for the execution of the LLM. It supports all <a href="https://huggingface.co/docs/inference-providers/index" rel="nofollow">Inference Providers</a> available on the Hub: Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together, and more.',Zs,Qe,Hl="You can also set a rate limit in requests per minute by using the <code>requests_per_minute</code> argument:",Qs,We,Ws,Se,Ss,Ve,Pl="You can pass any keyword arguments supported by the underlying model (such as <code>temperature</code>, <code>max_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time. These are forwarded to the model completion call:",Vs,Re,Rs,x,ze,tl,es,Yl="A class to interact with Hugging Face’s Inference Providers for language model interaction.",sl,ts,Dl="This model allows you to communicate with Hugging Face’s models using Inference Providers. It can be used in both serverless mode, with a dedicated endpoint, or even with a local URL, supporting features like stop sequences and grammar customization.",nl,ss,Ol="Providers include Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together, and more.",ll,le,ol,oe,Xe,al,ns,Kl="Create the Hugging Face client.",zs,Fe,Xs,Ge,eo=`The <code>LiteLLMModel</code> leverages <a href="https://www.litellm.ai/" rel="nofollow">LiteLLM</a> to support 100+ LLMs from various providers.
You can pass kwargs upon model initialization that will then be used whenever using the model, for instance below we pass <code>temperature</code>. You can also set a rate limit in requests per minute by using the <code>requests_per_minute</code> argument.`,Fs,He,Gs,S,Pe,rl,ls,to='Model to use <a href="https://docs.litellm.ai/docs/#litellm-python-sdk" rel="nofollow">LiteLLM Python SDK</a> to access hundreds of LLMs.',il,ae,Ye,ml,os,so="Create the LiteLLM client.",Hs,De,Ps,Oe,no=`The <code>LiteLLMRouterModel</code> is a wrapper around the <a href="https://docs.litellm.ai/docs/routing" rel="nofollow">LiteLLM Router</a> that leverages
advanced routing strategies: load-balancing across multiple deployments, prioritizing critical requests via queueing,
and implementing basic reliability measures such as cooldowns, fallbacks, and exponential backoff retries.`,Ys,Ke,Ds,Z,et,cl,as,lo='Router‑based client for interacting with the <a href="https://docs.litellm.ai/docs/routing" rel="nofollow">LiteLLM Python SDK Router</a>.',dl,rs,oo=`This class provides a high-level interface for distributing requests among multiple language models using
the LiteLLM SDK’s routing capabilities. It is responsible for initializing and configuring the router client,
applying custom role conversions, and managing message formatting to ensure seamless integration with various LLMs.`,pl,re,Os,tt,Ks,st,ao=`This class lets you call any OpenAIServer compatible model.
Here’s how you can set it (you can customise the <code>api_base</code> url to point to another server):`,en,nt,tn,lt,ro="You can pass any keyword arguments supported by the underlying model (such as <code>temperature</code>, <code>max_tokens</code>, <code>top_p</code>, etc.) directly at instantiation time. These are forwarded to the model completion call:",sn,ot,nn,X,at,gl,is,io="This model connects to an OpenAI-compatible API server.",ln,rt,on,it,mo="<code>AzureOpenAIServerModel</code> allows you to connect to any Azure OpenAI deployment.",an,mt,co="Below you can find an example of how to set it up, note that you can omit the <code>azure_endpoint</code>, <code>api_key</code>, and <code>api_version</code> arguments, provided you’ve set the corresponding environment variables — <code>AZURE_OPENAI_ENDPOINT</code>, <code>AZURE_OPENAI_API_KEY</code>, and <code>OPENAI_API_VERSION</code>.",rn,ct,po='Pay attention to the lack of an <code>AZURE_</code> prefix for <code>OPENAI_API_VERSION</code>, this is due to the way the underlying <a href="https://github.com/openai/openai-python" rel="nofollow">openai</a> package is designed.',mn,dt,cn,F,pt,ul,ms,go="This model connects to an Azure OpenAI deployment.",dn,gt,pn,ut,uo="<code>AmazonBedrockServerModel</code> helps you connect to Amazon Bedrock and run your agent with any available models.",gn,Mt,Mo="Below is an example setup. This class also offers additional options for customization.",un,ht,Mn,_,ft,Ml,cs,ho="A model class for interacting with Amazon Bedrock Server models through the Bedrock API.",hl,ds,fo=`This class provides an interface to interact with various Bedrock language models,
allowing for customized model inference, guardrail configuration, message handling,
and other parameters allowed by boto3 API.`,fl,ps,yo="Authentication:",yl,gs,wo="Amazon Bedrock supports multiple authentication methods:",wl,us,To=`<li>Default AWS credentials:
Use the default AWS credential chain (e.g., IAM roles, IAM users).</li> <li>API Key Authentication (requires <code>boto3 &gt;= 1.39.0</code>):
Set the API key using the <code>AWS_BEARER_TOKEN_BEDROCK</code> environment variable.</li>`,Tl,ie,Jl,Ms,Jo="Examples:",bl,me,jl,ce,_l,de,$l,pe,hn,yt,fn,wt,yn,Tt,wn,ge,Tn,Q,Jt,Il,hs,bo="A class to interact with models loaded using MLX on Apple silicon.",Ul,ue,vl,Me,Jn,bt,bn,jt,jo='Model to use <a href="https://docs.vllm.ai/" rel="nofollow">vLLM</a> for fast LLM inference and serving.',jn,_t,_n,he,$n,G,$t,Cl,fs,_o='Model to use <a href="https://docs.vllm.ai/" rel="nofollow">vLLM</a> for fast LLM inference and serving.',In,It,Un,Ut,$o="You’re free to create and use your own models to power your agent.",vn,vt,Io=`You could subclass the base <code>Model</code> class to create a model for your agent.
The main criteria is to subclass the <code>generate</code> method, with these two criteria:`,Cn,Ct,Uo='<li>It follows the <a href="./chat_templating">messages format</a> (<code>List[Dict[str, str]]</code>) for its input <code>messages</code>, and it returns an object with a <code>.content</code> attribute.</li> <li>It stops generating outputs at the sequences passed in the argument <code>stop_sequences</code>.</li>',kn,kt,vo=`For defining your LLM, you can make a <code>CustomModel</code> class that inherits from the base <code>Model</code> class.
It should have a generate method that takes a list of <a href="./chat_templating">messages</a> and returns an object with a .content attribute containing the text. The <code>generate</code> method also needs to accept a <code>stop_sequences</code> argument that indicates when to stop generating.`,xn,xt,An,At,Co='Additionally, <code>generate</code> can also take a <code>grammar</code> argument to allow <a href="https://huggingface.co/docs/text-generation-inference/conceptual/guidance" rel="nofollow">constrained generation</a> in order to force properly-formatted agent outputs.',En,Et,Nn,ys,qn;return J=new L({props:{title:"Models",local:"models",headingTag:"h1"}}),b=new Vt({props:{warning:!0,$$slots:{default:[Lo]},$$scope:{ctx:j}}}),ye=new L({props:{title:"Models",local:"models",headingTag:"h2"}}),Te=new L({props:{title:"Base Model",local:"smolagents.Model",headingTag:"h3"}}),be=new A({props:{name:"class smolagents.Model",anchor:"smolagents.Model",parameters:[{name:"flatten_messages_as_text",val:": bool = False"},{name:"tool_name_key",val:": str = 'name'"},{name:"tool_arguments_key",val:": str = 'arguments'"},{name:"model_id",val:": str | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.Model.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
Whether to flatten complex message content into plain text format.`,name:"flatten_messages_as_text"},{anchor:"smolagents.Model.tool_name_key",description:`<strong>tool_name_key</strong> (<code>str</code>, default <code>&quot;name&quot;</code>) &#x2014;
The key used to extract tool names from model responses.`,name:"tool_name_key"},{anchor:"smolagents.Model.tool_arguments_key",description:`<strong>tool_arguments_key</strong> (<code>str</code>, default <code>&quot;arguments&quot;</code>) &#x2014;
The key used to extract tool arguments from model responses.`,name:"tool_arguments_key"},{anchor:"smolagents.Model.model_id",description:`<strong>model_id</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Identifier for the specific model being used.`,name:"model_id"},{anchor:"smolagents.Model.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying model completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L390"}}),Y=new P({props:{anchor:"smolagents.Model.example",$$slots:{default:[Bo]},$$scope:{ctx:j}}}),je=new A({props:{name:"generate",anchor:"smolagents.Model.generate",parameters:[{name:"messages",val:": list"},{name:"stop_sequences",val:": list[str] | None = None"},{name:"response_format",val:": dict[str, str] | None = None"},{name:"tools_to_call_from",val:": list[smolagents.tools.Tool] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.Model.generate.messages",description:`<strong>messages</strong> (<code>list[dict[str, str | list[dict]]] | list[ChatMessage]</code>) &#x2014;
A list of message dictionaries to be processed. Each dictionary should have the structure <code>{&quot;role&quot;: &quot;user/system&quot;, &quot;content&quot;: &quot;message content&quot;}</code>.`,name:"messages"},{anchor:"smolagents.Model.generate.stop_sequences",description:`<strong>stop_sequences</strong> (<code>List[str]</code>, <em>optional</em>) &#x2014;
A list of strings that will stop the generation if encountered in the model&#x2019;s output.`,name:"stop_sequences"},{anchor:"smolagents.Model.generate.response_format",description:`<strong>response_format</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
The response format to use in the model&#x2019;s response.`,name:"response_format"},{anchor:"smolagents.Model.generate.tools_to_call_from",description:`<strong>tools_to_call_from</strong> (<code>List[Tool]</code>, <em>optional</em>) &#x2014;
A list of tools that the model can use to generate responses.`,name:"tools_to_call_from"},{anchor:"smolagents.Model.generate.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to be passed to the underlying model.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L487",returnDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<p>A chat message object containing the model’s response.</p>
`,returnType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ChatMessage</code></p>
`}}),_e=new A({props:{name:"parse_tool_calls",anchor:"smolagents.Model.parse_tool_calls",parameters:[{name:"message",val:": ChatMessage"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L517"}}),$e=new A({props:{name:"to_dict",anchor:"smolagents.Model.to_dict",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L530"}}),Ie=new L({props:{title:"API Model",local:"smolagents.ApiModel",headingTag:"h3"}}),ve=new A({props:{name:"class smolagents.ApiModel",anchor:"smolagents.ApiModel",parameters:[{name:"model_id",val:": str"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"client",val:": typing.Optional[typing.Any] = None"},{name:"requests_per_minute",val:": float | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.ApiModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The identifier for the model to be used with the API.`,name:"model_id"},{anchor:"smolagents.ApiModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str</code>], <strong>optional</strong>) &#x2014;
Mapping to convert  between internal role names and API-specific role names. Defaults to None.`,name:"custom_role_conversions"},{anchor:"smolagents.ApiModel.client",description:`<strong>client</strong> (<code>Any</code>, <strong>optional</strong>) &#x2014;
Pre-configured API client instance. If not provided, a default client will be created. Defaults to None.`,name:"client"},{anchor:"smolagents.ApiModel.requests_per_minute",description:`<strong>requests_per_minute</strong> (<code>float</code>, <strong>optional</strong>) &#x2014;
Rate limit in requests per minute.`,name:"requests_per_minute"},{anchor:"smolagents.ApiModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying model completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1053"}}),Ce=new A({props:{name:"create_client",anchor:"smolagents.ApiModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1087"}}),ke=new L({props:{title:"TransformersModel",local:"smolagents.TransformersModel",headingTag:"h3"}}),Ae=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBUcmFuc2Zvcm1lcnNNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwVHJhbnNmb3JtZXJzTW9kZWwobW9kZWxfaWQlM0QlMjJIdWdnaW5nRmFjZVRCJTJGU21vbExNLTEzNU0tSW5zdHJ1Y3QlMjIpJTBBJTBBcHJpbnQobW9kZWwoJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTVCJTdCJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIyT2shJTIyJTdEJTVEJTdEJTVEJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJncmVhdCUyMiU1RCkp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> TransformersModel

model = TransformersModel(model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>)

<span class="hljs-built_in">print</span>(model([{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Ok!&quot;</span>}]}], stop_sequences=[<span class="hljs-string">&quot;great&quot;</span>]))`,wrap:!1}}),Ee=new I({props:{code:"V2hhdCUyMGE=",highlighted:"&gt;&gt;&gt; What a",wrap:!1}}),qe=new I({props:{code:"bW9kZWwlMjAlM0QlMjBUcmFuc2Zvcm1lcnNNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMkh1Z2dpbmdGYWNlVEIlMkZTbW9sTE0tMTM1TS1JbnN0cnVjdCUyMiUyQyUwQSUyMCUyMCUyMCUyMHRlbXBlcmF0dXJlJTNEMC43JTJDJTBBJTIwJTIwJTIwJTIwbWF4X25ld190b2tlbnMlM0QxMDAwJTBBKQ==",highlighted:`model = TransformersModel(
    model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>,
    temperature=<span class="hljs-number">0.7</span>,
    max_new_tokens=<span class="hljs-number">1000</span>
)`,wrap:!1}}),te=new Vt({props:{warning:!1,$$slots:{default:[Zo]},$$scope:{ctx:j}}}),Le=new A({props:{name:"class smolagents.TransformersModel",anchor:"smolagents.TransformersModel",parameters:[{name:"model_id",val:": str | None = None"},{name:"device_map",val:": str | None = None"},{name:"torch_dtype",val:": str | None = None"},{name:"trust_remote_code",val:": bool = False"},{name:"model_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"max_new_tokens",val:": int = 4096"},{name:"max_tokens",val:": int | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.TransformersModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The Hugging Face model ID to be used for inference. This can be a path or model identifier from the Hugging Face model hub.
For example, <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>.`,name:"model_id"},{anchor:"smolagents.TransformersModel.device_map",description:`<strong>device_map</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The device_map to initialize your model with.`,name:"device_map"},{anchor:"smolagents.TransformersModel.torch_dtype",description:`<strong>torch_dtype</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The torch_dtype to initialize your model with.`,name:"torch_dtype"},{anchor:"smolagents.TransformersModel.trust_remote_code",description:`<strong>trust_remote_code</strong> (bool, default <code>False</code>) &#x2014;
Some models on the Hub require running remote code: for this model, you would have to set this flag to True.`,name:"trust_remote_code"},{anchor:"smolagents.TransformersModel.model_kwargs",description:`<strong>model_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to <code>AutoModel.from_pretrained</code> (like revision, model_args, config, etc.).`,name:"model_kwargs"},{anchor:"smolagents.TransformersModel.max_new_tokens",description:`<strong>max_new_tokens</strong> (<code>int</code>, default <code>4096</code>) &#x2014;
Maximum number of new tokens to generate, ignoring the number of tokens in the prompt.`,name:"max_new_tokens"},{anchor:"smolagents.TransformersModel.max_tokens",description:`<strong>max_tokens</strong> (<code>int</code>, <em>optional</em>) &#x2014;
Alias for <code>max_new_tokens</code>. If provided, this value takes precedence.`,name:"max_tokens"},{anchor:"smolagents.TransformersModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Transformers model generate call, such as <code>device</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L782",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ValueError</code> —
If the model name is not provided.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code></p>
`}}),se=new Vt({props:{warning:!1,$$slots:{default:[Qo]},$$scope:{ctx:j}}}),ne=new P({props:{anchor:"smolagents.TransformersModel.example",$$slots:{default:[Wo]},$$scope:{ctx:j}}}),Be=new L({props:{title:"InferenceClientModel",local:"smolagents.InferenceClientModel",headingTag:"h3"}}),We=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCUwQSUwQW1lc3NhZ2VzJTIwJTNEJTIwJTVCJTBBJTIwJTIwJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTVCJTdCJTIydHlwZSUyMiUzQSUyMCUyMnRleHQlMjIlMkMlMjAlMjJ0ZXh0JTIyJTNBJTIwJTIySGVsbG8lMkMlMjBob3clMjBhcmUlMjB5b3UlM0YlMjIlN0QlNUQlN0QlMEElNUQlMEElMEFtb2RlbCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudE1vZGVsKHByb3ZpZGVyJTNEJTIybm92aXRhJTIyJTJDJTIwcmVxdWVzdHNfcGVyX21pbnV0ZSUzRDYwKSUwQXByaW50KG1vZGVsKG1lc3NhZ2VzKSk=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> InferenceClientModel

messages = [
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>}]}
]

model = InferenceClientModel(provider=<span class="hljs-string">&quot;novita&quot;</span>, requests_per_minute=<span class="hljs-number">60</span>)
<span class="hljs-built_in">print</span>(model(messages))`,wrap:!1}}),Se=new I({props:{code:"T2YlMjBjb3Vyc2UhJTIwSWYlMjB5b3UlMjBjaGFuZ2UlMjB5b3VyJTIwbWluZCUyQyUyMGZlZWwlMjBmcmVlJTIwdG8lMjByZWFjaCUyMG91dC4lMjBUYWtlJTIwY2FyZSE=",highlighted:"&gt;&gt;&gt; Of course! If you change your mind, feel free to reach out. Take care!",wrap:!1}}),Re=new I({props:{code:"bW9kZWwlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnRNb2RlbCglMEElMjAlMjAlMjAlMjBwcm92aWRlciUzRCUyMm5vdml0YSUyMiUyQyUwQSUyMCUyMCUyMCUyMHJlcXVlc3RzX3Blcl9taW51dGUlM0Q2MCUyQyUwQSUyMCUyMCUyMCUyMHRlbXBlcmF0dXJlJTNEMC44JTJDJTBBJTIwJTIwJTIwJTIwbWF4X3Rva2VucyUzRDUwMCUwQSk=",highlighted:`model = InferenceClientModel(
    provider=<span class="hljs-string">&quot;novita&quot;</span>,
    requests_per_minute=<span class="hljs-number">60</span>,
    temperature=<span class="hljs-number">0.8</span>,
    max_tokens=<span class="hljs-number">500</span>
)`,wrap:!1}}),ze=new A({props:{name:"class smolagents.InferenceClientModel",anchor:"smolagents.InferenceClientModel",parameters:[{name:"model_id",val:": str = 'Qwen/Qwen2.5-Coder-32B-Instruct'"},{name:"provider",val:": str | None = None"},{name:"token",val:": str | None = None"},{name:"timeout",val:": int = 120"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"api_key",val:": str | None = None"},{name:"bill_to",val:": str | None = None"},{name:"base_url",val:": str | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.InferenceClientModel.model_id",description:`<strong>model_id</strong> (<code>str</code>, <em>optional</em>, default <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>) &#x2014;
The Hugging Face model ID to be used for inference.
This can be a model identifier from the Hugging Face model hub or a URL to a deployed Inference Endpoint.
Currently, it defaults to <code>&quot;Qwen/Qwen2.5-Coder-32B-Instruct&quot;</code>, but this may change in the future.`,name:"model_id"},{anchor:"smolagents.InferenceClientModel.provider",description:`<strong>provider</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Name of the provider to use for inference. A list of supported providers can be found in the <a href="https://huggingface.co/docs/inference-providers/index#partners" rel="nofollow">Inference Providers documentation</a>.
Defaults to &#x201C;auto&#x201D; i.e. the first of the providers available for the model, sorted by the user&#x2019;s order <a href="https://hf.co/settings/inference-providers" rel="nofollow">here</a>.
If <code>base_url</code> is passed, then <code>provider</code> is not used.`,name:"provider"},{anchor:"smolagents.InferenceClientModel.token",description:`<strong>token</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Token used by the Hugging Face API for authentication. This token need to be authorized &#x2018;Make calls to the serverless Inference Providers&#x2019;.
If the model is gated (like Llama-3 models), the token also needs &#x2018;Read access to contents of all public gated repos you can access&#x2019;.
If not provided, the class will try to use environment variable &#x2018;HF_TOKEN&#x2019;, else use the token stored in the Hugging Face CLI configuration.`,name:"token"},{anchor:"smolagents.InferenceClientModel.timeout",description:`<strong>timeout</strong> (<code>int</code>, <em>optional</em>, defaults to 120) &#x2014;
Timeout for the API request, in seconds.`,name:"timeout"},{anchor:"smolagents.InferenceClientModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the Hugging Face InferenceClient.`,name:"client_kwargs"},{anchor:"smolagents.InferenceClientModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.InferenceClientModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
Token to use for authentication. This is a duplicated argument from <code>token</code> to make <a href="/docs/smolagents/main/en/reference/models#smolagents.InferenceClientModel">InferenceClientModel</a>
follow the same pattern as <code>openai.OpenAI</code> client. Cannot be used if <code>token</code> is set. Defaults to None.`,name:"api_key"},{anchor:"smolagents.InferenceClientModel.bill_to",description:`<strong>bill_to</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The billing account to use for the requests. By default the requests are billed on the user&#x2019;s account. Requests can only be billed to
an organization the user is a member of, and which has subscribed to Enterprise Hub.`,name:"bill_to"},{anchor:"smolagents.InferenceClientModel.base_url",description:`<strong>base_url</strong> (<code>str</code>, <code>optional</code>) &#x2014;
Base URL to run inference. This is a duplicated argument from <code>model</code> to make <a href="/docs/smolagents/main/en/reference/models#smolagents.InferenceClientModel">InferenceClientModel</a>
follow the same pattern as <code>openai.OpenAI</code> client. Cannot be used if <code>model</code> is set. Defaults to None.`,name:"base_url"},{anchor:"smolagents.InferenceClientModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Hugging Face InferenceClient completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1339",raiseDescription:`<script context="module">export const metadata = 'undefined';<\/script>


<ul>
<li><code>ValueError</code> —
If the model name is not provided.</li>
</ul>
`,raiseType:`<script context="module">export const metadata = 'undefined';<\/script>


<p><code>ValueError</code></p>
`}}),le=new P({props:{anchor:"smolagents.InferenceClientModel.example",$$slots:{default:[So]},$$scope:{ctx:j}}}),Xe=new A({props:{name:"create_client",anchor:"smolagents.InferenceClientModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1430"}}),Fe=new L({props:{title:"LiteLLMModel",local:"smolagents.LiteLLMModel",headingTag:"h3"}}),He=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBMaXRlTExNTW9kZWwlMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMkhlbGxvJTJDJTIwaG93JTIwYXJlJTIweW91JTNGJTIyJTdEJTVEJTdEJTBBJTVEJTBBJTBBbW9kZWwlMjAlM0QlMjBMaXRlTExNTW9kZWwobW9kZWxfaWQlM0QlMjJhbnRocm9waWMlMkZjbGF1ZGUtMy01LXNvbm5ldC1sYXRlc3QlMjIlMkMlMjB0ZW1wZXJhdHVyZSUzRDAuMiUyQyUyMG1heF90b2tlbnMlM0QxMCUyQyUyMHJlcXVlc3RzX3Blcl9taW51dGUlM0Q2MCklMEFwcmludChtb2RlbChtZXNzYWdlcykp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> LiteLLMModel

messages = [
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>}]}
]

model = LiteLLMModel(model_id=<span class="hljs-string">&quot;anthropic/claude-3-5-sonnet-latest&quot;</span>, temperature=<span class="hljs-number">0.2</span>, max_tokens=<span class="hljs-number">10</span>, requests_per_minute=<span class="hljs-number">60</span>)
<span class="hljs-built_in">print</span>(model(messages))`,wrap:!1}}),Pe=new A({props:{name:"class smolagents.LiteLLMModel",anchor:"smolagents.LiteLLMModel",parameters:[{name:"model_id",val:": str | None = None"},{name:"api_base",val:": str | None = None"},{name:"api_key",val:": str | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"flatten_messages_as_text",val:": bool | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.LiteLLMModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model identifier to use on the server (e.g. &#x201C;gpt-3.5-turbo&#x201D;).`,name:"model_id"},{anchor:"smolagents.LiteLLMModel.api_base",description:`<strong>api_base</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The base URL of the provider API to call the model.`,name:"api_base"},{anchor:"smolagents.LiteLLMModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use for authentication.`,name:"api_key"},{anchor:"smolagents.LiteLLMModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.LiteLLMModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, <em>optional</em>) &#x2014; Whether to flatten messages as text.
Defaults to <code>True</code> for models that start with &#x201C;ollama&#x201D;, &#x201C;groq&#x201D;, &#x201C;cerebras&#x201D;.`,name:"flatten_messages_as_text"},{anchor:"smolagents.LiteLLMModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying LiteLLM completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1096"}}),Ye=new A({props:{name:"create_client",anchor:"smolagents.LiteLLMModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1146"}}),De=new L({props:{title:"LiteLLMRouterModel",local:"smolagents.LiteLLMRouterModel",headingTag:"h3"}}),Ke=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBMaXRlTExNUm91dGVyTW9kZWwlMEElMEFtZXNzYWdlcyUyMCUzRCUyMCU1QiUwQSUyMCUyMCU3QiUyMnJvbGUlMjIlM0ElMjAlMjJ1c2VyJTIyJTJDJTIwJTIyY29udGVudCUyMiUzQSUyMCU1QiU3QiUyMnR5cGUlMjIlM0ElMjAlMjJ0ZXh0JTIyJTJDJTIwJTIydGV4dCUyMiUzQSUyMCUyMkhlbGxvJTJDJTIwaG93JTIwYXJlJTIweW91JTNGJTIyJTdEJTVEJTdEJTBBJTVEJTBBJTBBbW9kZWwlMjAlM0QlMjBMaXRlTExNUm91dGVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlM0QlMjJsbGFtYS0zLjMtNzBiJTIyJTJDJTBBJTIwJTIwJTIwJTIwbW9kZWxfbGlzdCUzRCU1QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3QiUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMm1vZGVsX25hbWUlMjIlM0ElMjAlMjJsbGFtYS0zLjMtNzBiJTIyJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybGl0ZWxsbV9wYXJhbXMlMjIlM0ElMjAlN0IlMjJtb2RlbCUyMiUzQSUyMCUyMmdyb3ElMkZsbGFtYS0zLjMtNzBiJTIyJTJDJTIwJTIyYXBpX2tleSUyMiUzQSUyMG9zLmdldGVudiglMjJHUk9RX0FQSV9LRVklMjIpJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdEJTJDJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTdCJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIybW9kZWxfbmFtZSUyMiUzQSUyMCUyMmxsYW1hLTMuMy03MGIlMjIlMkMlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJsaXRlbGxtX3BhcmFtcyUyMiUzQSUyMCU3QiUyMm1vZGVsJTIyJTNBJTIwJTIyY2VyZWJyYXMlMkZsbGFtYS0zLjMtNzBiJTIyJTJDJTIwJTIyYXBpX2tleSUyMiUzQSUyMG9zLmdldGVudiglMjJDRVJFQlJBU19BUElfS0VZJTIyKSU3RCUyQyUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMCU3RCUyQyUwQSUyMCUyMCUyMCUyMCU1RCUyQyUwQSUyMCUyMCUyMCUyMGNsaWVudF9rd2FyZ3MlM0QlN0IlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjJyb3V0aW5nX3N0cmF0ZWd5JTIyJTNBJTIwJTIyc2ltcGxlLXNodWZmbGUlMjIlMkMlMEElMjAlMjAlMjAlMjAlN0QlMkMlMEEpJTBBcHJpbnQobW9kZWwobWVzc2FnZXMpKQ==",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> LiteLLMRouterModel

messages = [
  {<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: [{<span class="hljs-string">&quot;type&quot;</span>: <span class="hljs-string">&quot;text&quot;</span>, <span class="hljs-string">&quot;text&quot;</span>: <span class="hljs-string">&quot;Hello, how are you?&quot;</span>}]}
]

model = LiteLLMRouterModel(
    model_id=<span class="hljs-string">&quot;llama-3.3-70b&quot;</span>,
    model_list=[
        {
            <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">&quot;llama-3.3-70b&quot;</span>,
            <span class="hljs-string">&quot;litellm_params&quot;</span>: {<span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;groq/llama-3.3-70b&quot;</span>, <span class="hljs-string">&quot;api_key&quot;</span>: os.getenv(<span class="hljs-string">&quot;GROQ_API_KEY&quot;</span>)},
        },
        {
            <span class="hljs-string">&quot;model_name&quot;</span>: <span class="hljs-string">&quot;llama-3.3-70b&quot;</span>,
            <span class="hljs-string">&quot;litellm_params&quot;</span>: {<span class="hljs-string">&quot;model&quot;</span>: <span class="hljs-string">&quot;cerebras/llama-3.3-70b&quot;</span>, <span class="hljs-string">&quot;api_key&quot;</span>: os.getenv(<span class="hljs-string">&quot;CEREBRAS_API_KEY&quot;</span>)},
        },
    ],
    client_kwargs={
        <span class="hljs-string">&quot;routing_strategy&quot;</span>: <span class="hljs-string">&quot;simple-shuffle&quot;</span>,
    },
)
<span class="hljs-built_in">print</span>(model(messages))`,wrap:!1}}),et=new A({props:{name:"class smolagents.LiteLLMRouterModel",anchor:"smolagents.LiteLLMRouterModel",parameters:[{name:"model_id",val:": str"},{name:"model_list",val:": list"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"flatten_messages_as_text",val:": bool | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.LiteLLMRouterModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
Identifier for the model group to use from the model list (e.g., &#x201C;model-group-1&#x201D;).`,name:"model_id"},{anchor:"smolagents.LiteLLMRouterModel.model_list",description:`<strong>model_list</strong> (<code>list[dict[str, Any]]</code>) &#x2014;
Model configurations to be used for routing.
Each configuration should include the model group name and any necessary parameters.
For more details, refer to the <a href="https://docs.litellm.ai/docs/routing#quick-start" rel="nofollow">LiteLLM Routing</a> documentation.`,name:"model_list"},{anchor:"smolagents.LiteLLMRouterModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional configuration parameters for the Router client. For more details, see the
<a href="https://docs.litellm.ai/docs/routing" rel="nofollow">LiteLLM Routing Configurations</a>.`,name:"client_kwargs"},{anchor:"smolagents.LiteLLMRouterModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.LiteLLMRouterModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, <em>optional</em>) &#x2014; Whether to flatten messages as text.
Defaults to <code>True</code> for models that start with &#x201C;ollama&#x201D;, &#x201C;groq&#x201D;, &#x201C;cerebras&#x201D;.`,name:"flatten_messages_as_text"},{anchor:"smolagents.LiteLLMRouterModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying LiteLLM Router completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1246"}}),re=new P({props:{anchor:"smolagents.LiteLLMRouterModel.example",$$slots:{default:[Vo]},$$scope:{ctx:j}}}),tt=new L({props:{title:"OpenAIServerModel",local:"smolagents.OpenAIServerModel",headingTag:"h3"}}),nt=new I({props:{code:"aW1wb3J0JTIwb3MlMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyME9wZW5BSVNlcnZlck1vZGVsJTBBJTBBbW9kZWwlMjAlM0QlMjBPcGVuQUlTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMmdwdC00byUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9iYXNlJTNEJTIyaHR0cHMlM0ElMkYlMkZhcGkub3BlbmFpLmNvbSUyRnYxJTIyJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRG9zLmVudmlyb24lNUIlMjJPUEVOQUlfQVBJX0tFWSUyMiU1RCUyQyUwQSk=",highlighted:`<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> OpenAIServerModel

model = OpenAIServerModel(
    model_id=<span class="hljs-string">&quot;gpt-4o&quot;</span>,
    api_base=<span class="hljs-string">&quot;https://api.openai.com/v1&quot;</span>,
    api_key=os.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>],
)`,wrap:!1}}),ot=new I({props:{code:"bW9kZWwlMjAlM0QlMjBPcGVuQUlTZXJ2ZXJNb2RlbCglMEElMjAlMjAlMjAlMjBtb2RlbF9pZCUzRCUyMmdwdC00byUyMiUyQyUwQSUyMCUyMCUyMCUyMGFwaV9iYXNlJTNEJTIyaHR0cHMlM0ElMkYlMkZhcGkub3BlbmFpLmNvbSUyRnYxJTIyJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRG9zLmVudmlyb24lNUIlMjJPUEVOQUlfQVBJX0tFWSUyMiU1RCUyQyUwQSUyMCUyMCUyMCUyMHRlbXBlcmF0dXJlJTNEMC43JTJDJTBBJTIwJTIwJTIwJTIwbWF4X3Rva2VucyUzRDEwMDAlMkMlMEElMjAlMjAlMjAlMjB0b3BfcCUzRDAuOSUyQyUwQSk=",highlighted:`model = OpenAIServerModel(
    model_id=<span class="hljs-string">&quot;gpt-4o&quot;</span>,
    api_base=<span class="hljs-string">&quot;https://api.openai.com/v1&quot;</span>,
    api_key=os.environ[<span class="hljs-string">&quot;OPENAI_API_KEY&quot;</span>],
    temperature=<span class="hljs-number">0.7</span>,
    max_tokens=<span class="hljs-number">1000</span>,
    top_p=<span class="hljs-number">0.9</span>,
)`,wrap:!1}}),at=new A({props:{name:"class smolagents.OpenAIServerModel",anchor:"smolagents.OpenAIServerModel",parameters:[{name:"model_id",val:": str"},{name:"api_base",val:": str | None = None"},{name:"api_key",val:": str | None = None"},{name:"organization",val:": str | None = None"},{name:"project",val:": str | None = None"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"flatten_messages_as_text",val:": bool = False"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.OpenAIServerModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model identifier to use on the server (e.g. &#x201C;gpt-3.5-turbo&#x201D;).`,name:"model_id"},{anchor:"smolagents.OpenAIServerModel.api_base",description:`<strong>api_base</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The base URL of the OpenAI-compatible API server.`,name:"api_base"},{anchor:"smolagents.OpenAIServerModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use for authentication.`,name:"api_key"},{anchor:"smolagents.OpenAIServerModel.organization",description:`<strong>organization</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The organization to use for the API request.`,name:"organization"},{anchor:"smolagents.OpenAIServerModel.project",description:`<strong>project</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The project to use for the API request.`,name:"project"},{anchor:"smolagents.OpenAIServerModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the OpenAI client (like organization, project, max_retries etc.).`,name:"client_kwargs"},{anchor:"smolagents.OpenAIServerModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.OpenAIServerModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
Whether to flatten messages as text.`,name:"flatten_messages_as_text"},{anchor:"smolagents.OpenAIServerModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying OpenAI API completion call, for instance <code>temperature</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1521"}}),rt=new L({props:{title:"AzureOpenAIServerModel",local:"smolagents.AzureOpenAIServerModel",headingTag:"h3"}}),dt=new I({props:{code:"aW1wb3J0JTIwb3MlMEElMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMEF6dXJlT3BlbkFJU2VydmVyTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMEF6dXJlT3BlbkFJU2VydmVyTW9kZWwoJTBBJTIwJTIwJTIwJTIwbW9kZWxfaWQlMjAlM0QlMjBvcy5lbnZpcm9uLmdldCglMjJBWlVSRV9PUEVOQUlfTU9ERUwlMjIpJTJDJTBBJTIwJTIwJTIwJTIwYXp1cmVfZW5kcG9pbnQlM0Rvcy5lbnZpcm9uLmdldCglMjJBWlVSRV9PUEVOQUlfRU5EUE9JTlQlMjIpJTJDJTBBJTIwJTIwJTIwJTIwYXBpX2tleSUzRG9zLmVudmlyb24uZ2V0KCUyMkFaVVJFX09QRU5BSV9BUElfS0VZJTIyKSUyQyUwQSUyMCUyMCUyMCUyMGFwaV92ZXJzaW9uJTNEb3MuZW52aXJvbi5nZXQoJTIyT1BFTkFJX0FQSV9WRVJTSU9OJTIyKSUyMCUyMCUyMCUyMCUwQSk=",highlighted:`<span class="hljs-keyword">import</span> os

<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> AzureOpenAIServerModel

model = AzureOpenAIServerModel(
    model_id = os.environ.get(<span class="hljs-string">&quot;AZURE_OPENAI_MODEL&quot;</span>),
    azure_endpoint=os.environ.get(<span class="hljs-string">&quot;AZURE_OPENAI_ENDPOINT&quot;</span>),
    api_key=os.environ.get(<span class="hljs-string">&quot;AZURE_OPENAI_API_KEY&quot;</span>),
    api_version=os.environ.get(<span class="hljs-string">&quot;OPENAI_API_VERSION&quot;</span>)    
)`,wrap:!1}}),pt=new A({props:{name:"class smolagents.AzureOpenAIServerModel",anchor:"smolagents.AzureOpenAIServerModel",parameters:[{name:"model_id",val:": str"},{name:"azure_endpoint",val:": str | None = None"},{name:"api_key",val:": str | None = None"},{name:"api_version",val:": str | None = None"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.AzureOpenAIServerModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model deployment name to use when connecting (e.g. &#x201C;gpt-4o-mini&#x201D;).`,name:"model_id"},{anchor:"smolagents.AzureOpenAIServerModel.azure_endpoint",description:`<strong>azure_endpoint</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The Azure endpoint, including the resource, e.g. <code>https://example-resource.azure.openai.com/</code>. If not provided, it will be inferred from the <code>AZURE_OPENAI_ENDPOINT</code> environment variable.`,name:"azure_endpoint"},{anchor:"smolagents.AzureOpenAIServerModel.api_key",description:`<strong>api_key</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API key to use for authentication. If not provided, it will be inferred from the <code>AZURE_OPENAI_API_KEY</code> environment variable.`,name:"api_key"},{anchor:"smolagents.AzureOpenAIServerModel.api_version",description:`<strong>api_version</strong> (<code>str</code>, <em>optional</em>) &#x2014;
The API version to use. If not provided, it will be inferred from the <code>OPENAI_API_VERSION</code> environment variable.`,name:"api_version"},{anchor:"smolagents.AzureOpenAIServerModel.client_kwargs",description:`<strong>client_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the AzureOpenAI client (like organization, project, max_retries etc.).`,name:"client_kwargs"},{anchor:"smolagents.AzureOpenAIServerModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.`,name:"custom_role_conversions"},{anchor:"smolagents.AzureOpenAIServerModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Azure OpenAI API completion call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1666"}}),gt=new L({props:{title:"AmazonBedrockServerModel",local:"smolagents.AmazonBedrockServerModel",headingTag:"h3"}}),ht=new I({props:{code:"aW1wb3J0JTIwb3MlMEElMEFmcm9tJTIwc21vbGFnZW50cyUyMGltcG9ydCUyMEFtYXpvbkJlZHJvY2tTZXJ2ZXJNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwQW1hem9uQmVkcm9ja1NlcnZlck1vZGVsKCUwQSUyMCUyMCUyMCUyMG1vZGVsX2lkJTIwJTNEJTIwb3MuZW52aXJvbi5nZXQoJTIyQU1BWk9OX0JFRFJPQ0tfTU9ERUxfSUQlMjIpJTJDJTBBKQ==",highlighted:`<span class="hljs-keyword">import</span> os

<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> AmazonBedrockServerModel

model = AmazonBedrockServerModel(
    model_id = os.environ.get(<span class="hljs-string">&quot;AMAZON_BEDROCK_MODEL_ID&quot;</span>),
)`,wrap:!1}}),ft=new A({props:{name:"class smolagents.AmazonBedrockServerModel",anchor:"smolagents.AmazonBedrockServerModel",parameters:[{name:"model_id",val:": str"},{name:"client",val:" = None"},{name:"client_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"custom_role_conversions",val:": dict[str, str] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.AmazonBedrockServerModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The model identifier to use on Bedrock (e.g. &#x201C;us.amazon.nova-pro-v1:0&#x201D;).`,name:"model_id"},{anchor:"smolagents.AmazonBedrockServerModel.client",description:`<strong>client</strong> (<code>boto3.client</code>, <em>optional</em>) &#x2014;
A custom boto3 client for AWS interactions. If not provided, a default client will be created.`,name:"client"},{anchor:"smolagents.AmazonBedrockServerModel.client_kwargs",description:`<strong>client_kwargs</strong> (dict[str, Any], <em>optional</em>) &#x2014;
Keyword arguments used to configure the boto3 client if it needs to be created internally.
Examples include <code>region_name</code>, <code>config</code>, or <code>endpoint_url</code>.`,name:"client_kwargs"},{anchor:"smolagents.AmazonBedrockServerModel.custom_role_conversions",description:`<strong>custom_role_conversions</strong> (<code>dict[str, str]</code>, <em>optional</em>) &#x2014;
Custom role conversion mapping to convert message roles in others.
Useful for specific models that do not support specific message roles like &#x201C;system&#x201D;.
Defaults to converting all roles to &#x201C;user&#x201D; role to enable using all the Bedrock models.`,name:"custom_role_conversions"},{anchor:"smolagents.AmazonBedrockServerModel.flatten_messages_as_text",description:`<strong>flatten_messages_as_text</strong> (<code>bool</code>, default <code>False</code>) &#x2014;
Whether to flatten messages as text.`,name:"flatten_messages_as_text"},{anchor:"smolagents.AmazonBedrockServerModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying Amazon Bedrock model converse call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1726"}}),ie=new Vt({props:{warning:!1,$$slots:{default:[Ro]},$$scope:{ctx:j}}}),me=new P({props:{anchor:"smolagents.AmazonBedrockServerModel.example",$$slots:{default:[zo]},$$scope:{ctx:j}}}),ce=new P({props:{anchor:"smolagents.AmazonBedrockServerModel.example-2",$$slots:{default:[Xo]},$$scope:{ctx:j}}}),de=new P({props:{anchor:"smolagents.AmazonBedrockServerModel.example-3",$$slots:{default:[Fo]},$$scope:{ctx:j}}}),pe=new P({props:{anchor:"smolagents.AmazonBedrockServerModel.example-4",$$slots:{default:[Go]},$$scope:{ctx:j}}}),yt=new L({props:{title:"MLXModel",local:"smolagents.MLXModel",headingTag:"h3"}}),wt=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBNTFhNb2RlbCUwQSUwQW1vZGVsJTIwJTNEJTIwTUxYTW9kZWwobW9kZWxfaWQlM0QlMjJIdWdnaW5nRmFjZVRCJTJGU21vbExNLTEzNU0tSW5zdHJ1Y3QlMjIpJTBBJTBBcHJpbnQobW9kZWwoJTVCJTdCJTIycm9sZSUyMiUzQSUyMCUyMnVzZXIlMjIlMkMlMjAlMjJjb250ZW50JTIyJTNBJTIwJTIyT2shJTIyJTdEJTVEJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJncmVhdCUyMiU1RCkp",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> MLXModel

model = MLXModel(model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>)

<span class="hljs-built_in">print</span>(model([{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Ok!&quot;</span>}], stop_sequences=[<span class="hljs-string">&quot;great&quot;</span>]))`,wrap:!1}}),Tt=new I({props:{code:"V2hhdCUyMGE=",highlighted:"&gt;&gt;&gt; What a",wrap:!1}}),ge=new Vt({props:{warning:!1,$$slots:{default:[Ho]},$$scope:{ctx:j}}}),Jt=new A({props:{name:"class smolagents.MLXModel",anchor:"smolagents.MLXModel",parameters:[{name:"model_id",val:": str"},{name:"trust_remote_code",val:": bool = False"},{name:"load_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"apply_chat_template_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.MLXModel.model_id",description:`<strong>model_id</strong> (str) &#x2014;
The Hugging Face model ID to be used for inference. This can be a path or model identifier from the Hugging Face model hub.`,name:"model_id"},{anchor:"smolagents.MLXModel.tool_name_key",description:`<strong>tool_name_key</strong> (str) &#x2014;
The key, which can usually be found in the model&#x2019;s chat template, for retrieving a tool name.`,name:"tool_name_key"},{anchor:"smolagents.MLXModel.tool_arguments_key",description:`<strong>tool_arguments_key</strong> (str) &#x2014;
The key, which can usually be found in the model&#x2019;s chat template, for retrieving tool arguments.`,name:"tool_arguments_key"},{anchor:"smolagents.MLXModel.trust_remote_code",description:`<strong>trust_remote_code</strong> (bool, default <code>False</code>) &#x2014;
Some models on the Hub require running remote code: for this model, you would have to set this flag to True.`,name:"trust_remote_code"},{anchor:"smolagents.MLXModel.load_kwargs",description:`<strong>load_kwargs</strong> (dict[str, Any], <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the <code>mlx.lm.load</code> method when loading the model and tokenizer.`,name:"load_kwargs"},{anchor:"smolagents.MLXModel.apply_chat_template_kwargs",description:`<strong>apply_chat_template_kwargs</strong> (dict, <em>optional</em>) &#x2014;
Additional keyword arguments to pass to the <code>apply_chat_template</code> method of the tokenizer.`,name:"apply_chat_template_kwargs"},{anchor:"smolagents.MLXModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying MLX model stream_generate call, for instance <code>max_tokens</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L675"}}),ue=new Vt({props:{warning:!1,$$slots:{default:[Po]},$$scope:{ctx:j}}}),Me=new P({props:{anchor:"smolagents.MLXModel.example",$$slots:{default:[Yo]},$$scope:{ctx:j}}}),bt=new L({props:{title:"VLLMModel",local:"smolagents.VLLMModel",headingTag:"h3"}}),_t=new I({props:{code:"ZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBWTExNTW9kZWwlMEElMEFtb2RlbCUyMCUzRCUyMFZMTE1Nb2RlbChtb2RlbF9pZCUzRCUyMkh1Z2dpbmdGYWNlVEIlMkZTbW9sTE0tMTM1TS1JbnN0cnVjdCUyMiklMEElMEFwcmludChtb2RlbCglNUIlN0IlMjJyb2xlJTIyJTNBJTIwJTIydXNlciUyMiUyQyUyMCUyMmNvbnRlbnQlMjIlM0ElMjAlMjJPayElMjIlN0QlNUQlMkMlMjBzdG9wX3NlcXVlbmNlcyUzRCU1QiUyMmdyZWF0JTIyJTVEKSk=",highlighted:`<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> VLLMModel

model = VLLMModel(model_id=<span class="hljs-string">&quot;HuggingFaceTB/SmolLM-135M-Instruct&quot;</span>)

<span class="hljs-built_in">print</span>(model([{<span class="hljs-string">&quot;role&quot;</span>: <span class="hljs-string">&quot;user&quot;</span>, <span class="hljs-string">&quot;content&quot;</span>: <span class="hljs-string">&quot;Ok!&quot;</span>}], stop_sequences=[<span class="hljs-string">&quot;great&quot;</span>]))`,wrap:!1}}),he=new Vt({props:{warning:!1,$$slots:{default:[Do]},$$scope:{ctx:j}}}),$t=new A({props:{name:"class smolagents.VLLMModel",anchor:"smolagents.VLLMModel",parameters:[{name:"model_id",val:""},{name:"model_kwargs",val:": dict[str, typing.Any] | None = None"},{name:"**kwargs",val:""}],parametersDescription:[{anchor:"smolagents.VLLMModel.model_id",description:`<strong>model_id</strong> (<code>str</code>) &#x2014;
The Hugging Face model ID to be used for inference.
This can be a path or model identifier from the Hugging Face model hub.`,name:"model_id"},{anchor:"smolagents.VLLMModel.model_kwargs",description:`<strong>model_kwargs</strong> (<code>dict[str, Any]</code>, <em>optional</em>) &#x2014;
Additional keyword arguments to forward to the vLLM LLM instantiation, such as <code>revision</code>, <code>max_model_len</code>, etc.`,name:"model_kwargs"},{anchor:"smolagents.VLLMModel.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to forward to the underlying vLLM model generate call.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L567"}}),It=new L({props:{title:"Custom Model",local:"custom-model",headingTag:"h3"}}),xt=new I({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxvZ2luJTJDJTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBZnJvbSUyMHNtb2xhZ2VudHMlMjBpbXBvcnQlMjBNb2RlbCUwQSUwQWxvZ2luKCUyMiUzQ1lPVVJfSFVHR0lOR0ZBQ0VIVUJfQVBJX1RPS0VOJTNFJTIyKSUwQSUwQW1vZGVsX2lkJTIwJTNEJTIwJTIybWV0YS1sbGFtYSUyRkxsYW1hLTMuMy03MEItSW5zdHJ1Y3QlMjIlMEElMEFjbGllbnQlMjAlM0QlMjBJbmZlcmVuY2VDbGllbnQobW9kZWwlM0Rtb2RlbF9pZCklMEElMEFjbGFzcyUyMEN1c3RvbU1vZGVsKE1vZGVsKSUzQSUwQSUyMCUyMCUyMCUyMGRlZiUyMGdlbmVyYXRlKG1lc3NhZ2VzJTJDJTIwc3RvcF9zZXF1ZW5jZXMlM0QlNUIlMjJUYXNrJTIyJTVEKSUzQSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJlc3BvbnNlJTIwJTNEJTIwY2xpZW50LmNoYXRfY29tcGxldGlvbihtZXNzYWdlcyUyQyUyMHN0b3AlM0RzdG9wX3NlcXVlbmNlcyUyQyUyMG1heF90b2tlbnMlM0QxMDI0KSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMGFuc3dlciUyMCUzRCUyMHJlc3BvbnNlLmNob2ljZXMlNUIwJTVELm1lc3NhZ2UlMEElMjAlMjAlMjAlMjAlMjAlMjAlMjAlMjByZXR1cm4lMjBhbnN3ZXIlMEElMEFjdXN0b21fbW9kZWwlMjAlM0QlMjBDdXN0b21Nb2RlbCgp",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> login, InferenceClient

<span class="hljs-keyword">from</span> smolagents <span class="hljs-keyword">import</span> Model

login(<span class="hljs-string">&quot;&lt;YOUR_HUGGINGFACEHUB_API_TOKEN&gt;&quot;</span>)

model_id = <span class="hljs-string">&quot;meta-llama/Llama-3.3-70B-Instruct&quot;</span>

client = InferenceClient(model=model_id)

<span class="hljs-keyword">class</span> <span class="hljs-title class_">CustomModel</span>(<span class="hljs-title class_ inherited__">Model</span>):
    <span class="hljs-keyword">def</span> <span class="hljs-title function_">generate</span>(<span class="hljs-params">messages, stop_sequences=[<span class="hljs-string">&quot;Task&quot;</span>]</span>):
        response = client.chat_completion(messages, stop=stop_sequences, max_tokens=<span class="hljs-number">1024</span>)
        answer = response.choices[<span class="hljs-number">0</span>].message
        <span class="hljs-keyword">return</span> answer

custom_model = CustomModel()`,wrap:!1}}),Et=new qo({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/en/reference/models.md"}}),{c(){l=c("meta"),T=a(),i=c("p"),m=a(),g(J.$$.fragment),n=a(),g(b.$$.fragment),ws=a(),fe=c("p"),fe.innerHTML=kl,Ts=a(),g(ye.$$.fragment),Js=a(),we=c("p"),we.innerHTML=xl,bs=a(),g(Te.$$.fragment),js=a(),Je=c("p"),Je.innerHTML=Al,_s=a(),U=c("div"),g(be.$$.fragment),Bn=a(),Rt=c("p"),Rt.textContent=El,Zn=a(),zt=c("p"),zt.textContent=Nl,Qn=a(),Xt=c("p"),Xt.innerHTML=ql,Wn=a(),g(Y.$$.fragment),Sn=a(),D=c("div"),g(je.$$.fragment),Vn=a(),Ft=c("p"),Ft.textContent=Ll,Rn=a(),O=c("div"),g(_e.$$.fragment),zn=a(),Gt=c("p"),Gt.textContent=Bl,Xn=a(),K=c("div"),g($e.$$.fragment),Fn=a(),Ht=c("p"),Ht.textContent=Zl,$s=a(),g(Ie.$$.fragment),Is=a(),Ue=c("p"),Ue.innerHTML=Ql,Us=a(),B=c("div"),g(ve.$$.fragment),Gn=a(),Pt=c("p"),Pt.textContent=Wl,Hn=a(),Yt=c("p"),Yt.textContent=Sl,Pn=a(),ee=c("div"),g(Ce.$$.fragment),Yn=a(),Dt=c("p"),Dt.textContent=Vl,vs=a(),g(ke.$$.fragment),Cs=a(),xe=c("p"),xe.innerHTML=Rl,ks=a(),g(Ae.$$.fragment),xs=a(),g(Ee.$$.fragment),As=a(),Ne=c("p"),Ne.innerHTML=zl,Es=a(),g(qe.$$.fragment),Ns=a(),g(te.$$.fragment),qs=a(),N=c("div"),g(Le.$$.fragment),Dn=a(),Ot=c("p"),Ot.textContent=Xl,On=a(),Kt=c("p"),Kt.textContent=Fl,Kn=a(),g(se.$$.fragment),el=a(),g(ne.$$.fragment),Ls=a(),g(Be.$$.fragment),Bs=a(),Ze=c("p"),Ze.innerHTML=Gl,Zs=a(),Qe=c("p"),Qe.innerHTML=Hl,Qs=a(),g(We.$$.fragment),Ws=a(),g(Se.$$.fragment),Ss=a(),Ve=c("p"),Ve.innerHTML=Pl,Vs=a(),g(Re.$$.fragment),Rs=a(),x=c("div"),g(ze.$$.fragment),tl=a(),es=c("p"),es.textContent=Yl,sl=a(),ts=c("p"),ts.textContent=Dl,nl=a(),ss=c("p"),ss.textContent=Ol,ll=a(),g(le.$$.fragment),ol=a(),oe=c("div"),g(Xe.$$.fragment),al=a(),ns=c("p"),ns.textContent=Kl,zs=a(),g(Fe.$$.fragment),Xs=a(),Ge=c("p"),Ge.innerHTML=eo,Fs=a(),g(He.$$.fragment),Gs=a(),S=c("div"),g(Pe.$$.fragment),rl=a(),ls=c("p"),ls.innerHTML=to,il=a(),ae=c("div"),g(Ye.$$.fragment),ml=a(),os=c("p"),os.textContent=so,Hs=a(),g(De.$$.fragment),Ps=a(),Oe=c("p"),Oe.innerHTML=no,Ys=a(),g(Ke.$$.fragment),Ds=a(),Z=c("div"),g(et.$$.fragment),cl=a(),as=c("p"),as.innerHTML=lo,dl=a(),rs=c("p"),rs.textContent=oo,pl=a(),g(re.$$.fragment),Os=a(),g(tt.$$.fragment),Ks=a(),st=c("p"),st.innerHTML=ao,en=a(),g(nt.$$.fragment),tn=a(),lt=c("p"),lt.innerHTML=ro,sn=a(),g(ot.$$.fragment),nn=a(),X=c("div"),g(at.$$.fragment),gl=a(),is=c("p"),is.textContent=io,ln=a(),g(rt.$$.fragment),on=a(),it=c("p"),it.innerHTML=mo,an=a(),mt=c("p"),mt.innerHTML=co,rn=a(),ct=c("p"),ct.innerHTML=po,mn=a(),g(dt.$$.fragment),cn=a(),F=c("div"),g(pt.$$.fragment),ul=a(),ms=c("p"),ms.textContent=go,dn=a(),g(gt.$$.fragment),pn=a(),ut=c("p"),ut.innerHTML=uo,gn=a(),Mt=c("p"),Mt.textContent=Mo,un=a(),g(ht.$$.fragment),Mn=a(),_=c("div"),g(ft.$$.fragment),Ml=a(),cs=c("p"),cs.textContent=ho,hl=a(),ds=c("p"),ds.textContent=fo,fl=a(),ps=c("p"),ps.textContent=yo,yl=a(),gs=c("p"),gs.textContent=wo,wl=a(),us=c("ul"),us.innerHTML=To,Tl=a(),g(ie.$$.fragment),Jl=a(),Ms=c("p"),Ms.textContent=Jo,bl=a(),g(me.$$.fragment),jl=a(),g(ce.$$.fragment),_l=a(),g(de.$$.fragment),$l=a(),g(pe.$$.fragment),hn=a(),g(yt.$$.fragment),fn=a(),g(wt.$$.fragment),yn=a(),g(Tt.$$.fragment),wn=a(),g(ge.$$.fragment),Tn=a(),Q=c("div"),g(Jt.$$.fragment),Il=a(),hs=c("p"),hs.textContent=bo,Ul=a(),g(ue.$$.fragment),vl=a(),g(Me.$$.fragment),Jn=a(),g(bt.$$.fragment),bn=a(),jt=c("p"),jt.innerHTML=jo,jn=a(),g(_t.$$.fragment),_n=a(),g(he.$$.fragment),$n=a(),G=c("div"),g($t.$$.fragment),Cl=a(),fs=c("p"),fs.innerHTML=_o,In=a(),g(It.$$.fragment),Un=a(),Ut=c("p"),Ut.textContent=$o,vn=a(),vt=c("p"),vt.innerHTML=Io,Cn=a(),Ct=c("ol"),Ct.innerHTML=Uo,kn=a(),kt=c("p"),kt.innerHTML=vo,xn=a(),g(xt.$$.fragment),An=a(),At=c("p"),At.innerHTML=Co,En=a(),g(Et.$$.fragment),Nn=a(),ys=c("p"),this.h()},l(e){const t=No("svelte-u9bgzb",document.head);l=d(t,"META",{name:!0,content:!0}),t.forEach(s),T=r(e),i=d(e,"P",{}),C(i).forEach(s),m=r(e),u(J.$$.fragment,e),n=r(e),u(b.$$.fragment,e),ws=r(e),fe=d(e,"P",{"data-svelte-h":!0}),w(fe)!=="svelte-17nnzxz"&&(fe.innerHTML=kl),Ts=r(e),u(ye.$$.fragment,e),Js=r(e),we=d(e,"P",{"data-svelte-h":!0}),w(we)!=="svelte-19xyef7"&&(we.innerHTML=xl),bs=r(e),u(Te.$$.fragment,e),js=r(e),Je=d(e,"P",{"data-svelte-h":!0}),w(Je)!=="svelte-oebo46"&&(Je.innerHTML=Al),_s=r(e),U=d(e,"DIV",{class:!0});var v=C(U);u(be.$$.fragment,v),Bn=r(v),Rt=d(v,"P",{"data-svelte-h":!0}),w(Rt)!=="svelte-akdo2d"&&(Rt.textContent=El),Zn=r(v),zt=d(v,"P",{"data-svelte-h":!0}),w(zt)!=="svelte-fzlv7p"&&(zt.textContent=Nl),Qn=r(v),Xt=d(v,"P",{"data-svelte-h":!0}),w(Xt)!=="svelte-1nh53b7"&&(Xt.innerHTML=ql),Wn=r(v),u(Y.$$.fragment,v),Sn=r(v),D=d(v,"DIV",{class:!0});var Nt=C(D);u(je.$$.fragment,Nt),Vn=r(Nt),Ft=d(Nt,"P",{"data-svelte-h":!0}),w(Ft)!=="svelte-w01v3a"&&(Ft.textContent=Ll),Nt.forEach(s),Rn=r(v),O=d(v,"DIV",{class:!0});var qt=C(O);u(_e.$$.fragment,qt),zn=r(qt),Gt=d(qt,"P",{"data-svelte-h":!0}),w(Gt)!=="svelte-xj9yar"&&(Gt.textContent=Bl),qt.forEach(s),Xn=r(v),K=d(v,"DIV",{class:!0});var Lt=C(K);u($e.$$.fragment,Lt),Fn=r(Lt),Ht=d(Lt,"P",{"data-svelte-h":!0}),w(Ht)!=="svelte-138117q"&&(Ht.textContent=Zl),Lt.forEach(s),v.forEach(s),$s=r(e),u(Ie.$$.fragment,e),Is=r(e),Ue=d(e,"P",{"data-svelte-h":!0}),w(Ue)!=="svelte-pbx5jd"&&(Ue.innerHTML=Ql),Us=r(e),B=d(e,"DIV",{class:!0});var V=C(B);u(ve.$$.fragment,V),Gn=r(V),Pt=d(V,"P",{"data-svelte-h":!0}),w(Pt)!=="svelte-mqlsp2"&&(Pt.textContent=Wl),Hn=r(V),Yt=d(V,"P",{"data-svelte-h":!0}),w(Yt)!=="svelte-1pa0fc1"&&(Yt.textContent=Sl),Pn=r(V),ee=d(V,"DIV",{class:!0});var Bt=C(ee);u(Ce.$$.fragment,Bt),Yn=r(Bt),Dt=d(Bt,"P",{"data-svelte-h":!0}),w(Dt)!=="svelte-8ki1kt"&&(Dt.textContent=Vl),Bt.forEach(s),V.forEach(s),vs=r(e),u(ke.$$.fragment,e),Cs=r(e),xe=d(e,"P",{"data-svelte-h":!0}),w(xe)!=="svelte-ulv590"&&(xe.innerHTML=Rl),ks=r(e),u(Ae.$$.fragment,e),xs=r(e),u(Ee.$$.fragment,e),As=r(e),Ne=d(e,"P",{"data-svelte-h":!0}),w(Ne)!=="svelte-g5vlul"&&(Ne.innerHTML=zl),Es=r(e),u(qe.$$.fragment,e),Ns=r(e),u(te.$$.fragment,e),qs=r(e),N=d(e,"DIV",{class:!0});var W=C(N);u(Le.$$.fragment,W),Dn=r(W),Ot=d(W,"P",{"data-svelte-h":!0}),w(Ot)!=="svelte-1ex1ahr"&&(Ot.textContent=Xl),On=r(W),Kt=d(W,"P",{"data-svelte-h":!0}),w(Kt)!=="svelte-1140acn"&&(Kt.textContent=Fl),Kn=r(W),u(se.$$.fragment,W),el=r(W),u(ne.$$.fragment,W),W.forEach(s),Ls=r(e),u(Be.$$.fragment,e),Bs=r(e),Ze=d(e,"P",{"data-svelte-h":!0}),w(Ze)!=="svelte-iu01g0"&&(Ze.innerHTML=Gl),Zs=r(e),Qe=d(e,"P",{"data-svelte-h":!0}),w(Qe)!=="svelte-kvj8ld"&&(Qe.innerHTML=Hl),Qs=r(e),u(We.$$.fragment,e),Ws=r(e),u(Se.$$.fragment,e),Ss=r(e),Ve=d(e,"P",{"data-svelte-h":!0}),w(Ve)!=="svelte-1hlk7ls"&&(Ve.innerHTML=Pl),Vs=r(e),u(Re.$$.fragment,e),Rs=r(e),x=d(e,"DIV",{class:!0});var q=C(x);u(ze.$$.fragment,q),tl=r(q),es=d(q,"P",{"data-svelte-h":!0}),w(es)!=="svelte-axkcn3"&&(es.textContent=Yl),sl=r(q),ts=d(q,"P",{"data-svelte-h":!0}),w(ts)!=="svelte-bducrc"&&(ts.textContent=Dl),nl=r(q),ss=d(q,"P",{"data-svelte-h":!0}),w(ss)!=="svelte-12eu297"&&(ss.textContent=Ol),ll=r(q),u(le.$$.fragment,q),ol=r(q),oe=d(q,"DIV",{class:!0});var Zt=C(oe);u(Xe.$$.fragment,Zt),al=r(Zt),ns=d(Zt,"P",{"data-svelte-h":!0}),w(ns)!=="svelte-ym2f5u"&&(ns.textContent=Kl),Zt.forEach(s),q.forEach(s),zs=r(e),u(Fe.$$.fragment,e),Xs=r(e),Ge=d(e,"P",{"data-svelte-h":!0}),w(Ge)!=="svelte-1m09ddd"&&(Ge.innerHTML=eo),Fs=r(e),u(He.$$.fragment,e),Gs=r(e),S=d(e,"DIV",{class:!0});var H=C(S);u(Pe.$$.fragment,H),rl=r(H),ls=d(H,"P",{"data-svelte-h":!0}),w(ls)!=="svelte-5g97zk"&&(ls.innerHTML=to),il=r(H),ae=d(H,"DIV",{class:!0});var Qt=C(ae);u(Ye.$$.fragment,Qt),ml=r(Qt),os=d(Qt,"P",{"data-svelte-h":!0}),w(os)!=="svelte-12r14rd"&&(os.textContent=so),Qt.forEach(s),H.forEach(s),Hs=r(e),u(De.$$.fragment,e),Ps=r(e),Oe=d(e,"P",{"data-svelte-h":!0}),w(Oe)!=="svelte-cark4"&&(Oe.innerHTML=no),Ys=r(e),u(Ke.$$.fragment,e),Ds=r(e),Z=d(e,"DIV",{class:!0});var R=C(Z);u(et.$$.fragment,R),cl=r(R),as=d(R,"P",{"data-svelte-h":!0}),w(as)!=="svelte-2o2pf3"&&(as.innerHTML=lo),dl=r(R),rs=d(R,"P",{"data-svelte-h":!0}),w(rs)!=="svelte-1cq7nyu"&&(rs.textContent=oo),pl=r(R),u(re.$$.fragment,R),R.forEach(s),Os=r(e),u(tt.$$.fragment,e),Ks=r(e),st=d(e,"P",{"data-svelte-h":!0}),w(st)!=="svelte-juyrd0"&&(st.innerHTML=ao),en=r(e),u(nt.$$.fragment,e),tn=r(e),lt=d(e,"P",{"data-svelte-h":!0}),w(lt)!=="svelte-1hlk7ls"&&(lt.innerHTML=ro),sn=r(e),u(ot.$$.fragment,e),nn=r(e),X=d(e,"DIV",{class:!0});var Wt=C(X);u(at.$$.fragment,Wt),gl=r(Wt),is=d(Wt,"P",{"data-svelte-h":!0}),w(is)!=="svelte-1bc1pfc"&&(is.textContent=io),Wt.forEach(s),ln=r(e),u(rt.$$.fragment,e),on=r(e),it=d(e,"P",{"data-svelte-h":!0}),w(it)!=="svelte-1946uqd"&&(it.innerHTML=mo),an=r(e),mt=d(e,"P",{"data-svelte-h":!0}),w(mt)!=="svelte-1tbo5q5"&&(mt.innerHTML=co),rn=r(e),ct=d(e,"P",{"data-svelte-h":!0}),w(ct)!=="svelte-16r94fh"&&(ct.innerHTML=po),mn=r(e),u(dt.$$.fragment,e),cn=r(e),F=d(e,"DIV",{class:!0});var St=C(F);u(pt.$$.fragment,St),ul=r(St),ms=d(St,"P",{"data-svelte-h":!0}),w(ms)!=="svelte-1fspdqk"&&(ms.textContent=go),St.forEach(s),dn=r(e),u(gt.$$.fragment,e),pn=r(e),ut=d(e,"P",{"data-svelte-h":!0}),w(ut)!=="svelte-72042c"&&(ut.innerHTML=uo),gn=r(e),Mt=d(e,"P",{"data-svelte-h":!0}),w(Mt)!=="svelte-l4p418"&&(Mt.textContent=Mo),un=r(e),u(ht.$$.fragment,e),Mn=r(e),_=d(e,"DIV",{class:!0});var $=C(_);u(ft.$$.fragment,$),Ml=r($),cs=d($,"P",{"data-svelte-h":!0}),w(cs)!=="svelte-nngfd4"&&(cs.textContent=ho),hl=r($),ds=d($,"P",{"data-svelte-h":!0}),w(ds)!=="svelte-1milklp"&&(ds.textContent=fo),fl=r($),ps=d($,"P",{"data-svelte-h":!0}),w(ps)!=="svelte-xgynbu"&&(ps.textContent=yo),yl=r($),gs=d($,"P",{"data-svelte-h":!0}),w(gs)!=="svelte-r4fpk6"&&(gs.textContent=wo),wl=r($),us=d($,"UL",{"data-svelte-h":!0}),w(us)!=="svelte-bxyop7"&&(us.innerHTML=To),Tl=r($),u(ie.$$.fragment,$),Jl=r($),Ms=d($,"P",{"data-svelte-h":!0}),w(Ms)!=="svelte-kvfsh7"&&(Ms.textContent=Jo),bl=r($),u(me.$$.fragment,$),jl=r($),u(ce.$$.fragment,$),_l=r($),u(de.$$.fragment,$),$l=r($),u(pe.$$.fragment,$),$.forEach(s),hn=r(e),u(yt.$$.fragment,e),fn=r(e),u(wt.$$.fragment,e),yn=r(e),u(Tt.$$.fragment,e),wn=r(e),u(ge.$$.fragment,e),Tn=r(e),Q=d(e,"DIV",{class:!0});var z=C(Q);u(Jt.$$.fragment,z),Il=r(z),hs=d(z,"P",{"data-svelte-h":!0}),w(hs)!=="svelte-t9ku5w"&&(hs.textContent=bo),Ul=r(z),u(ue.$$.fragment,z),vl=r(z),u(Me.$$.fragment,z),z.forEach(s),Jn=r(e),u(bt.$$.fragment,e),bn=r(e),jt=d(e,"P",{"data-svelte-h":!0}),w(jt)!=="svelte-1vi10v1"&&(jt.innerHTML=jo),jn=r(e),u(_t.$$.fragment,e),_n=r(e),u(he.$$.fragment,e),$n=r(e),G=d(e,"DIV",{class:!0});var Ln=C(G);u($t.$$.fragment,Ln),Cl=r(Ln),fs=d(Ln,"P",{"data-svelte-h":!0}),w(fs)!=="svelte-1vi10v1"&&(fs.innerHTML=_o),Ln.forEach(s),In=r(e),u(It.$$.fragment,e),Un=r(e),Ut=d(e,"P",{"data-svelte-h":!0}),w(Ut)!=="svelte-nwgagp"&&(Ut.textContent=$o),vn=r(e),vt=d(e,"P",{"data-svelte-h":!0}),w(vt)!=="svelte-1982g4m"&&(vt.innerHTML=Io),Cn=r(e),Ct=d(e,"OL",{"data-svelte-h":!0}),w(Ct)!=="svelte-otqs16"&&(Ct.innerHTML=Uo),kn=r(e),kt=d(e,"P",{"data-svelte-h":!0}),w(kt)!=="svelte-ww7ptk"&&(kt.innerHTML=vo),xn=r(e),u(xt.$$.fragment,e),An=r(e),At=d(e,"P",{"data-svelte-h":!0}),w(At)!=="svelte-1kcdlrn"&&(At.innerHTML=Co),En=r(e),u(Et.$$.fragment,e),Nn=r(e),ys=d(e,"P",{}),C(ys).forEach(s),this.h()},h(){k(l,"name","hf:doc:metadata"),k(l,"content",Ko),k(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(K,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(U,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(ee,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(N,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(oe,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(ae,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(X,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(F,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(Q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),k(G,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8")},m(e,t){p(document.head,l),o(e,T,t),o(e,i,t),o(e,m,t),M(J,e,t),o(e,n,t),M(b,e,t),o(e,ws,t),o(e,fe,t),o(e,Ts,t),M(ye,e,t),o(e,Js,t),o(e,we,t),o(e,bs,t),M(Te,e,t),o(e,js,t),o(e,Je,t),o(e,_s,t),o(e,U,t),M(be,U,null),p(U,Bn),p(U,Rt),p(U,Zn),p(U,zt),p(U,Qn),p(U,Xt),p(U,Wn),M(Y,U,null),p(U,Sn),p(U,D),M(je,D,null),p(D,Vn),p(D,Ft),p(U,Rn),p(U,O),M(_e,O,null),p(O,zn),p(O,Gt),p(U,Xn),p(U,K),M($e,K,null),p(K,Fn),p(K,Ht),o(e,$s,t),M(Ie,e,t),o(e,Is,t),o(e,Ue,t),o(e,Us,t),o(e,B,t),M(ve,B,null),p(B,Gn),p(B,Pt),p(B,Hn),p(B,Yt),p(B,Pn),p(B,ee),M(Ce,ee,null),p(ee,Yn),p(ee,Dt),o(e,vs,t),M(ke,e,t),o(e,Cs,t),o(e,xe,t),o(e,ks,t),M(Ae,e,t),o(e,xs,t),M(Ee,e,t),o(e,As,t),o(e,Ne,t),o(e,Es,t),M(qe,e,t),o(e,Ns,t),M(te,e,t),o(e,qs,t),o(e,N,t),M(Le,N,null),p(N,Dn),p(N,Ot),p(N,On),p(N,Kt),p(N,Kn),M(se,N,null),p(N,el),M(ne,N,null),o(e,Ls,t),M(Be,e,t),o(e,Bs,t),o(e,Ze,t),o(e,Zs,t),o(e,Qe,t),o(e,Qs,t),M(We,e,t),o(e,Ws,t),M(Se,e,t),o(e,Ss,t),o(e,Ve,t),o(e,Vs,t),M(Re,e,t),o(e,Rs,t),o(e,x,t),M(ze,x,null),p(x,tl),p(x,es),p(x,sl),p(x,ts),p(x,nl),p(x,ss),p(x,ll),M(le,x,null),p(x,ol),p(x,oe),M(Xe,oe,null),p(oe,al),p(oe,ns),o(e,zs,t),M(Fe,e,t),o(e,Xs,t),o(e,Ge,t),o(e,Fs,t),M(He,e,t),o(e,Gs,t),o(e,S,t),M(Pe,S,null),p(S,rl),p(S,ls),p(S,il),p(S,ae),M(Ye,ae,null),p(ae,ml),p(ae,os),o(e,Hs,t),M(De,e,t),o(e,Ps,t),o(e,Oe,t),o(e,Ys,t),M(Ke,e,t),o(e,Ds,t),o(e,Z,t),M(et,Z,null),p(Z,cl),p(Z,as),p(Z,dl),p(Z,rs),p(Z,pl),M(re,Z,null),o(e,Os,t),M(tt,e,t),o(e,Ks,t),o(e,st,t),o(e,en,t),M(nt,e,t),o(e,tn,t),o(e,lt,t),o(e,sn,t),M(ot,e,t),o(e,nn,t),o(e,X,t),M(at,X,null),p(X,gl),p(X,is),o(e,ln,t),M(rt,e,t),o(e,on,t),o(e,it,t),o(e,an,t),o(e,mt,t),o(e,rn,t),o(e,ct,t),o(e,mn,t),M(dt,e,t),o(e,cn,t),o(e,F,t),M(pt,F,null),p(F,ul),p(F,ms),o(e,dn,t),M(gt,e,t),o(e,pn,t),o(e,ut,t),o(e,gn,t),o(e,Mt,t),o(e,un,t),M(ht,e,t),o(e,Mn,t),o(e,_,t),M(ft,_,null),p(_,Ml),p(_,cs),p(_,hl),p(_,ds),p(_,fl),p(_,ps),p(_,yl),p(_,gs),p(_,wl),p(_,us),p(_,Tl),M(ie,_,null),p(_,Jl),p(_,Ms),p(_,bl),M(me,_,null),p(_,jl),M(ce,_,null),p(_,_l),M(de,_,null),p(_,$l),M(pe,_,null),o(e,hn,t),M(yt,e,t),o(e,fn,t),M(wt,e,t),o(e,yn,t),M(Tt,e,t),o(e,wn,t),M(ge,e,t),o(e,Tn,t),o(e,Q,t),M(Jt,Q,null),p(Q,Il),p(Q,hs),p(Q,Ul),M(ue,Q,null),p(Q,vl),M(Me,Q,null),o(e,Jn,t),M(bt,e,t),o(e,bn,t),o(e,jt,t),o(e,jn,t),M(_t,e,t),o(e,_n,t),M(he,e,t),o(e,$n,t),o(e,G,t),M($t,G,null),p(G,Cl),p(G,fs),o(e,In,t),M(It,e,t),o(e,Un,t),o(e,Ut,t),o(e,vn,t),o(e,vt,t),o(e,Cn,t),o(e,Ct,t),o(e,kn,t),o(e,kt,t),o(e,xn,t),M(xt,e,t),o(e,An,t),o(e,At,t),o(e,En,t),M(Et,e,t),o(e,Nn,t),o(e,ys,t),qn=!0},p(e,[t]){const v={};t&2&&(v.$$scope={dirty:t,ctx:e}),b.$set(v);const Nt={};t&2&&(Nt.$$scope={dirty:t,ctx:e}),Y.$set(Nt);const qt={};t&2&&(qt.$$scope={dirty:t,ctx:e}),te.$set(qt);const Lt={};t&2&&(Lt.$$scope={dirty:t,ctx:e}),se.$set(Lt);const V={};t&2&&(V.$$scope={dirty:t,ctx:e}),ne.$set(V);const Bt={};t&2&&(Bt.$$scope={dirty:t,ctx:e}),le.$set(Bt);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),re.$set(W);const q={};t&2&&(q.$$scope={dirty:t,ctx:e}),ie.$set(q);const Zt={};t&2&&(Zt.$$scope={dirty:t,ctx:e}),me.$set(Zt);const H={};t&2&&(H.$$scope={dirty:t,ctx:e}),ce.$set(H);const Qt={};t&2&&(Qt.$$scope={dirty:t,ctx:e}),de.$set(Qt);const R={};t&2&&(R.$$scope={dirty:t,ctx:e}),pe.$set(R);const Wt={};t&2&&(Wt.$$scope={dirty:t,ctx:e}),ge.$set(Wt);const St={};t&2&&(St.$$scope={dirty:t,ctx:e}),ue.$set(St);const $={};t&2&&($.$$scope={dirty:t,ctx:e}),Me.$set($);const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),he.$set(z)},i(e){qn||(h(J.$$.fragment,e),h(b.$$.fragment,e),h(ye.$$.fragment,e),h(Te.$$.fragment,e),h(be.$$.fragment,e),h(Y.$$.fragment,e),h(je.$$.fragment,e),h(_e.$$.fragment,e),h($e.$$.fragment,e),h(Ie.$$.fragment,e),h(ve.$$.fragment,e),h(Ce.$$.fragment,e),h(ke.$$.fragment,e),h(Ae.$$.fragment,e),h(Ee.$$.fragment,e),h(qe.$$.fragment,e),h(te.$$.fragment,e),h(Le.$$.fragment,e),h(se.$$.fragment,e),h(ne.$$.fragment,e),h(Be.$$.fragment,e),h(We.$$.fragment,e),h(Se.$$.fragment,e),h(Re.$$.fragment,e),h(ze.$$.fragment,e),h(le.$$.fragment,e),h(Xe.$$.fragment,e),h(Fe.$$.fragment,e),h(He.$$.fragment,e),h(Pe.$$.fragment,e),h(Ye.$$.fragment,e),h(De.$$.fragment,e),h(Ke.$$.fragment,e),h(et.$$.fragment,e),h(re.$$.fragment,e),h(tt.$$.fragment,e),h(nt.$$.fragment,e),h(ot.$$.fragment,e),h(at.$$.fragment,e),h(rt.$$.fragment,e),h(dt.$$.fragment,e),h(pt.$$.fragment,e),h(gt.$$.fragment,e),h(ht.$$.fragment,e),h(ft.$$.fragment,e),h(ie.$$.fragment,e),h(me.$$.fragment,e),h(ce.$$.fragment,e),h(de.$$.fragment,e),h(pe.$$.fragment,e),h(yt.$$.fragment,e),h(wt.$$.fragment,e),h(Tt.$$.fragment,e),h(ge.$$.fragment,e),h(Jt.$$.fragment,e),h(ue.$$.fragment,e),h(Me.$$.fragment,e),h(bt.$$.fragment,e),h(_t.$$.fragment,e),h(he.$$.fragment,e),h($t.$$.fragment,e),h(It.$$.fragment,e),h(xt.$$.fragment,e),h(Et.$$.fragment,e),qn=!0)},o(e){f(J.$$.fragment,e),f(b.$$.fragment,e),f(ye.$$.fragment,e),f(Te.$$.fragment,e),f(be.$$.fragment,e),f(Y.$$.fragment,e),f(je.$$.fragment,e),f(_e.$$.fragment,e),f($e.$$.fragment,e),f(Ie.$$.fragment,e),f(ve.$$.fragment,e),f(Ce.$$.fragment,e),f(ke.$$.fragment,e),f(Ae.$$.fragment,e),f(Ee.$$.fragment,e),f(qe.$$.fragment,e),f(te.$$.fragment,e),f(Le.$$.fragment,e),f(se.$$.fragment,e),f(ne.$$.fragment,e),f(Be.$$.fragment,e),f(We.$$.fragment,e),f(Se.$$.fragment,e),f(Re.$$.fragment,e),f(ze.$$.fragment,e),f(le.$$.fragment,e),f(Xe.$$.fragment,e),f(Fe.$$.fragment,e),f(He.$$.fragment,e),f(Pe.$$.fragment,e),f(Ye.$$.fragment,e),f(De.$$.fragment,e),f(Ke.$$.fragment,e),f(et.$$.fragment,e),f(re.$$.fragment,e),f(tt.$$.fragment,e),f(nt.$$.fragment,e),f(ot.$$.fragment,e),f(at.$$.fragment,e),f(rt.$$.fragment,e),f(dt.$$.fragment,e),f(pt.$$.fragment,e),f(gt.$$.fragment,e),f(ht.$$.fragment,e),f(ft.$$.fragment,e),f(ie.$$.fragment,e),f(me.$$.fragment,e),f(ce.$$.fragment,e),f(de.$$.fragment,e),f(pe.$$.fragment,e),f(yt.$$.fragment,e),f(wt.$$.fragment,e),f(Tt.$$.fragment,e),f(ge.$$.fragment,e),f(Jt.$$.fragment,e),f(ue.$$.fragment,e),f(Me.$$.fragment,e),f(bt.$$.fragment,e),f(_t.$$.fragment,e),f(he.$$.fragment,e),f($t.$$.fragment,e),f(It.$$.fragment,e),f(xt.$$.fragment,e),f(Et.$$.fragment,e),qn=!1},d(e){e&&(s(T),s(i),s(m),s(n),s(ws),s(fe),s(Ts),s(Js),s(we),s(bs),s(js),s(Je),s(_s),s(U),s($s),s(Is),s(Ue),s(Us),s(B),s(vs),s(Cs),s(xe),s(ks),s(xs),s(As),s(Ne),s(Es),s(Ns),s(qs),s(N),s(Ls),s(Bs),s(Ze),s(Zs),s(Qe),s(Qs),s(Ws),s(Ss),s(Ve),s(Vs),s(Rs),s(x),s(zs),s(Xs),s(Ge),s(Fs),s(Gs),s(S),s(Hs),s(Ps),s(Oe),s(Ys),s(Ds),s(Z),s(Os),s(Ks),s(st),s(en),s(tn),s(lt),s(sn),s(nn),s(X),s(ln),s(on),s(it),s(an),s(mt),s(rn),s(ct),s(mn),s(cn),s(F),s(dn),s(pn),s(ut),s(gn),s(Mt),s(un),s(Mn),s(_),s(hn),s(fn),s(yn),s(wn),s(Tn),s(Q),s(Jn),s(bn),s(jt),s(jn),s(_n),s($n),s(G),s(In),s(Un),s(Ut),s(vn),s(vt),s(Cn),s(Ct),s(kn),s(kt),s(xn),s(An),s(At),s(En),s(Nn),s(ys)),s(l),y(J,e),y(b,e),y(ye,e),y(Te,e),y(be),y(Y),y(je),y(_e),y($e),y(Ie,e),y(ve),y(Ce),y(ke,e),y(Ae,e),y(Ee,e),y(qe,e),y(te,e),y(Le),y(se),y(ne),y(Be,e),y(We,e),y(Se,e),y(Re,e),y(ze),y(le),y(Xe),y(Fe,e),y(He,e),y(Pe),y(Ye),y(De,e),y(Ke,e),y(et),y(re),y(tt,e),y(nt,e),y(ot,e),y(at),y(rt,e),y(dt,e),y(pt),y(gt,e),y(ht,e),y(ft),y(ie),y(me),y(ce),y(de),y(pe),y(yt,e),y(wt,e),y(Tt,e),y(ge,e),y(Jt),y(ue),y(Me),y(bt,e),y(_t,e),y(he,e),y($t),y(It,e),y(xt,e),y(Et,e)}}}const Ko='{"title":"Models","local":"models","sections":[{"title":"Models","local":"models","sections":[{"title":"Base Model","local":"smolagents.Model","sections":[],"depth":3},{"title":"API Model","local":"smolagents.ApiModel","sections":[],"depth":3},{"title":"TransformersModel","local":"smolagents.TransformersModel","sections":[],"depth":3},{"title":"InferenceClientModel","local":"smolagents.InferenceClientModel","sections":[],"depth":3},{"title":"LiteLLMModel","local":"smolagents.LiteLLMModel","sections":[],"depth":3},{"title":"LiteLLMRouterModel","local":"smolagents.LiteLLMRouterModel","sections":[],"depth":3},{"title":"OpenAIServerModel","local":"smolagents.OpenAIServerModel","sections":[],"depth":3},{"title":"AzureOpenAIServerModel","local":"smolagents.AzureOpenAIServerModel","sections":[],"depth":3},{"title":"AmazonBedrockServerModel","local":"smolagents.AmazonBedrockServerModel","sections":[],"depth":3},{"title":"MLXModel","local":"smolagents.MLXModel","sections":[],"depth":3},{"title":"VLLMModel","local":"smolagents.VLLMModel","sections":[],"depth":3},{"title":"Custom Model","local":"custom-model","sections":[],"depth":3}],"depth":2}],"depth":1}';function ea(j){return xo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ra extends Ao{constructor(l){super(),Eo(this,l,ea,Oo,ko,{})}}export{ra as component};
