import{s as al,o as rl,n as k}from"../chunks/scheduler.f6319a2a.js";import{S as il,i as cl,g as p,s as a,r as d,A as pl,h as m,f as n,c as r,j as E,u as g,x as T,k as N,y,a as o,v as u,d as M,t as h,w as f}from"../chunks/index.85aa684c.js";import{T as gt}from"../chunks/Tip.3d397a88.js";import{D as Q,E as re}from"../chunks/ExampleCodeBlock.ac5a24b2.js";import{C as $}from"../chunks/CodeBlock.3400fc53.js";import{H as L,E as ml}from"../chunks/getInferenceSnippets.743412b2.js";function dl(j){let s,J=`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(){s=p("p"),s.textContent=J},l(i){s=m(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-19v5hvw"&&(s.textContent=J)},m(i,c){o(i,s,c)},p:k,d(i){i&&n(s)}}}function gl(j){let s,J="You must have <code>transformers</code> and <code>torch</code> installed on your machine. Please run <code>pip install smolagents[transformers]</code> if it’s not the case.";return{c(){s=p("p"),s.innerHTML=J},l(i){s=m(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1tclttn"&&(s.innerHTML=J)},m(i,c){o(i,s,c)},p:k,d(i){i&&n(s)}}}function ul(j){let s,J="You must have <code>transformers</code> and <code>torch</code> installed on your machine. Please run <code>pip install smolagents[transformers]</code> if it’s not the case.";return{c(){s=p("p"),s.innerHTML=J},l(i){s=m(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1tclttn"&&(s.innerHTML=J)},m(i,c){o(i,s,c)},p:k,d(i){i&&n(s)}}}function Ml(j){let s,J="Example:",i,c,w;return c=new $({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(){s=p("p"),s.textContent=J,i=a(),d(c.$$.fragment)},l(l){s=m(l,"P",{"data-svelte-h":!0}),T(s)!=="svelte-11lpom8"&&(s.textContent=J),i=r(l),g(c.$$.fragment,l)},m(l,I){o(l,s,I),o(l,i,I),u(c,l,I),w=!0},p:k,i(l){w||(M(c.$$.fragment,l),w=!0)},o(l){h(c.$$.fragment,l),w=!1},d(l){l&&(n(s),n(i)),f(c,l)}}}function hl(j){let s,J="Example:",i,c,w;return c=new $({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(){s=p("p"),s.textContent=J,i=a(),d(c.$$.fragment)},l(l){s=m(l,"P",{"data-svelte-h":!0}),T(s)!=="svelte-11lpom8"&&(s.textContent=J),i=r(l),g(c.$$.fragment,l)},m(l,I){o(l,s,I),o(l,i,I),u(c,l,I),w=!0},p:k,i(l){w||(M(c.$$.fragment,l),w=!0)},o(l){h(c.$$.fragment,l),w=!1},d(l){l&&(n(s),n(i)),f(c,l)}}}function fl(j){let s,J="Example:",i,c,w;return c=new $({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(){s=p("p"),s.textContent=J,i=a(),d(c.$$.fragment)},l(l){s=m(l,"P",{"data-svelte-h":!0}),T(s)!=="svelte-11lpom8"&&(s.textContent=J),i=r(l),g(c.$$.fragment,l)},m(l,I){o(l,s,I),o(l,i,I),u(c,l,I),w=!0},p:k,i(l){w||(M(c.$$.fragment,l),w=!0)},o(l){h(c.$$.fragment,l),w=!1},d(l){l&&(n(s),n(i)),f(c,l)}}}function yl(j){let s,J=`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(){s=p("p"),s.innerHTML=J},l(i){s=m(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-ll4rxl"&&(s.innerHTML=J)},m(i,c){o(i,s,c)},p:k,d(i){i&&n(s)}}}function Tl(j){let s,J="Creating a model instance with default settings:",i,c,w;return c=new $({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(){s=p("p"),s.textContent=J,i=a(),d(c.$$.fragment)},l(l){s=m(l,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1368o2k"&&(s.textContent=J),i=r(l),g(c.$$.fragment,l)},m(l,I){o(l,s,I),o(l,i,I),u(c,l,I),w=!0},p:k,i(l){w||(M(c.$$.fragment,l),w=!0)},o(l){h(c.$$.fragment,l),w=!1},d(l){l&&(n(s),n(i)),f(c,l)}}}function Jl(j){let s,J="Creating a model instance with a custom boto3 client:",i,c,w;return c=new $({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(){s=p("p"),s.textContent=J,i=a(),d(c.$$.fragment)},l(l){s=m(l,"P",{"data-svelte-h":!0}),T(s)!=="svelte-11isg5i"&&(s.textContent=J),i=r(l),g(c.$$.fragment,l)},m(l,I){o(l,s,I),o(l,i,I),u(c,l,I),w=!0},p:k,i(l){w||(M(c.$$.fragment,l),w=!0)},o(l){h(c.$$.fragment,l),w=!1},d(l){l&&(n(s),n(i)),f(c,l)}}}function wl(j){let s,J="Creating a model instance with client_kwargs for internal client creation:",i,c,w;return c=new $({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(){s=p("p"),s.textContent=J,i=a(),d(c.$$.fragment)},l(l){s=m(l,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1s85quz"&&(s.textContent=J),i=r(l),g(c.$$.fragment,l)},m(l,I){o(l,s,I),o(l,i,I),u(c,l,I),w=!0},p:k,i(l){w||(M(c.$$.fragment,l),w=!0)},o(l){h(c.$$.fragment,l),w=!1},d(l){l&&(n(s),n(i)),f(c,l)}}}function Il(j){let s,J="Creating a model instance with inference and guardrail configurations:",i,c,w;return c=new $({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(){s=p("p"),s.textContent=J,i=a(),d(c.$$.fragment)},l(l){s=m(l,"P",{"data-svelte-h":!0}),T(s)!=="svelte-4kd7m4"&&(s.textContent=J),i=r(l),g(c.$$.fragment,l)},m(l,I){o(l,s,I),o(l,i,I),u(c,l,I),w=!0},p:k,i(l){w||(M(c.$$.fragment,l),w=!0)},o(l){h(c.$$.fragment,l),w=!1},d(l){l&&(n(s),n(i)),f(c,l)}}}function jl(j){let s,J="You must have <code>mlx-lm</code> installed on your machine. Please run <code>pip install smolagents[mlx-lm]</code> if it’s not the case.";return{c(){s=p("p"),s.innerHTML=J},l(i){s=m(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-g382or"&&(s.innerHTML=J)},m(i,c){o(i,s,c)},p:k,d(i){i&&n(s)}}}function bl(j){let s,J="You must have <code>mlx-lm</code> installed on your machine. Please run <code>pip install smolagents[mlx-lm]</code> if it’s not the case.";return{c(){s=p("p"),s.innerHTML=J},l(i){s=m(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-g382or"&&(s.innerHTML=J)},m(i,c){o(i,s,c)},p:k,d(i){i&&n(s)}}}function Ul(j){let s,J="Example:",i,c,w;return c=new $({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(){s=p("p"),s.textContent=J,i=a(),d(c.$$.fragment)},l(l){s=m(l,"P",{"data-svelte-h":!0}),T(s)!=="svelte-11lpom8"&&(s.textContent=J),i=r(l),g(c.$$.fragment,l)},m(l,I){o(l,s,I),o(l,i,I),u(c,l,I),w=!0},p:k,i(l){w||(M(c.$$.fragment,l),w=!0)},o(l){h(c.$$.fragment,l),w=!1},d(l){l&&(n(s),n(i)),f(c,l)}}}function $l(j){let s,J="You must have <code>vllm</code> installed on your machine. Please run <code>pip install smolagents[vllm]</code> if it’s not the case.";return{c(){s=p("p"),s.innerHTML=J},l(i){s=m(i,"P",{"data-svelte-h":!0}),T(s)!=="svelte-1r5rtu3"&&(s.innerHTML=J)},m(i,c){o(i,s,c)},p:k,d(i){i&&n(s)}}}function _l(j){let s,J,i,c,w,l,I,Nt,ie,yn=`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.`,Lt,ce,Bt,pe,Wt,me,Tn="You’re free to create and use your own models to power your agent.",Zt,de,Jn=`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:`,Qt,ge,wn='<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>',Vt,ue,In=`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.`,St,Me,Rt,he,jn='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.',zt,fe,Xt,ye,bn="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.",Ft,Te,Gt,Je,Ht,X,Yt,v,we,Ws,ut,Un="A class that uses Hugging Face’s Transformers library for language model interaction.",Zs,Mt,$n="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.",Qs,F,Vs,G,Pt,Ie,Dt,je,_n='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.',Ot,be,vn="You can also set a rate limit in requests per minute by using the <code>requests_per_minute</code> argument.",Kt,Ue,es,$e,ts,_,_e,Ss,ht,Cn="A class to interact with Hugging Face’s Inference Providers for language model interaction.",Rs,ft,kn="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.",zs,yt,xn="Providers include Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together, and more.",Xs,H,Fs,Y,ve,Gs,Tt,An="Create the Hugging Face client.",ss,Ce,ns,ke,qn=`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.`,ls,xe,os,B,Ae,Hs,Jt,En='Model to use <a href="https://docs.litellm.ai/docs/#litellm-python-sdk" rel="nofollow">LiteLLM Python SDK</a> to access hundreds of LLMs.',Ys,P,qe,Ps,wt,Nn="Create the LiteLLM client.",as,Ee,rs,Ne,Ln=`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.`,is,Le,cs,x,Be,Ds,It,Bn='Router‑based client for interacting with the <a href="https://docs.litellm.ai/docs/routing" rel="nofollow">LiteLLM Python SDK Router</a>.',Os,jt,Wn=`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.`,Ks,D,ps,We,ms,Ze,Zn=`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):`,ds,Qe,gs,V,Ve,en,bt,Qn="This model connects to an OpenAI-compatible API server.",us,Se,Ms,Re,Vn="<code>AzureOpenAIServerModel</code> allows you to connect to any Azure OpenAI deployment.",hs,ze,Sn="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>.",fs,Xe,Rn='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.',ys,Fe,Ts,S,Ge,tn,Ut,zn="This model connects to an Azure OpenAI deployment.",Js,He,ws,Ye,Xn="<code>AmazonBedrockServerModel</code> helps you connect to Amazon Bedrock and run your agent with any available models.",Is,Pe,Fn="Below is an example setup. This class also offers additional options for customization.",js,De,bs,b,Oe,sn,$t,Gn="A model class for interacting with Amazon Bedrock Server models through the Bedrock API.",nn,_t,Hn=`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.`,ln,vt,Yn="Authentication:",on,Ct,Pn="Amazon Bedrock supports multiple authentication methods:",an,kt,Dn=`<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>`,rn,O,cn,xt,On="Examples:",pn,K,mn,ee,dn,te,gn,se,Us,Ke,$s,et,_s,tt,vs,ne,Cs,A,st,un,At,Kn="A class to interact with models loaded using MLX on Apple silicon.",Mn,le,hn,oe,ks,nt,xs,lt,el='Model to use <a href="https://docs.vllm.ai/" rel="nofollow">vLLM</a> for fast LLM inference and serving.',As,ot,qs,ae,Es,R,at,fn,qt,tl='Model to use <a href="https://docs.vllm.ai/" rel="nofollow">vLLM</a> for fast LLM inference and serving.',Ns,rt,Ls,Et,Bs;return w=new L({props:{title:"Models",local:"models",headingTag:"h1"}}),I=new gt({props:{warning:!0,$$slots:{default:[dl]},$$scope:{ctx:j}}}),ce=new L({props:{title:"Models",local:"models",headingTag:"h2"}}),pe=new L({props:{title:"Your custom Model",local:"your-custom-model",headingTag:"h3"}}),Me=new $({props:{code:"ZnJvbSUyMGh1Z2dpbmdmYWNlX2h1YiUyMGltcG9ydCUyMGxvZ2luJTJDJTIwSW5mZXJlbmNlQ2xpZW50JTBBJTBBbG9naW4oJTIyJTNDWU9VUl9IVUdHSU5HRkFDRUhVQl9BUElfVE9LRU4lM0UlMjIpJTBBJTBBbW9kZWxfaWQlMjAlM0QlMjAlMjJtZXRhLWxsYW1hJTJGTGxhbWEtMy4zLTcwQi1JbnN0cnVjdCUyMiUwQSUwQWNsaWVudCUyMCUzRCUyMEluZmVyZW5jZUNsaWVudChtb2RlbCUzRG1vZGVsX2lkKSUwQSUwQWNsYXNzJTIwQ3VzdG9tTW9kZWwoTW9kZWwpJTNBJTBBJTIwJTIwJTIwJTIwZGVmJTIwZ2VuZXJhdGUobWVzc2FnZXMlMkMlMjBzdG9wX3NlcXVlbmNlcyUzRCU1QiUyMlRhc2slMjIlNUQpJTNBJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwcmVzcG9uc2UlMjAlM0QlMjBjbGllbnQuY2hhdF9jb21wbGV0aW9uKG1lc3NhZ2VzJTJDJTIwc3RvcCUzRHN0b3Bfc2VxdWVuY2VzJTJDJTIwbWF4X3Rva2VucyUzRDEwMjQpJTBBJTIwJTIwJTIwJTIwJTIwJTIwJTIwJTIwYW5zd2VyJTIwJTNEJTIwcmVzcG9uc2UuY2hvaWNlcyU1QjAlNUQubWVzc2FnZSUwQSUyMCUyMCUyMCUyMCUyMCUyMCUyMCUyMHJldHVybiUyMGFuc3dlciUwQSUwQWN1c3RvbV9tb2RlbCUyMCUzRCUyMEN1c3RvbU1vZGVsKCk=",highlighted:`<span class="hljs-keyword">from</span> huggingface_hub <span class="hljs-keyword">import</span> login, InferenceClient

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}}),fe=new L({props:{title:"TransformersModel",local:"smolagents.TransformersModel",headingTag:"h3"}}),Te=new $({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}}),Je=new $({props:{code:"V2hhdCUyMGE=",highlighted:"&gt;&gt;&gt; What a",wrap:!1}}),X=new gt({props:{warning:!1,$$slots:{default:[gl]},$$scope:{ctx:j}}}),we=new Q({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:"**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.*kwargs",description:`*<strong>*kwargs</strong> &#x2014;
Additional keyword arguments to pass to <code>model.generate()</code>, for instance <code>max_new_tokens</code> or <code>device</code>.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L738",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>
`}}),F=new gt({props:{warning:!1,$$slots:{default:[ul]},$$scope:{ctx:j}}}),G=new re({props:{anchor:"smolagents.TransformersModel.example",$$slots:{default:[Ml]},$$scope:{ctx:j}}}),Ie=new L({props:{title:"InferenceClientModel",local:"smolagents.InferenceClientModel",headingTag:"h3"}}),Ue=new $({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}}),$e=new $({props:{code:"T2YlMjBjb3Vyc2UhJTIwSWYlMjB5b3UlMjBjaGFuZ2UlMjB5b3VyJTIwbWluZCUyQyUyMGZlZWwlMjBmcmVlJTIwdG8lMjByZWFjaCUyMG91dC4lMjBUYWtlJTIwY2FyZSE=",highlighted:"&gt;&gt;&gt; Of course! If you change your mind, feel free to reach out. Take care!",wrap:!1}}),_e=new Q({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/v1.21.0/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/v1.21.0/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 pass to the Hugging Face InferenceClient.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L1286",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>
`}}),H=new re({props:{anchor:"smolagents.InferenceClientModel.example",$$slots:{default:[hl]},$$scope:{ctx:j}}}),ve=new Q({props:{name:"create_client",anchor:"smolagents.InferenceClientModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L1377"}}),Ce=new L({props:{title:"LiteLLMModel",local:"smolagents.LiteLLMModel",headingTag:"h3"}}),xe=new $({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}}),Ae=new Q({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 pass to the OpenAI API.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L1049"}}),qe=new Q({props:{name:"create_client",anchor:"smolagents.LiteLLMModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L1099"}}),Ee=new L({props:{title:"LiteLLMRouterModel",local:"smolagents.LiteLLMRouterModel",headingTag:"h3"}}),Le=new $({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}}),Be=new Q({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 pass to the LiteLLM Router completion method.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L1193"}}),D=new re({props:{anchor:"smolagents.LiteLLMRouterModel.example",$$slots:{default:[fl]},$$scope:{ctx:j}}}),We=new L({props:{title:"OpenAIServerModel",local:"smolagents.OpenAIServerModel",headingTag:"h3"}}),Qe=new $({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}}),Ve=new Q({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 pass to the OpenAI API.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L1468"}}),Se=new L({props:{title:"AzureOpenAIServerModel",local:"smolagents.AzureOpenAIServerModel",headingTag:"h3"}}),Fe=new $({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}}),Ge=new Q({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 pass to the Azure OpenAI API.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L1613"}}),He=new L({props:{title:"AmazonBedrockServerModel",local:"smolagents.AmazonBedrockServerModel",headingTag:"h3"}}),De=new $({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}}),Oe=new Q({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 passed directly to the underlying API calls.`,name:"*kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L1673"}}),O=new gt({props:{warning:!1,$$slots:{default:[yl]},$$scope:{ctx:j}}}),K=new re({props:{anchor:"smolagents.AmazonBedrockServerModel.example",$$slots:{default:[Tl]},$$scope:{ctx:j}}}),ee=new re({props:{anchor:"smolagents.AmazonBedrockServerModel.example-2",$$slots:{default:[Jl]},$$scope:{ctx:j}}}),te=new re({props:{anchor:"smolagents.AmazonBedrockServerModel.example-3",$$slots:{default:[wl]},$$scope:{ctx:j}}}),se=new re({props:{anchor:"smolagents.AmazonBedrockServerModel.example-4",$$slots:{default:[Il]},$$scope:{ctx:j}}}),Ke=new L({props:{title:"MLXModel",local:"smolagents.MLXModel",headingTag:"h3"}}),et=new $({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 $({props:{code:"V2hhdCUyMGE=",highlighted:"&gt;&gt;&gt; What a",wrap:!1}}),ne=new gt({props:{warning:!1,$$slots:{default:[jl]},$$scope:{ctx:j}}}),st=new Q({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> (dict, <em>optional</em>) &#x2014;
Any additional keyword arguments that you want to use in model.generate(), for instance <code>max_tokens</code>.`,name:"kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L631"}}),le=new gt({props:{warning:!1,$$slots:{default:[bl]},$$scope:{ctx:j}}}),oe=new re({props:{anchor:"smolagents.MLXModel.example",$$slots:{default:[Ul]},$$scope:{ctx:j}}}),nt=new L({props:{title:"VLLMModel",local:"smolagents.VLLMModel",headingTag:"h3"}}),ot=new $({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}}),ae=new gt({props:{warning:!1,$$slots:{default:[$l]},$$scope:{ctx:j}}}),at=new Q({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 pass to the vLLM model (like revision, max_model_len, etc.).`,name:"model_kwargs"}],source:"https://github.com/huggingface/smolagents/blob/v1.21.0/src/smolagents/models.py#L526"}}),rt=new ml({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/en/reference/models.md"}}),{c(){s=p("meta"),J=a(),i=p("p"),c=a(),d(w.$$.fragment),l=a(),d(I.$$.fragment),Nt=a(),ie=p("p"),ie.innerHTML=yn,Lt=a(),d(ce.$$.fragment),Bt=a(),d(pe.$$.fragment),Wt=a(),me=p("p"),me.textContent=Tn,Zt=a(),de=p("p"),de.innerHTML=Jn,Qt=a(),ge=p("ol"),ge.innerHTML=wn,Vt=a(),ue=p("p"),ue.innerHTML=In,St=a(),d(Me.$$.fragment),Rt=a(),he=p("p"),he.innerHTML=jn,zt=a(),d(fe.$$.fragment),Xt=a(),ye=p("p"),ye.innerHTML=bn,Ft=a(),d(Te.$$.fragment),Gt=a(),d(Je.$$.fragment),Ht=a(),d(X.$$.fragment),Yt=a(),v=p("div"),d(we.$$.fragment),Ws=a(),ut=p("p"),ut.textContent=Un,Zs=a(),Mt=p("p"),Mt.textContent=$n,Qs=a(),d(F.$$.fragment),Vs=a(),d(G.$$.fragment),Pt=a(),d(Ie.$$.fragment),Dt=a(),je=p("p"),je.innerHTML=_n,Ot=a(),be=p("p"),be.innerHTML=vn,Kt=a(),d(Ue.$$.fragment),es=a(),d($e.$$.fragment),ts=a(),_=p("div"),d(_e.$$.fragment),Ss=a(),ht=p("p"),ht.textContent=Cn,Rs=a(),ft=p("p"),ft.textContent=kn,zs=a(),yt=p("p"),yt.textContent=xn,Xs=a(),d(H.$$.fragment),Fs=a(),Y=p("div"),d(ve.$$.fragment),Gs=a(),Tt=p("p"),Tt.textContent=An,ss=a(),d(Ce.$$.fragment),ns=a(),ke=p("p"),ke.innerHTML=qn,ls=a(),d(xe.$$.fragment),os=a(),B=p("div"),d(Ae.$$.fragment),Hs=a(),Jt=p("p"),Jt.innerHTML=En,Ys=a(),P=p("div"),d(qe.$$.fragment),Ps=a(),wt=p("p"),wt.textContent=Nn,as=a(),d(Ee.$$.fragment),rs=a(),Ne=p("p"),Ne.innerHTML=Ln,is=a(),d(Le.$$.fragment),cs=a(),x=p("div"),d(Be.$$.fragment),Ds=a(),It=p("p"),It.innerHTML=Bn,Os=a(),jt=p("p"),jt.textContent=Wn,Ks=a(),d(D.$$.fragment),ps=a(),d(We.$$.fragment),ms=a(),Ze=p("p"),Ze.innerHTML=Zn,ds=a(),d(Qe.$$.fragment),gs=a(),V=p("div"),d(Ve.$$.fragment),en=a(),bt=p("p"),bt.textContent=Qn,us=a(),d(Se.$$.fragment),Ms=a(),Re=p("p"),Re.innerHTML=Vn,hs=a(),ze=p("p"),ze.innerHTML=Sn,fs=a(),Xe=p("p"),Xe.innerHTML=Rn,ys=a(),d(Fe.$$.fragment),Ts=a(),S=p("div"),d(Ge.$$.fragment),tn=a(),Ut=p("p"),Ut.textContent=zn,Js=a(),d(He.$$.fragment),ws=a(),Ye=p("p"),Ye.innerHTML=Xn,Is=a(),Pe=p("p"),Pe.textContent=Fn,js=a(),d(De.$$.fragment),bs=a(),b=p("div"),d(Oe.$$.fragment),sn=a(),$t=p("p"),$t.textContent=Gn,nn=a(),_t=p("p"),_t.textContent=Hn,ln=a(),vt=p("p"),vt.textContent=Yn,on=a(),Ct=p("p"),Ct.textContent=Pn,an=a(),kt=p("ul"),kt.innerHTML=Dn,rn=a(),d(O.$$.fragment),cn=a(),xt=p("p"),xt.textContent=On,pn=a(),d(K.$$.fragment),mn=a(),d(ee.$$.fragment),dn=a(),d(te.$$.fragment),gn=a(),d(se.$$.fragment),Us=a(),d(Ke.$$.fragment),$s=a(),d(et.$$.fragment),_s=a(),d(tt.$$.fragment),vs=a(),d(ne.$$.fragment),Cs=a(),A=p("div"),d(st.$$.fragment),un=a(),At=p("p"),At.textContent=Kn,Mn=a(),d(le.$$.fragment),hn=a(),d(oe.$$.fragment),ks=a(),d(nt.$$.fragment),xs=a(),lt=p("p"),lt.innerHTML=el,As=a(),d(ot.$$.fragment),qs=a(),d(ae.$$.fragment),Es=a(),R=p("div"),d(at.$$.fragment),fn=a(),qt=p("p"),qt.innerHTML=tl,Ns=a(),d(rt.$$.fragment),Ls=a(),Et=p("p"),this.h()},l(e){const t=pl("svelte-u9bgzb",document.head);s=m(t,"META",{name:!0,content:!0}),t.forEach(n),J=r(e),i=m(e,"P",{}),E(i).forEach(n),c=r(e),g(w.$$.fragment,e),l=r(e),g(I.$$.fragment,e),Nt=r(e),ie=m(e,"P",{"data-svelte-h":!0}),T(ie)!=="svelte-17nnzxz"&&(ie.innerHTML=yn),Lt=r(e),g(ce.$$.fragment,e),Bt=r(e),g(pe.$$.fragment,e),Wt=r(e),me=m(e,"P",{"data-svelte-h":!0}),T(me)!=="svelte-nwgagp"&&(me.textContent=Tn),Zt=r(e),de=m(e,"P",{"data-svelte-h":!0}),T(de)!=="svelte-1982g4m"&&(de.innerHTML=Jn),Qt=r(e),ge=m(e,"OL",{"data-svelte-h":!0}),T(ge)!=="svelte-otqs16"&&(ge.innerHTML=wn),Vt=r(e),ue=m(e,"P",{"data-svelte-h":!0}),T(ue)!=="svelte-ww7ptk"&&(ue.innerHTML=In),St=r(e),g(Me.$$.fragment,e),Rt=r(e),he=m(e,"P",{"data-svelte-h":!0}),T(he)!=="svelte-1kcdlrn"&&(he.innerHTML=jn),zt=r(e),g(fe.$$.fragment,e),Xt=r(e),ye=m(e,"P",{"data-svelte-h":!0}),T(ye)!=="svelte-ulv590"&&(ye.innerHTML=bn),Ft=r(e),g(Te.$$.fragment,e),Gt=r(e),g(Je.$$.fragment,e),Ht=r(e),g(X.$$.fragment,e),Yt=r(e),v=m(e,"DIV",{class:!0});var q=E(v);g(we.$$.fragment,q),Ws=r(q),ut=m(q,"P",{"data-svelte-h":!0}),T(ut)!=="svelte-1ex1ahr"&&(ut.textContent=Un),Zs=r(q),Mt=m(q,"P",{"data-svelte-h":!0}),T(Mt)!=="svelte-1140acn"&&(Mt.textContent=$n),Qs=r(q),g(F.$$.fragment,q),Vs=r(q),g(G.$$.fragment,q),q.forEach(n),Pt=r(e),g(Ie.$$.fragment,e),Dt=r(e),je=m(e,"P",{"data-svelte-h":!0}),T(je)!=="svelte-iu01g0"&&(je.innerHTML=_n),Ot=r(e),be=m(e,"P",{"data-svelte-h":!0}),T(be)!=="svelte-1cavb4l"&&(be.innerHTML=vn),Kt=r(e),g(Ue.$$.fragment,e),es=r(e),g($e.$$.fragment,e),ts=r(e),_=m(e,"DIV",{class:!0});var C=E(_);g(_e.$$.fragment,C),Ss=r(C),ht=m(C,"P",{"data-svelte-h":!0}),T(ht)!=="svelte-axkcn3"&&(ht.textContent=Cn),Rs=r(C),ft=m(C,"P",{"data-svelte-h":!0}),T(ft)!=="svelte-bducrc"&&(ft.textContent=kn),zs=r(C),yt=m(C,"P",{"data-svelte-h":!0}),T(yt)!=="svelte-12eu297"&&(yt.textContent=xn),Xs=r(C),g(H.$$.fragment,C),Fs=r(C),Y=m(C,"DIV",{class:!0});var it=E(Y);g(ve.$$.fragment,it),Gs=r(it),Tt=m(it,"P",{"data-svelte-h":!0}),T(Tt)!=="svelte-ym2f5u"&&(Tt.textContent=An),it.forEach(n),C.forEach(n),ss=r(e),g(Ce.$$.fragment,e),ns=r(e),ke=m(e,"P",{"data-svelte-h":!0}),T(ke)!=="svelte-1m09ddd"&&(ke.innerHTML=qn),ls=r(e),g(xe.$$.fragment,e),os=r(e),B=m(e,"DIV",{class:!0});var z=E(B);g(Ae.$$.fragment,z),Hs=r(z),Jt=m(z,"P",{"data-svelte-h":!0}),T(Jt)!=="svelte-5g97zk"&&(Jt.innerHTML=En),Ys=r(z),P=m(z,"DIV",{class:!0});var ct=E(P);g(qe.$$.fragment,ct),Ps=r(ct),wt=m(ct,"P",{"data-svelte-h":!0}),T(wt)!=="svelte-12r14rd"&&(wt.textContent=Nn),ct.forEach(n),z.forEach(n),as=r(e),g(Ee.$$.fragment,e),rs=r(e),Ne=m(e,"P",{"data-svelte-h":!0}),T(Ne)!=="svelte-cark4"&&(Ne.innerHTML=Ln),is=r(e),g(Le.$$.fragment,e),cs=r(e),x=m(e,"DIV",{class:!0});var W=E(x);g(Be.$$.fragment,W),Ds=r(W),It=m(W,"P",{"data-svelte-h":!0}),T(It)!=="svelte-2o2pf3"&&(It.innerHTML=Bn),Os=r(W),jt=m(W,"P",{"data-svelte-h":!0}),T(jt)!=="svelte-1cq7nyu"&&(jt.textContent=Wn),Ks=r(W),g(D.$$.fragment,W),W.forEach(n),ps=r(e),g(We.$$.fragment,e),ms=r(e),Ze=m(e,"P",{"data-svelte-h":!0}),T(Ze)!=="svelte-juyrd0"&&(Ze.innerHTML=Zn),ds=r(e),g(Qe.$$.fragment,e),gs=r(e),V=m(e,"DIV",{class:!0});var pt=E(V);g(Ve.$$.fragment,pt),en=r(pt),bt=m(pt,"P",{"data-svelte-h":!0}),T(bt)!=="svelte-1bc1pfc"&&(bt.textContent=Qn),pt.forEach(n),us=r(e),g(Se.$$.fragment,e),Ms=r(e),Re=m(e,"P",{"data-svelte-h":!0}),T(Re)!=="svelte-1946uqd"&&(Re.innerHTML=Vn),hs=r(e),ze=m(e,"P",{"data-svelte-h":!0}),T(ze)!=="svelte-1tbo5q5"&&(ze.innerHTML=Sn),fs=r(e),Xe=m(e,"P",{"data-svelte-h":!0}),T(Xe)!=="svelte-16r94fh"&&(Xe.innerHTML=Rn),ys=r(e),g(Fe.$$.fragment,e),Ts=r(e),S=m(e,"DIV",{class:!0});var mt=E(S);g(Ge.$$.fragment,mt),tn=r(mt),Ut=m(mt,"P",{"data-svelte-h":!0}),T(Ut)!=="svelte-1fspdqk"&&(Ut.textContent=zn),mt.forEach(n),Js=r(e),g(He.$$.fragment,e),ws=r(e),Ye=m(e,"P",{"data-svelte-h":!0}),T(Ye)!=="svelte-72042c"&&(Ye.innerHTML=Xn),Is=r(e),Pe=m(e,"P",{"data-svelte-h":!0}),T(Pe)!=="svelte-l4p418"&&(Pe.textContent=Fn),js=r(e),g(De.$$.fragment,e),bs=r(e),b=m(e,"DIV",{class:!0});var U=E(b);g(Oe.$$.fragment,U),sn=r(U),$t=m(U,"P",{"data-svelte-h":!0}),T($t)!=="svelte-nngfd4"&&($t.textContent=Gn),nn=r(U),_t=m(U,"P",{"data-svelte-h":!0}),T(_t)!=="svelte-1milklp"&&(_t.textContent=Hn),ln=r(U),vt=m(U,"P",{"data-svelte-h":!0}),T(vt)!=="svelte-xgynbu"&&(vt.textContent=Yn),on=r(U),Ct=m(U,"P",{"data-svelte-h":!0}),T(Ct)!=="svelte-r4fpk6"&&(Ct.textContent=Pn),an=r(U),kt=m(U,"UL",{"data-svelte-h":!0}),T(kt)!=="svelte-bxyop7"&&(kt.innerHTML=Dn),rn=r(U),g(O.$$.fragment,U),cn=r(U),xt=m(U,"P",{"data-svelte-h":!0}),T(xt)!=="svelte-kvfsh7"&&(xt.textContent=On),pn=r(U),g(K.$$.fragment,U),mn=r(U),g(ee.$$.fragment,U),dn=r(U),g(te.$$.fragment,U),gn=r(U),g(se.$$.fragment,U),U.forEach(n),Us=r(e),g(Ke.$$.fragment,e),$s=r(e),g(et.$$.fragment,e),_s=r(e),g(tt.$$.fragment,e),vs=r(e),g(ne.$$.fragment,e),Cs=r(e),A=m(e,"DIV",{class:!0});var Z=E(A);g(st.$$.fragment,Z),un=r(Z),At=m(Z,"P",{"data-svelte-h":!0}),T(At)!=="svelte-t9ku5w"&&(At.textContent=Kn),Mn=r(Z),g(le.$$.fragment,Z),hn=r(Z),g(oe.$$.fragment,Z),Z.forEach(n),ks=r(e),g(nt.$$.fragment,e),xs=r(e),lt=m(e,"P",{"data-svelte-h":!0}),T(lt)!=="svelte-1vi10v1"&&(lt.innerHTML=el),As=r(e),g(ot.$$.fragment,e),qs=r(e),g(ae.$$.fragment,e),Es=r(e),R=m(e,"DIV",{class:!0});var dt=E(R);g(at.$$.fragment,dt),fn=r(dt),qt=m(dt,"P",{"data-svelte-h":!0}),T(qt)!=="svelte-1vi10v1"&&(qt.innerHTML=tl),dt.forEach(n),Ns=r(e),g(rt.$$.fragment,e),Ls=r(e),Et=m(e,"P",{}),E(Et).forEach(n),this.h()},h(){N(s,"name","hf:doc:metadata"),N(s,"content",vl),N(v,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(_,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(V,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(S,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(b,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(A,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),N(R,"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){y(document.head,s),o(e,J,t),o(e,i,t),o(e,c,t),u(w,e,t),o(e,l,t),u(I,e,t),o(e,Nt,t),o(e,ie,t),o(e,Lt,t),u(ce,e,t),o(e,Bt,t),u(pe,e,t),o(e,Wt,t),o(e,me,t),o(e,Zt,t),o(e,de,t),o(e,Qt,t),o(e,ge,t),o(e,Vt,t),o(e,ue,t),o(e,St,t),u(Me,e,t),o(e,Rt,t),o(e,he,t),o(e,zt,t),u(fe,e,t),o(e,Xt,t),o(e,ye,t),o(e,Ft,t),u(Te,e,t),o(e,Gt,t),u(Je,e,t),o(e,Ht,t),u(X,e,t),o(e,Yt,t),o(e,v,t),u(we,v,null),y(v,Ws),y(v,ut),y(v,Zs),y(v,Mt),y(v,Qs),u(F,v,null),y(v,Vs),u(G,v,null),o(e,Pt,t),u(Ie,e,t),o(e,Dt,t),o(e,je,t),o(e,Ot,t),o(e,be,t),o(e,Kt,t),u(Ue,e,t),o(e,es,t),u($e,e,t),o(e,ts,t),o(e,_,t),u(_e,_,null),y(_,Ss),y(_,ht),y(_,Rs),y(_,ft),y(_,zs),y(_,yt),y(_,Xs),u(H,_,null),y(_,Fs),y(_,Y),u(ve,Y,null),y(Y,Gs),y(Y,Tt),o(e,ss,t),u(Ce,e,t),o(e,ns,t),o(e,ke,t),o(e,ls,t),u(xe,e,t),o(e,os,t),o(e,B,t),u(Ae,B,null),y(B,Hs),y(B,Jt),y(B,Ys),y(B,P),u(qe,P,null),y(P,Ps),y(P,wt),o(e,as,t),u(Ee,e,t),o(e,rs,t),o(e,Ne,t),o(e,is,t),u(Le,e,t),o(e,cs,t),o(e,x,t),u(Be,x,null),y(x,Ds),y(x,It),y(x,Os),y(x,jt),y(x,Ks),u(D,x,null),o(e,ps,t),u(We,e,t),o(e,ms,t),o(e,Ze,t),o(e,ds,t),u(Qe,e,t),o(e,gs,t),o(e,V,t),u(Ve,V,null),y(V,en),y(V,bt),o(e,us,t),u(Se,e,t),o(e,Ms,t),o(e,Re,t),o(e,hs,t),o(e,ze,t),o(e,fs,t),o(e,Xe,t),o(e,ys,t),u(Fe,e,t),o(e,Ts,t),o(e,S,t),u(Ge,S,null),y(S,tn),y(S,Ut),o(e,Js,t),u(He,e,t),o(e,ws,t),o(e,Ye,t),o(e,Is,t),o(e,Pe,t),o(e,js,t),u(De,e,t),o(e,bs,t),o(e,b,t),u(Oe,b,null),y(b,sn),y(b,$t),y(b,nn),y(b,_t),y(b,ln),y(b,vt),y(b,on),y(b,Ct),y(b,an),y(b,kt),y(b,rn),u(O,b,null),y(b,cn),y(b,xt),y(b,pn),u(K,b,null),y(b,mn),u(ee,b,null),y(b,dn),u(te,b,null),y(b,gn),u(se,b,null),o(e,Us,t),u(Ke,e,t),o(e,$s,t),u(et,e,t),o(e,_s,t),u(tt,e,t),o(e,vs,t),u(ne,e,t),o(e,Cs,t),o(e,A,t),u(st,A,null),y(A,un),y(A,At),y(A,Mn),u(le,A,null),y(A,hn),u(oe,A,null),o(e,ks,t),u(nt,e,t),o(e,xs,t),o(e,lt,t),o(e,As,t),u(ot,e,t),o(e,qs,t),u(ae,e,t),o(e,Es,t),o(e,R,t),u(at,R,null),y(R,fn),y(R,qt),o(e,Ns,t),u(rt,e,t),o(e,Ls,t),o(e,Et,t),Bs=!0},p(e,[t]){const q={};t&2&&(q.$$scope={dirty:t,ctx:e}),I.$set(q);const C={};t&2&&(C.$$scope={dirty:t,ctx:e}),X.$set(C);const it={};t&2&&(it.$$scope={dirty:t,ctx:e}),F.$set(it);const z={};t&2&&(z.$$scope={dirty:t,ctx:e}),G.$set(z);const ct={};t&2&&(ct.$$scope={dirty:t,ctx:e}),H.$set(ct);const W={};t&2&&(W.$$scope={dirty:t,ctx:e}),D.$set(W);const pt={};t&2&&(pt.$$scope={dirty:t,ctx:e}),O.$set(pt);const mt={};t&2&&(mt.$$scope={dirty:t,ctx:e}),K.$set(mt);const U={};t&2&&(U.$$scope={dirty:t,ctx:e}),ee.$set(U);const Z={};t&2&&(Z.$$scope={dirty:t,ctx:e}),te.$set(Z);const dt={};t&2&&(dt.$$scope={dirty:t,ctx:e}),se.$set(dt);const sl={};t&2&&(sl.$$scope={dirty:t,ctx:e}),ne.$set(sl);const nl={};t&2&&(nl.$$scope={dirty:t,ctx:e}),le.$set(nl);const ll={};t&2&&(ll.$$scope={dirty:t,ctx:e}),oe.$set(ll);const ol={};t&2&&(ol.$$scope={dirty:t,ctx:e}),ae.$set(ol)},i(e){Bs||(M(w.$$.fragment,e),M(I.$$.fragment,e),M(ce.$$.fragment,e),M(pe.$$.fragment,e),M(Me.$$.fragment,e),M(fe.$$.fragment,e),M(Te.$$.fragment,e),M(Je.$$.fragment,e),M(X.$$.fragment,e),M(we.$$.fragment,e),M(F.$$.fragment,e),M(G.$$.fragment,e),M(Ie.$$.fragment,e),M(Ue.$$.fragment,e),M($e.$$.fragment,e),M(_e.$$.fragment,e),M(H.$$.fragment,e),M(ve.$$.fragment,e),M(Ce.$$.fragment,e),M(xe.$$.fragment,e),M(Ae.$$.fragment,e),M(qe.$$.fragment,e),M(Ee.$$.fragment,e),M(Le.$$.fragment,e),M(Be.$$.fragment,e),M(D.$$.fragment,e),M(We.$$.fragment,e),M(Qe.$$.fragment,e),M(Ve.$$.fragment,e),M(Se.$$.fragment,e),M(Fe.$$.fragment,e),M(Ge.$$.fragment,e),M(He.$$.fragment,e),M(De.$$.fragment,e),M(Oe.$$.fragment,e),M(O.$$.fragment,e),M(K.$$.fragment,e),M(ee.$$.fragment,e),M(te.$$.fragment,e),M(se.$$.fragment,e),M(Ke.$$.fragment,e),M(et.$$.fragment,e),M(tt.$$.fragment,e),M(ne.$$.fragment,e),M(st.$$.fragment,e),M(le.$$.fragment,e),M(oe.$$.fragment,e),M(nt.$$.fragment,e),M(ot.$$.fragment,e),M(ae.$$.fragment,e),M(at.$$.fragment,e),M(rt.$$.fragment,e),Bs=!0)},o(e){h(w.$$.fragment,e),h(I.$$.fragment,e),h(ce.$$.fragment,e),h(pe.$$.fragment,e),h(Me.$$.fragment,e),h(fe.$$.fragment,e),h(Te.$$.fragment,e),h(Je.$$.fragment,e),h(X.$$.fragment,e),h(we.$$.fragment,e),h(F.$$.fragment,e),h(G.$$.fragment,e),h(Ie.$$.fragment,e),h(Ue.$$.fragment,e),h($e.$$.fragment,e),h(_e.$$.fragment,e),h(H.$$.fragment,e),h(ve.$$.fragment,e),h(Ce.$$.fragment,e),h(xe.$$.fragment,e),h(Ae.$$.fragment,e),h(qe.$$.fragment,e),h(Ee.$$.fragment,e),h(Le.$$.fragment,e),h(Be.$$.fragment,e),h(D.$$.fragment,e),h(We.$$.fragment,e),h(Qe.$$.fragment,e),h(Ve.$$.fragment,e),h(Se.$$.fragment,e),h(Fe.$$.fragment,e),h(Ge.$$.fragment,e),h(He.$$.fragment,e),h(De.$$.fragment,e),h(Oe.$$.fragment,e),h(O.$$.fragment,e),h(K.$$.fragment,e),h(ee.$$.fragment,e),h(te.$$.fragment,e),h(se.$$.fragment,e),h(Ke.$$.fragment,e),h(et.$$.fragment,e),h(tt.$$.fragment,e),h(ne.$$.fragment,e),h(st.$$.fragment,e),h(le.$$.fragment,e),h(oe.$$.fragment,e),h(nt.$$.fragment,e),h(ot.$$.fragment,e),h(ae.$$.fragment,e),h(at.$$.fragment,e),h(rt.$$.fragment,e),Bs=!1},d(e){e&&(n(J),n(i),n(c),n(l),n(Nt),n(ie),n(Lt),n(Bt),n(Wt),n(me),n(Zt),n(de),n(Qt),n(ge),n(Vt),n(ue),n(St),n(Rt),n(he),n(zt),n(Xt),n(ye),n(Ft),n(Gt),n(Ht),n(Yt),n(v),n(Pt),n(Dt),n(je),n(Ot),n(be),n(Kt),n(es),n(ts),n(_),n(ss),n(ns),n(ke),n(ls),n(os),n(B),n(as),n(rs),n(Ne),n(is),n(cs),n(x),n(ps),n(ms),n(Ze),n(ds),n(gs),n(V),n(us),n(Ms),n(Re),n(hs),n(ze),n(fs),n(Xe),n(ys),n(Ts),n(S),n(Js),n(ws),n(Ye),n(Is),n(Pe),n(js),n(bs),n(b),n(Us),n($s),n(_s),n(vs),n(Cs),n(A),n(ks),n(xs),n(lt),n(As),n(qs),n(Es),n(R),n(Ns),n(Ls),n(Et)),n(s),f(w,e),f(I,e),f(ce,e),f(pe,e),f(Me,e),f(fe,e),f(Te,e),f(Je,e),f(X,e),f(we),f(F),f(G),f(Ie,e),f(Ue,e),f($e,e),f(_e),f(H),f(ve),f(Ce,e),f(xe,e),f(Ae),f(qe),f(Ee,e),f(Le,e),f(Be),f(D),f(We,e),f(Qe,e),f(Ve),f(Se,e),f(Fe,e),f(Ge),f(He,e),f(De,e),f(Oe),f(O),f(K),f(ee),f(te),f(se),f(Ke,e),f(et,e),f(tt,e),f(ne,e),f(st),f(le),f(oe),f(nt,e),f(ot,e),f(ae,e),f(at),f(rt,e)}}}const vl='{"title":"Models","local":"models","sections":[{"title":"Models","local":"models","sections":[{"title":"Your custom Model","local":"your-custom-model","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}],"depth":2}],"depth":1}';function Cl(j){return rl(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class Ll extends il{constructor(s){super(),cl(this,s,Cl,_l,al,{})}}export{Ll as component};
