import{s as No,o as Lo,n as V}from"../chunks/scheduler.f6319a2a.js";import{S as Bo,i as Zo,g as i,s as o,r as g,A as Qo,h as m,f as s,c as a,j as k,u,x as p,k as _,y as c,a as l,v as M,d as h,t as f,w as y}from"../chunks/index.85aa684c.js";import{T as Wo}from"../chunks/Tip.ca5bbb16.js";import{D as A,E as G}from"../chunks/ExampleCodeBlock.d40dae58.js";import{C as I}from"../chunks/CodeBlock.3400fc53.js";import{H as N,E as So}from"../chunks/getInferenceSnippets.0233181f.js";function Vo(v){let r,b=`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(){r=i("p"),r.textContent=b},l(T){r=m(T,"P",{"data-svelte-h":!0}),p(r)!=="svelte-19v5hvw"&&(r.textContent=b)},m(T,d){l(T,r,d)},p:V,d(T){T&&s(r)}}}function Ro(v){let r,b="Example:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function zo(v){let r,b="Example:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Xo(v){let r,b="Example:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Fo(v){let r,b="Example:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Go(v){let r,b="Creating a model instance with default settings:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-1368o2k"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Ho(v){let r,b="Creating a model instance with a custom boto3 client:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11isg5i"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Po(v){let r,b="Creating a model instance with client_kwargs for internal client creation:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-1s85quz"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Yo(v){let r,b="Creating a model instance with inference and guardrail configurations:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-4kd7m4"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Do(v){let r,b="Example:",T,d,w;return d=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(){r=i("p"),r.textContent=b,T=o(),g(d.$$.fragment)},l(n){r=m(n,"P",{"data-svelte-h":!0}),p(r)!=="svelte-11lpom8"&&(r.textContent=b),T=a(n),u(d.$$.fragment,n)},m(n,J){l(n,r,J),l(n,T,J),M(d,n,J),w=!0},p:V,i(n){w||(h(d.$$.fragment,n),w=!0)},o(n){f(d.$$.fragment,n),w=!1},d(n){n&&(s(r),s(T)),y(d,n)}}}function Oo(v){let r,b,T,d,w,n,J,Ms,ue,$l=`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.`,hs,Me,fs,he,kl=`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.`,ys,fe,Ts,ye,xl="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.",ws,C,Te,Ln,Qt,Al="Base class for all language model implementations.",Bn,Wt,ql=`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.`,Zn,St,El=`Note:
This is an abstract base class. Subclasses must implement the <code>generate()</code> method
to provide actual model inference capabilities.`,Qn,H,Wn,P,we,Sn,Vt,Nl="Process the input messages and return the model’s response.",Vn,Y,Je,Rn,Rt,Ll="Sometimes APIs do not return the tool call as a specific object, so we need to parse it.",zn,D,be,Xn,zt,Bl="Converts the model into a JSON-compatible dictionary.",Js,je,bs,_e,Zl="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.",js,L,Ie,Fn,Xt,Ql="Base class for API-based language models.",Gn,Ft,Wl=`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.`,Hn,O,Ue,Pn,Gt,Sl="Create the API client for the specific service.",_s,ve,Is,Ce,Vl="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.",Us,$e,vs,ke,Cs,xe,Rl="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:",$s,Ae,ks,K,zl="<p>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.</p>",xs,q,qe,Yn,Ht,Xl="A class that uses Hugging Face’s Transformers library for language model interaction.",Dn,Pt,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.",On,Ee,Gl="<p>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.</p>",Kn,ee,As,Ne,qs,Le,Hl='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.',Es,Be,Pl="You can also set a rate limit in requests per minute by using the <code>requests_per_minute</code> argument:",Ns,Ze,Ls,Qe,Bs,We,Yl="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:",Zs,Se,Qs,x,Ve,el,Yt,Dl="A class to interact with Hugging Face’s Inference Providers for language model interaction.",tl,Dt,Ol="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.",sl,Ot,Kl="Providers include Cerebras, Cohere, Fal, Fireworks, HF-Inference, Hyperbolic, Nebius, Novita, Replicate, SambaNova, Together, and more.",nl,te,ll,se,Re,ol,Kt,eo="Create the Hugging Face client.",Ws,ze,Ss,Xe,to=`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.`,Vs,Fe,Rs,W,Ge,al,es,so='Model to use <a href="https://docs.litellm.ai/docs/#litellm-python-sdk" rel="nofollow">LiteLLM Python SDK</a> to access hundreds of LLMs.',rl,ne,He,il,ts,no="Create the LiteLLM client.",zs,Pe,Xs,Ye,lo=`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.`,Fs,De,Gs,B,Oe,ml,ss,oo='Router‑based client for interacting with the <a href="https://docs.litellm.ai/docs/routing" rel="nofollow">LiteLLM Python SDK Router</a>.',cl,ns,ao=`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.`,dl,le,Hs,Ke,Ps,et,ro=`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):`,Ys,tt,Ds,st,io="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:",Os,nt,Ks,R,lt,pl,ls,mo="This model connects to an OpenAI-compatible API server.",en,ot,tn,at,co="<code>AzureOpenAIServerModel</code> allows you to connect to any Azure OpenAI deployment.",sn,rt,po="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>.",nn,it,go='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.',ln,mt,on,z,ct,gl,os,uo="This model connects to an Azure OpenAI deployment.",an,dt,rn,pt,Mo="<code>AmazonBedrockServerModel</code> helps you connect to Amazon Bedrock and run your agent with any available models.",mn,gt,ho="Below is an example setup. This class also offers additional options for customization.",cn,ut,dn,j,Mt,ul,as,fo="A model class for interacting with Amazon Bedrock Server models through the Bedrock API.",Ml,rs,yo=`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.`,hl,is,To="Authentication:",fl,ms,wo="Amazon Bedrock supports multiple authentication methods:",yl,cs,Jo=`<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,ht,bo=`<p>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>.</p>`,wl,ds,jo="Examples:",Jl,oe,bl,ae,jl,re,_l,ie,pn,ft,gn,yt,un,Tt,Mn,me,_o="<p>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.</p>",hn,Z,wt,Il,ps,Io="A class to interact with models loaded using MLX on Apple silicon.",Ul,Jt,Uo="<p>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.</p>",vl,ce,fn,bt,yn,jt,vo='Model to use <a href="https://docs.vllm.ai/" rel="nofollow">vLLM</a> for fast LLM inference and serving.',Tn,_t,wn,de,Co="<p>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.</p>",Jn,X,It,Cl,gs,$o='Model to use <a href="https://docs.vllm.ai/" rel="nofollow">vLLM</a> for fast LLM inference and serving.',bn,Ut,jn,vt,ko="You’re free to create and use your own models to power your agent.",_n,Ct,xo=`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:`,In,$t,Ao='<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>',Un,kt,qo=`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.`,vn,xt,Cn,At,Eo='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.',$n,qt,kn,us,xn;return w=new N({props:{title:"Models",local:"models",headingTag:"h1"}}),J=new Wo({props:{warning:!0,$$slots:{default:[Vo]},$$scope:{ctx:v}}}),Me=new N({props:{title:"Models",local:"models",headingTag:"h2"}}),fe=new N({props:{title:"Base Model",local:"smolagents.Model",headingTag:"h3"}}),Te=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"}}),H=new G({props:{anchor:"smolagents.Model.example",$$slots:{default:[Ro]},$$scope:{ctx:v}}}),we=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>
`}}),Je=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"}}),be=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"}}),je=new N({props:{title:"API Model",local:"smolagents.ApiModel",headingTag:"h3"}}),Ie=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#L1055"}}),Ue=new A({props:{name:"create_client",anchor:"smolagents.ApiModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1089"}}),ve=new N({props:{title:"TransformersModel",local:"smolagents.TransformersModel",headingTag:"h3"}}),$e=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}}),ke=new I({props:{code:"V2hhdCUyMGE=",highlighted:"&gt;&gt;&gt; What a",wrap:!1}}),Ae=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}}),qe=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>
`}}),ee=new G({props:{anchor:"smolagents.TransformersModel.example",$$slots:{default:[zo]},$$scope:{ctx:v}}}),Ne=new N({props:{title:"InferenceClientModel",local:"smolagents.InferenceClientModel",headingTag:"h3"}}),Ze=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}}),Qe=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}}),Se=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}}),Ve=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#L1341",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>
`}}),te=new G({props:{anchor:"smolagents.InferenceClientModel.example",$$slots:{default:[Xo]},$$scope:{ctx:v}}}),Re=new A({props:{name:"create_client",anchor:"smolagents.InferenceClientModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1432"}}),ze=new N({props:{title:"LiteLLMModel",local:"smolagents.LiteLLMModel",headingTag:"h3"}}),Fe=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}}),Ge=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#L1098"}}),He=new A({props:{name:"create_client",anchor:"smolagents.LiteLLMModel.create_client",parameters:[],source:"https://github.com/huggingface/smolagents/blob/main/src/smolagents/models.py#L1148"}}),Pe=new N({props:{title:"LiteLLMRouterModel",local:"smolagents.LiteLLMRouterModel",headingTag:"h3"}}),De=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}}),Oe=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#L1248"}}),le=new G({props:{anchor:"smolagents.LiteLLMRouterModel.example",$$slots:{default:[Fo]},$$scope:{ctx:v}}}),Ke=new N({props:{title:"OpenAIServerModel",local:"smolagents.OpenAIServerModel",headingTag:"h3"}}),tt=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}}),nt=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}}),lt=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#L1523"}}),ot=new N({props:{title:"AzureOpenAIServerModel",local:"smolagents.AzureOpenAIServerModel",headingTag:"h3"}}),mt=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}}),ct=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#L1668"}}),dt=new N({props:{title:"AmazonBedrockServerModel",local:"smolagents.AmazonBedrockServerModel",headingTag:"h3"}}),ut=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}}),Mt=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#L1728"}}),oe=new G({props:{anchor:"smolagents.AmazonBedrockServerModel.example",$$slots:{default:[Go]},$$scope:{ctx:v}}}),ae=new G({props:{anchor:"smolagents.AmazonBedrockServerModel.example-2",$$slots:{default:[Ho]},$$scope:{ctx:v}}}),re=new G({props:{anchor:"smolagents.AmazonBedrockServerModel.example-3",$$slots:{default:[Po]},$$scope:{ctx:v}}}),ie=new G({props:{anchor:"smolagents.AmazonBedrockServerModel.example-4",$$slots:{default:[Yo]},$$scope:{ctx:v}}}),ft=new N({props:{title:"MLXModel",local:"smolagents.MLXModel",headingTag:"h3"}}),yt=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}}),wt=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"}}),ce=new G({props:{anchor:"smolagents.MLXModel.example",$$slots:{default:[Do]},$$scope:{ctx:v}}}),bt=new N({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}}),It=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"}}),Ut=new N({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}}),qt=new So({props:{source:"https://github.com/huggingface/smolagents/blob/main/docs/source/en/reference/models.md"}}),{c(){r=i("meta"),b=o(),T=i("p"),d=o(),g(w.$$.fragment),n=o(),g(J.$$.fragment),Ms=o(),ue=i("p"),ue.innerHTML=$l,hs=o(),g(Me.$$.fragment),fs=o(),he=i("p"),he.innerHTML=kl,ys=o(),g(fe.$$.fragment),Ts=o(),ye=i("p"),ye.innerHTML=xl,ws=o(),C=i("div"),g(Te.$$.fragment),Ln=o(),Qt=i("p"),Qt.textContent=Al,Bn=o(),Wt=i("p"),Wt.textContent=ql,Zn=o(),St=i("p"),St.innerHTML=El,Qn=o(),g(H.$$.fragment),Wn=o(),P=i("div"),g(we.$$.fragment),Sn=o(),Vt=i("p"),Vt.textContent=Nl,Vn=o(),Y=i("div"),g(Je.$$.fragment),Rn=o(),Rt=i("p"),Rt.textContent=Ll,zn=o(),D=i("div"),g(be.$$.fragment),Xn=o(),zt=i("p"),zt.textContent=Bl,Js=o(),g(je.$$.fragment),bs=o(),_e=i("p"),_e.innerHTML=Zl,js=o(),L=i("div"),g(Ie.$$.fragment),Fn=o(),Xt=i("p"),Xt.textContent=Ql,Gn=o(),Ft=i("p"),Ft.textContent=Wl,Hn=o(),O=i("div"),g(Ue.$$.fragment),Pn=o(),Gt=i("p"),Gt.textContent=Sl,_s=o(),g(ve.$$.fragment),Is=o(),Ce=i("p"),Ce.innerHTML=Vl,Us=o(),g($e.$$.fragment),vs=o(),g(ke.$$.fragment),Cs=o(),xe=i("p"),xe.innerHTML=Rl,$s=o(),g(Ae.$$.fragment),ks=o(),K=i("blockquote"),K.innerHTML=zl,xs=o(),q=i("div"),g(qe.$$.fragment),Yn=o(),Ht=i("p"),Ht.textContent=Xl,Dn=o(),Pt=i("p"),Pt.textContent=Fl,On=o(),Ee=i("blockquote"),Ee.innerHTML=Gl,Kn=o(),g(ee.$$.fragment),As=o(),g(Ne.$$.fragment),qs=o(),Le=i("p"),Le.innerHTML=Hl,Es=o(),Be=i("p"),Be.innerHTML=Pl,Ns=o(),g(Ze.$$.fragment),Ls=o(),g(Qe.$$.fragment),Bs=o(),We=i("p"),We.innerHTML=Yl,Zs=o(),g(Se.$$.fragment),Qs=o(),x=i("div"),g(Ve.$$.fragment),el=o(),Yt=i("p"),Yt.textContent=Dl,tl=o(),Dt=i("p"),Dt.textContent=Ol,sl=o(),Ot=i("p"),Ot.textContent=Kl,nl=o(),g(te.$$.fragment),ll=o(),se=i("div"),g(Re.$$.fragment),ol=o(),Kt=i("p"),Kt.textContent=eo,Ws=o(),g(ze.$$.fragment),Ss=o(),Xe=i("p"),Xe.innerHTML=to,Vs=o(),g(Fe.$$.fragment),Rs=o(),W=i("div"),g(Ge.$$.fragment),al=o(),es=i("p"),es.innerHTML=so,rl=o(),ne=i("div"),g(He.$$.fragment),il=o(),ts=i("p"),ts.textContent=no,zs=o(),g(Pe.$$.fragment),Xs=o(),Ye=i("p"),Ye.innerHTML=lo,Fs=o(),g(De.$$.fragment),Gs=o(),B=i("div"),g(Oe.$$.fragment),ml=o(),ss=i("p"),ss.innerHTML=oo,cl=o(),ns=i("p"),ns.textContent=ao,dl=o(),g(le.$$.fragment),Hs=o(),g(Ke.$$.fragment),Ps=o(),et=i("p"),et.innerHTML=ro,Ys=o(),g(tt.$$.fragment),Ds=o(),st=i("p"),st.innerHTML=io,Os=o(),g(nt.$$.fragment),Ks=o(),R=i("div"),g(lt.$$.fragment),pl=o(),ls=i("p"),ls.textContent=mo,en=o(),g(ot.$$.fragment),tn=o(),at=i("p"),at.innerHTML=co,sn=o(),rt=i("p"),rt.innerHTML=po,nn=o(),it=i("p"),it.innerHTML=go,ln=o(),g(mt.$$.fragment),on=o(),z=i("div"),g(ct.$$.fragment),gl=o(),os=i("p"),os.textContent=uo,an=o(),g(dt.$$.fragment),rn=o(),pt=i("p"),pt.innerHTML=Mo,mn=o(),gt=i("p"),gt.textContent=ho,cn=o(),g(ut.$$.fragment),dn=o(),j=i("div"),g(Mt.$$.fragment),ul=o(),as=i("p"),as.textContent=fo,Ml=o(),rs=i("p"),rs.textContent=yo,hl=o(),is=i("p"),is.textContent=To,fl=o(),ms=i("p"),ms.textContent=wo,yl=o(),cs=i("ul"),cs.innerHTML=Jo,Tl=o(),ht=i("blockquote"),ht.innerHTML=bo,wl=o(),ds=i("p"),ds.textContent=jo,Jl=o(),g(oe.$$.fragment),bl=o(),g(ae.$$.fragment),jl=o(),g(re.$$.fragment),_l=o(),g(ie.$$.fragment),pn=o(),g(ft.$$.fragment),gn=o(),g(yt.$$.fragment),un=o(),g(Tt.$$.fragment),Mn=o(),me=i("blockquote"),me.innerHTML=_o,hn=o(),Z=i("div"),g(wt.$$.fragment),Il=o(),ps=i("p"),ps.textContent=Io,Ul=o(),Jt=i("blockquote"),Jt.innerHTML=Uo,vl=o(),g(ce.$$.fragment),fn=o(),g(bt.$$.fragment),yn=o(),jt=i("p"),jt.innerHTML=vo,Tn=o(),g(_t.$$.fragment),wn=o(),de=i("blockquote"),de.innerHTML=Co,Jn=o(),X=i("div"),g(It.$$.fragment),Cl=o(),gs=i("p"),gs.innerHTML=$o,bn=o(),g(Ut.$$.fragment),jn=o(),vt=i("p"),vt.textContent=ko,_n=o(),Ct=i("p"),Ct.innerHTML=xo,In=o(),$t=i("ol"),$t.innerHTML=Ao,Un=o(),kt=i("p"),kt.innerHTML=qo,vn=o(),g(xt.$$.fragment),Cn=o(),At=i("p"),At.innerHTML=Eo,$n=o(),g(qt.$$.fragment),kn=o(),us=i("p"),this.h()},l(e){const t=Qo("svelte-u9bgzb",document.head);r=m(t,"META",{name:!0,content:!0}),t.forEach(s),b=a(e),T=m(e,"P",{}),k(T).forEach(s),d=a(e),u(w.$$.fragment,e),n=a(e),u(J.$$.fragment,e),Ms=a(e),ue=m(e,"P",{"data-svelte-h":!0}),p(ue)!=="svelte-17nnzxz"&&(ue.innerHTML=$l),hs=a(e),u(Me.$$.fragment,e),fs=a(e),he=m(e,"P",{"data-svelte-h":!0}),p(he)!=="svelte-19xyef7"&&(he.innerHTML=kl),ys=a(e),u(fe.$$.fragment,e),Ts=a(e),ye=m(e,"P",{"data-svelte-h":!0}),p(ye)!=="svelte-oebo46"&&(ye.innerHTML=xl),ws=a(e),C=m(e,"DIV",{class:!0});var $=k(C);u(Te.$$.fragment,$),Ln=a($),Qt=m($,"P",{"data-svelte-h":!0}),p(Qt)!=="svelte-akdo2d"&&(Qt.textContent=Al),Bn=a($),Wt=m($,"P",{"data-svelte-h":!0}),p(Wt)!=="svelte-fzlv7p"&&(Wt.textContent=ql),Zn=a($),St=m($,"P",{"data-svelte-h":!0}),p(St)!=="svelte-1nh53b7"&&(St.innerHTML=El),Qn=a($),u(H.$$.fragment,$),Wn=a($),P=m($,"DIV",{class:!0});var Et=k(P);u(we.$$.fragment,Et),Sn=a(Et),Vt=m(Et,"P",{"data-svelte-h":!0}),p(Vt)!=="svelte-w01v3a"&&(Vt.textContent=Nl),Et.forEach(s),Vn=a($),Y=m($,"DIV",{class:!0});var Nt=k(Y);u(Je.$$.fragment,Nt),Rn=a(Nt),Rt=m(Nt,"P",{"data-svelte-h":!0}),p(Rt)!=="svelte-xj9yar"&&(Rt.textContent=Ll),Nt.forEach(s),zn=a($),D=m($,"DIV",{class:!0});var Lt=k(D);u(be.$$.fragment,Lt),Xn=a(Lt),zt=m(Lt,"P",{"data-svelte-h":!0}),p(zt)!=="svelte-138117q"&&(zt.textContent=Bl),Lt.forEach(s),$.forEach(s),Js=a(e),u(je.$$.fragment,e),bs=a(e),_e=m(e,"P",{"data-svelte-h":!0}),p(_e)!=="svelte-pbx5jd"&&(_e.innerHTML=Zl),js=a(e),L=m(e,"DIV",{class:!0});var S=k(L);u(Ie.$$.fragment,S),Fn=a(S),Xt=m(S,"P",{"data-svelte-h":!0}),p(Xt)!=="svelte-mqlsp2"&&(Xt.textContent=Ql),Gn=a(S),Ft=m(S,"P",{"data-svelte-h":!0}),p(Ft)!=="svelte-1pa0fc1"&&(Ft.textContent=Wl),Hn=a(S),O=m(S,"DIV",{class:!0});var Bt=k(O);u(Ue.$$.fragment,Bt),Pn=a(Bt),Gt=m(Bt,"P",{"data-svelte-h":!0}),p(Gt)!=="svelte-8ki1kt"&&(Gt.textContent=Sl),Bt.forEach(s),S.forEach(s),_s=a(e),u(ve.$$.fragment,e),Is=a(e),Ce=m(e,"P",{"data-svelte-h":!0}),p(Ce)!=="svelte-ulv590"&&(Ce.innerHTML=Vl),Us=a(e),u($e.$$.fragment,e),vs=a(e),u(ke.$$.fragment,e),Cs=a(e),xe=m(e,"P",{"data-svelte-h":!0}),p(xe)!=="svelte-g5vlul"&&(xe.innerHTML=Rl),$s=a(e),u(Ae.$$.fragment,e),ks=a(e),K=m(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(K)!=="svelte-103z9yw"&&(K.innerHTML=zl),xs=a(e),q=m(e,"DIV",{class:!0});var Q=k(q);u(qe.$$.fragment,Q),Yn=a(Q),Ht=m(Q,"P",{"data-svelte-h":!0}),p(Ht)!=="svelte-1ex1ahr"&&(Ht.textContent=Xl),Dn=a(Q),Pt=m(Q,"P",{"data-svelte-h":!0}),p(Pt)!=="svelte-1140acn"&&(Pt.textContent=Fl),On=a(Q),Ee=m(Q,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(Ee)!=="svelte-103z9yw"&&(Ee.innerHTML=Gl),Kn=a(Q),u(ee.$$.fragment,Q),Q.forEach(s),As=a(e),u(Ne.$$.fragment,e),qs=a(e),Le=m(e,"P",{"data-svelte-h":!0}),p(Le)!=="svelte-iu01g0"&&(Le.innerHTML=Hl),Es=a(e),Be=m(e,"P",{"data-svelte-h":!0}),p(Be)!=="svelte-kvj8ld"&&(Be.innerHTML=Pl),Ns=a(e),u(Ze.$$.fragment,e),Ls=a(e),u(Qe.$$.fragment,e),Bs=a(e),We=m(e,"P",{"data-svelte-h":!0}),p(We)!=="svelte-1hlk7ls"&&(We.innerHTML=Yl),Zs=a(e),u(Se.$$.fragment,e),Qs=a(e),x=m(e,"DIV",{class:!0});var E=k(x);u(Ve.$$.fragment,E),el=a(E),Yt=m(E,"P",{"data-svelte-h":!0}),p(Yt)!=="svelte-axkcn3"&&(Yt.textContent=Dl),tl=a(E),Dt=m(E,"P",{"data-svelte-h":!0}),p(Dt)!=="svelte-bducrc"&&(Dt.textContent=Ol),sl=a(E),Ot=m(E,"P",{"data-svelte-h":!0}),p(Ot)!=="svelte-12eu297"&&(Ot.textContent=Kl),nl=a(E),u(te.$$.fragment,E),ll=a(E),se=m(E,"DIV",{class:!0});var Zt=k(se);u(Re.$$.fragment,Zt),ol=a(Zt),Kt=m(Zt,"P",{"data-svelte-h":!0}),p(Kt)!=="svelte-ym2f5u"&&(Kt.textContent=eo),Zt.forEach(s),E.forEach(s),Ws=a(e),u(ze.$$.fragment,e),Ss=a(e),Xe=m(e,"P",{"data-svelte-h":!0}),p(Xe)!=="svelte-1m09ddd"&&(Xe.innerHTML=to),Vs=a(e),u(Fe.$$.fragment,e),Rs=a(e),W=m(e,"DIV",{class:!0});var F=k(W);u(Ge.$$.fragment,F),al=a(F),es=m(F,"P",{"data-svelte-h":!0}),p(es)!=="svelte-5g97zk"&&(es.innerHTML=so),rl=a(F),ne=m(F,"DIV",{class:!0});var An=k(ne);u(He.$$.fragment,An),il=a(An),ts=m(An,"P",{"data-svelte-h":!0}),p(ts)!=="svelte-12r14rd"&&(ts.textContent=no),An.forEach(s),F.forEach(s),zs=a(e),u(Pe.$$.fragment,e),Xs=a(e),Ye=m(e,"P",{"data-svelte-h":!0}),p(Ye)!=="svelte-cark4"&&(Ye.innerHTML=lo),Fs=a(e),u(De.$$.fragment,e),Gs=a(e),B=m(e,"DIV",{class:!0});var pe=k(B);u(Oe.$$.fragment,pe),ml=a(pe),ss=m(pe,"P",{"data-svelte-h":!0}),p(ss)!=="svelte-2o2pf3"&&(ss.innerHTML=oo),cl=a(pe),ns=m(pe,"P",{"data-svelte-h":!0}),p(ns)!=="svelte-1cq7nyu"&&(ns.textContent=ao),dl=a(pe),u(le.$$.fragment,pe),pe.forEach(s),Hs=a(e),u(Ke.$$.fragment,e),Ps=a(e),et=m(e,"P",{"data-svelte-h":!0}),p(et)!=="svelte-juyrd0"&&(et.innerHTML=ro),Ys=a(e),u(tt.$$.fragment,e),Ds=a(e),st=m(e,"P",{"data-svelte-h":!0}),p(st)!=="svelte-1hlk7ls"&&(st.innerHTML=io),Os=a(e),u(nt.$$.fragment,e),Ks=a(e),R=m(e,"DIV",{class:!0});var qn=k(R);u(lt.$$.fragment,qn),pl=a(qn),ls=m(qn,"P",{"data-svelte-h":!0}),p(ls)!=="svelte-1bc1pfc"&&(ls.textContent=mo),qn.forEach(s),en=a(e),u(ot.$$.fragment,e),tn=a(e),at=m(e,"P",{"data-svelte-h":!0}),p(at)!=="svelte-1946uqd"&&(at.innerHTML=co),sn=a(e),rt=m(e,"P",{"data-svelte-h":!0}),p(rt)!=="svelte-1tbo5q5"&&(rt.innerHTML=po),nn=a(e),it=m(e,"P",{"data-svelte-h":!0}),p(it)!=="svelte-16r94fh"&&(it.innerHTML=go),ln=a(e),u(mt.$$.fragment,e),on=a(e),z=m(e,"DIV",{class:!0});var En=k(z);u(ct.$$.fragment,En),gl=a(En),os=m(En,"P",{"data-svelte-h":!0}),p(os)!=="svelte-1fspdqk"&&(os.textContent=uo),En.forEach(s),an=a(e),u(dt.$$.fragment,e),rn=a(e),pt=m(e,"P",{"data-svelte-h":!0}),p(pt)!=="svelte-72042c"&&(pt.innerHTML=Mo),mn=a(e),gt=m(e,"P",{"data-svelte-h":!0}),p(gt)!=="svelte-l4p418"&&(gt.textContent=ho),cn=a(e),u(ut.$$.fragment,e),dn=a(e),j=m(e,"DIV",{class:!0});var U=k(j);u(Mt.$$.fragment,U),ul=a(U),as=m(U,"P",{"data-svelte-h":!0}),p(as)!=="svelte-nngfd4"&&(as.textContent=fo),Ml=a(U),rs=m(U,"P",{"data-svelte-h":!0}),p(rs)!=="svelte-1milklp"&&(rs.textContent=yo),hl=a(U),is=m(U,"P",{"data-svelte-h":!0}),p(is)!=="svelte-xgynbu"&&(is.textContent=To),fl=a(U),ms=m(U,"P",{"data-svelte-h":!0}),p(ms)!=="svelte-r4fpk6"&&(ms.textContent=wo),yl=a(U),cs=m(U,"UL",{"data-svelte-h":!0}),p(cs)!=="svelte-bxyop7"&&(cs.innerHTML=Jo),Tl=a(U),ht=m(U,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(ht)!=="svelte-ens2rm"&&(ht.innerHTML=bo),wl=a(U),ds=m(U,"P",{"data-svelte-h":!0}),p(ds)!=="svelte-kvfsh7"&&(ds.textContent=jo),Jl=a(U),u(oe.$$.fragment,U),bl=a(U),u(ae.$$.fragment,U),jl=a(U),u(re.$$.fragment,U),_l=a(U),u(ie.$$.fragment,U),U.forEach(s),pn=a(e),u(ft.$$.fragment,e),gn=a(e),u(yt.$$.fragment,e),un=a(e),u(Tt.$$.fragment,e),Mn=a(e),me=m(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(me)!=="svelte-covr82"&&(me.innerHTML=_o),hn=a(e),Z=m(e,"DIV",{class:!0});var ge=k(Z);u(wt.$$.fragment,ge),Il=a(ge),ps=m(ge,"P",{"data-svelte-h":!0}),p(ps)!=="svelte-t9ku5w"&&(ps.textContent=Io),Ul=a(ge),Jt=m(ge,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(Jt)!=="svelte-covr82"&&(Jt.innerHTML=Uo),vl=a(ge),u(ce.$$.fragment,ge),ge.forEach(s),fn=a(e),u(bt.$$.fragment,e),yn=a(e),jt=m(e,"P",{"data-svelte-h":!0}),p(jt)!=="svelte-1vi10v1"&&(jt.innerHTML=vo),Tn=a(e),u(_t.$$.fragment,e),wn=a(e),de=m(e,"BLOCKQUOTE",{class:!0,"data-svelte-h":!0}),p(de)!=="svelte-9qh0h6"&&(de.innerHTML=Co),Jn=a(e),X=m(e,"DIV",{class:!0});var Nn=k(X);u(It.$$.fragment,Nn),Cl=a(Nn),gs=m(Nn,"P",{"data-svelte-h":!0}),p(gs)!=="svelte-1vi10v1"&&(gs.innerHTML=$o),Nn.forEach(s),bn=a(e),u(Ut.$$.fragment,e),jn=a(e),vt=m(e,"P",{"data-svelte-h":!0}),p(vt)!=="svelte-nwgagp"&&(vt.textContent=ko),_n=a(e),Ct=m(e,"P",{"data-svelte-h":!0}),p(Ct)!=="svelte-1982g4m"&&(Ct.innerHTML=xo),In=a(e),$t=m(e,"OL",{"data-svelte-h":!0}),p($t)!=="svelte-otqs16"&&($t.innerHTML=Ao),Un=a(e),kt=m(e,"P",{"data-svelte-h":!0}),p(kt)!=="svelte-ww7ptk"&&(kt.innerHTML=qo),vn=a(e),u(xt.$$.fragment,e),Cn=a(e),At=m(e,"P",{"data-svelte-h":!0}),p(At)!=="svelte-1kcdlrn"&&(At.innerHTML=Eo),$n=a(e),u(qt.$$.fragment,e),kn=a(e),us=m(e,"P",{}),k(us).forEach(s),this.h()},h(){_(r,"name","hf:doc:metadata"),_(r,"content",Ko),_(P,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(Y,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(D,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(C,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(O,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(L,"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","tip"),_(Ee,"class","tip"),_(q,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(se,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(x,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ne,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(W,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(B,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(R,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(ht,"class","tip"),_(j,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(me,"class","tip"),_(Jt,"class","tip"),_(Z,"class","docstring border-l-2 border-t-2 pl-4 pt-3.5 border-gray-100 rounded-tl-xl mb-6 mt-8"),_(de,"class","tip"),_(X,"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){c(document.head,r),l(e,b,t),l(e,T,t),l(e,d,t),M(w,e,t),l(e,n,t),M(J,e,t),l(e,Ms,t),l(e,ue,t),l(e,hs,t),M(Me,e,t),l(e,fs,t),l(e,he,t),l(e,ys,t),M(fe,e,t),l(e,Ts,t),l(e,ye,t),l(e,ws,t),l(e,C,t),M(Te,C,null),c(C,Ln),c(C,Qt),c(C,Bn),c(C,Wt),c(C,Zn),c(C,St),c(C,Qn),M(H,C,null),c(C,Wn),c(C,P),M(we,P,null),c(P,Sn),c(P,Vt),c(C,Vn),c(C,Y),M(Je,Y,null),c(Y,Rn),c(Y,Rt),c(C,zn),c(C,D),M(be,D,null),c(D,Xn),c(D,zt),l(e,Js,t),M(je,e,t),l(e,bs,t),l(e,_e,t),l(e,js,t),l(e,L,t),M(Ie,L,null),c(L,Fn),c(L,Xt),c(L,Gn),c(L,Ft),c(L,Hn),c(L,O),M(Ue,O,null),c(O,Pn),c(O,Gt),l(e,_s,t),M(ve,e,t),l(e,Is,t),l(e,Ce,t),l(e,Us,t),M($e,e,t),l(e,vs,t),M(ke,e,t),l(e,Cs,t),l(e,xe,t),l(e,$s,t),M(Ae,e,t),l(e,ks,t),l(e,K,t),l(e,xs,t),l(e,q,t),M(qe,q,null),c(q,Yn),c(q,Ht),c(q,Dn),c(q,Pt),c(q,On),c(q,Ee),c(q,Kn),M(ee,q,null),l(e,As,t),M(Ne,e,t),l(e,qs,t),l(e,Le,t),l(e,Es,t),l(e,Be,t),l(e,Ns,t),M(Ze,e,t),l(e,Ls,t),M(Qe,e,t),l(e,Bs,t),l(e,We,t),l(e,Zs,t),M(Se,e,t),l(e,Qs,t),l(e,x,t),M(Ve,x,null),c(x,el),c(x,Yt),c(x,tl),c(x,Dt),c(x,sl),c(x,Ot),c(x,nl),M(te,x,null),c(x,ll),c(x,se),M(Re,se,null),c(se,ol),c(se,Kt),l(e,Ws,t),M(ze,e,t),l(e,Ss,t),l(e,Xe,t),l(e,Vs,t),M(Fe,e,t),l(e,Rs,t),l(e,W,t),M(Ge,W,null),c(W,al),c(W,es),c(W,rl),c(W,ne),M(He,ne,null),c(ne,il),c(ne,ts),l(e,zs,t),M(Pe,e,t),l(e,Xs,t),l(e,Ye,t),l(e,Fs,t),M(De,e,t),l(e,Gs,t),l(e,B,t),M(Oe,B,null),c(B,ml),c(B,ss),c(B,cl),c(B,ns),c(B,dl),M(le,B,null),l(e,Hs,t),M(Ke,e,t),l(e,Ps,t),l(e,et,t),l(e,Ys,t),M(tt,e,t),l(e,Ds,t),l(e,st,t),l(e,Os,t),M(nt,e,t),l(e,Ks,t),l(e,R,t),M(lt,R,null),c(R,pl),c(R,ls),l(e,en,t),M(ot,e,t),l(e,tn,t),l(e,at,t),l(e,sn,t),l(e,rt,t),l(e,nn,t),l(e,it,t),l(e,ln,t),M(mt,e,t),l(e,on,t),l(e,z,t),M(ct,z,null),c(z,gl),c(z,os),l(e,an,t),M(dt,e,t),l(e,rn,t),l(e,pt,t),l(e,mn,t),l(e,gt,t),l(e,cn,t),M(ut,e,t),l(e,dn,t),l(e,j,t),M(Mt,j,null),c(j,ul),c(j,as),c(j,Ml),c(j,rs),c(j,hl),c(j,is),c(j,fl),c(j,ms),c(j,yl),c(j,cs),c(j,Tl),c(j,ht),c(j,wl),c(j,ds),c(j,Jl),M(oe,j,null),c(j,bl),M(ae,j,null),c(j,jl),M(re,j,null),c(j,_l),M(ie,j,null),l(e,pn,t),M(ft,e,t),l(e,gn,t),M(yt,e,t),l(e,un,t),M(Tt,e,t),l(e,Mn,t),l(e,me,t),l(e,hn,t),l(e,Z,t),M(wt,Z,null),c(Z,Il),c(Z,ps),c(Z,Ul),c(Z,Jt),c(Z,vl),M(ce,Z,null),l(e,fn,t),M(bt,e,t),l(e,yn,t),l(e,jt,t),l(e,Tn,t),M(_t,e,t),l(e,wn,t),l(e,de,t),l(e,Jn,t),l(e,X,t),M(It,X,null),c(X,Cl),c(X,gs),l(e,bn,t),M(Ut,e,t),l(e,jn,t),l(e,vt,t),l(e,_n,t),l(e,Ct,t),l(e,In,t),l(e,$t,t),l(e,Un,t),l(e,kt,t),l(e,vn,t),M(xt,e,t),l(e,Cn,t),l(e,At,t),l(e,$n,t),M(qt,e,t),l(e,kn,t),l(e,us,t),xn=!0},p(e,[t]){const $={};t&2&&($.$$scope={dirty:t,ctx:e}),J.$set($);const Et={};t&2&&(Et.$$scope={dirty:t,ctx:e}),H.$set(Et);const Nt={};t&2&&(Nt.$$scope={dirty:t,ctx:e}),ee.$set(Nt);const Lt={};t&2&&(Lt.$$scope={dirty:t,ctx:e}),te.$set(Lt);const S={};t&2&&(S.$$scope={dirty:t,ctx:e}),le.$set(S);const Bt={};t&2&&(Bt.$$scope={dirty:t,ctx:e}),oe.$set(Bt);const Q={};t&2&&(Q.$$scope={dirty:t,ctx:e}),ae.$set(Q);const E={};t&2&&(E.$$scope={dirty:t,ctx:e}),re.$set(E);const Zt={};t&2&&(Zt.$$scope={dirty:t,ctx:e}),ie.$set(Zt);const F={};t&2&&(F.$$scope={dirty:t,ctx:e}),ce.$set(F)},i(e){xn||(h(w.$$.fragment,e),h(J.$$.fragment,e),h(Me.$$.fragment,e),h(fe.$$.fragment,e),h(Te.$$.fragment,e),h(H.$$.fragment,e),h(we.$$.fragment,e),h(Je.$$.fragment,e),h(be.$$.fragment,e),h(je.$$.fragment,e),h(Ie.$$.fragment,e),h(Ue.$$.fragment,e),h(ve.$$.fragment,e),h($e.$$.fragment,e),h(ke.$$.fragment,e),h(Ae.$$.fragment,e),h(qe.$$.fragment,e),h(ee.$$.fragment,e),h(Ne.$$.fragment,e),h(Ze.$$.fragment,e),h(Qe.$$.fragment,e),h(Se.$$.fragment,e),h(Ve.$$.fragment,e),h(te.$$.fragment,e),h(Re.$$.fragment,e),h(ze.$$.fragment,e),h(Fe.$$.fragment,e),h(Ge.$$.fragment,e),h(He.$$.fragment,e),h(Pe.$$.fragment,e),h(De.$$.fragment,e),h(Oe.$$.fragment,e),h(le.$$.fragment,e),h(Ke.$$.fragment,e),h(tt.$$.fragment,e),h(nt.$$.fragment,e),h(lt.$$.fragment,e),h(ot.$$.fragment,e),h(mt.$$.fragment,e),h(ct.$$.fragment,e),h(dt.$$.fragment,e),h(ut.$$.fragment,e),h(Mt.$$.fragment,e),h(oe.$$.fragment,e),h(ae.$$.fragment,e),h(re.$$.fragment,e),h(ie.$$.fragment,e),h(ft.$$.fragment,e),h(yt.$$.fragment,e),h(Tt.$$.fragment,e),h(wt.$$.fragment,e),h(ce.$$.fragment,e),h(bt.$$.fragment,e),h(_t.$$.fragment,e),h(It.$$.fragment,e),h(Ut.$$.fragment,e),h(xt.$$.fragment,e),h(qt.$$.fragment,e),xn=!0)},o(e){f(w.$$.fragment,e),f(J.$$.fragment,e),f(Me.$$.fragment,e),f(fe.$$.fragment,e),f(Te.$$.fragment,e),f(H.$$.fragment,e),f(we.$$.fragment,e),f(Je.$$.fragment,e),f(be.$$.fragment,e),f(je.$$.fragment,e),f(Ie.$$.fragment,e),f(Ue.$$.fragment,e),f(ve.$$.fragment,e),f($e.$$.fragment,e),f(ke.$$.fragment,e),f(Ae.$$.fragment,e),f(qe.$$.fragment,e),f(ee.$$.fragment,e),f(Ne.$$.fragment,e),f(Ze.$$.fragment,e),f(Qe.$$.fragment,e),f(Se.$$.fragment,e),f(Ve.$$.fragment,e),f(te.$$.fragment,e),f(Re.$$.fragment,e),f(ze.$$.fragment,e),f(Fe.$$.fragment,e),f(Ge.$$.fragment,e),f(He.$$.fragment,e),f(Pe.$$.fragment,e),f(De.$$.fragment,e),f(Oe.$$.fragment,e),f(le.$$.fragment,e),f(Ke.$$.fragment,e),f(tt.$$.fragment,e),f(nt.$$.fragment,e),f(lt.$$.fragment,e),f(ot.$$.fragment,e),f(mt.$$.fragment,e),f(ct.$$.fragment,e),f(dt.$$.fragment,e),f(ut.$$.fragment,e),f(Mt.$$.fragment,e),f(oe.$$.fragment,e),f(ae.$$.fragment,e),f(re.$$.fragment,e),f(ie.$$.fragment,e),f(ft.$$.fragment,e),f(yt.$$.fragment,e),f(Tt.$$.fragment,e),f(wt.$$.fragment,e),f(ce.$$.fragment,e),f(bt.$$.fragment,e),f(_t.$$.fragment,e),f(It.$$.fragment,e),f(Ut.$$.fragment,e),f(xt.$$.fragment,e),f(qt.$$.fragment,e),xn=!1},d(e){e&&(s(b),s(T),s(d),s(n),s(Ms),s(ue),s(hs),s(fs),s(he),s(ys),s(Ts),s(ye),s(ws),s(C),s(Js),s(bs),s(_e),s(js),s(L),s(_s),s(Is),s(Ce),s(Us),s(vs),s(Cs),s(xe),s($s),s(ks),s(K),s(xs),s(q),s(As),s(qs),s(Le),s(Es),s(Be),s(Ns),s(Ls),s(Bs),s(We),s(Zs),s(Qs),s(x),s(Ws),s(Ss),s(Xe),s(Vs),s(Rs),s(W),s(zs),s(Xs),s(Ye),s(Fs),s(Gs),s(B),s(Hs),s(Ps),s(et),s(Ys),s(Ds),s(st),s(Os),s(Ks),s(R),s(en),s(tn),s(at),s(sn),s(rt),s(nn),s(it),s(ln),s(on),s(z),s(an),s(rn),s(pt),s(mn),s(gt),s(cn),s(dn),s(j),s(pn),s(gn),s(un),s(Mn),s(me),s(hn),s(Z),s(fn),s(yn),s(jt),s(Tn),s(wn),s(de),s(Jn),s(X),s(bn),s(jn),s(vt),s(_n),s(Ct),s(In),s($t),s(Un),s(kt),s(vn),s(Cn),s(At),s($n),s(kn),s(us)),s(r),y(w,e),y(J,e),y(Me,e),y(fe,e),y(Te),y(H),y(we),y(Je),y(be),y(je,e),y(Ie),y(Ue),y(ve,e),y($e,e),y(ke,e),y(Ae,e),y(qe),y(ee),y(Ne,e),y(Ze,e),y(Qe,e),y(Se,e),y(Ve),y(te),y(Re),y(ze,e),y(Fe,e),y(Ge),y(He),y(Pe,e),y(De,e),y(Oe),y(le),y(Ke,e),y(tt,e),y(nt,e),y(lt),y(ot,e),y(mt,e),y(ct),y(dt,e),y(ut,e),y(Mt),y(oe),y(ae),y(re),y(ie),y(ft,e),y(yt,e),y(Tt,e),y(wt),y(ce),y(bt,e),y(_t,e),y(It),y(Ut,e),y(xt,e),y(qt,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(v){return Lo(()=>{new URLSearchParams(window.location.search).get("fw")}),[]}class ra extends Bo{constructor(r){super(),Zo(this,r,ea,Oo,No,{})}}export{ra as component};
