You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.html 117 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286
  1. <!doctype html>
  2. <html lang="en" class="no-js">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1">
  6. <link rel="prev" href="../llama.native.llamatokendataarraynative/">
  7. <link rel="next" href="../llama.native.safellamacontexthandle/">
  8. <link rel="icon" href="../../assets/images/favicon.png">
  9. <meta name="generator" content="mkdocs-1.4.3, mkdocs-material-9.1.16">
  10. <title>llama.native.nativeapi - LLamaSharp Documentation</title>
  11. <link rel="stylesheet" href="../../assets/stylesheets/main.26e3688c.min.css">
  12. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  13. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,700,700i%7CRoboto+Mono:400,400i,700,700i&display=fallback">
  14. <style>:root{--md-text-font:"Roboto";--md-code-font:"Roboto Mono"}</style>
  15. <script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
  16. </head>
  17. <body dir="ltr">
  18. <script>var palette=__md_get("__palette");if(palette&&"object"==typeof palette.color)for(var key of Object.keys(palette.color))document.body.setAttribute("data-md-color-"+key,palette.color[key])</script>
  19. <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
  20. <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
  21. <label class="md-overlay" for="__drawer"></label>
  22. <div data-md-component="skip">
  23. <a href="#nativeapi" class="md-skip">
  24. Skip to content
  25. </a>
  26. </div>
  27. <div data-md-component="announce">
  28. </div>
  29. <div data-md-color-scheme="default" data-md-component="outdated" hidden>
  30. </div>
  31. <header class="md-header md-header--shadow" data-md-component="header">
  32. <nav class="md-header__inner md-grid" aria-label="Header">
  33. <a href="../.." title="LLamaSharp Documentation" class="md-header__button md-logo" aria-label="LLamaSharp Documentation" data-md-component="logo">
  34. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
  35. </a>
  36. <label class="md-header__button md-icon" for="__drawer">
  37. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
  38. </label>
  39. <div class="md-header__title" data-md-component="header-title">
  40. <div class="md-header__ellipsis">
  41. <div class="md-header__topic">
  42. <span class="md-ellipsis">
  43. LLamaSharp Documentation
  44. </span>
  45. </div>
  46. <div class="md-header__topic" data-md-component="header-topic">
  47. <span class="md-ellipsis">
  48. llama.native.nativeapi
  49. </span>
  50. </div>
  51. </div>
  52. </div>
  53. <label class="md-header__button md-icon" for="__search">
  54. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
  55. </label>
  56. <div class="md-search" data-md-component="search" role="dialog">
  57. <label class="md-search__overlay" for="__search"></label>
  58. <div class="md-search__inner" role="search">
  59. <form class="md-search__form" name="search">
  60. <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" required>
  61. <label class="md-search__icon md-icon" for="__search">
  62. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5Z"/></svg>
  63. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12Z"/></svg>
  64. </label>
  65. <nav class="md-search__options" aria-label="Search">
  66. <button type="reset" class="md-search__icon md-icon" title="Clear" aria-label="Clear" tabindex="-1">
  67. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41Z"/></svg>
  68. </button>
  69. </nav>
  70. </form>
  71. <div class="md-search__output">
  72. <div class="md-search__scrollwrap" data-md-scrollfix>
  73. <div class="md-search-result" data-md-component="search-result">
  74. <div class="md-search-result__meta">
  75. Initializing search
  76. </div>
  77. <ol class="md-search-result__list" role="presentation"></ol>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </div>
  83. </nav>
  84. </header>
  85. <div class="md-container" data-md-component="container">
  86. <main class="md-main" data-md-component="main">
  87. <div class="md-main__inner md-grid">
  88. <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
  89. <div class="md-sidebar__scrollwrap">
  90. <div class="md-sidebar__inner">
  91. <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
  92. <label class="md-nav__title" for="__drawer">
  93. <a href="../.." title="LLamaSharp Documentation" class="md-nav__button md-logo" aria-label="LLamaSharp Documentation" data-md-component="logo">
  94. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 8a3 3 0 0 0 3-3 3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3m0 3.54C9.64 9.35 6.5 8 3 8v11c3.5 0 6.64 1.35 9 3.54 2.36-2.19 5.5-3.54 9-3.54V8c-3.5 0-6.64 1.35-9 3.54Z"/></svg>
  95. </a>
  96. LLamaSharp Documentation
  97. </label>
  98. <ul class="md-nav__list" data-md-scrollfix>
  99. <li class="md-nav__item">
  100. <a href="../.." class="md-nav__link">
  101. Overview
  102. </a>
  103. </li>
  104. <li class="md-nav__item">
  105. <a href="../../GetStarted/" class="md-nav__link">
  106. Get Started
  107. </a>
  108. </li>
  109. <li class="md-nav__item">
  110. <a href="../../Architecture/" class="md-nav__link">
  111. Architecture
  112. </a>
  113. </li>
  114. <li class="md-nav__item">
  115. <a href="../../Tricks/" class="md-nav__link">
  116. Tricks for FAQ
  117. </a>
  118. </li>
  119. <li class="md-nav__item">
  120. <a href="../../ContributingGuide/" class="md-nav__link">
  121. Contributing Guide
  122. </a>
  123. </li>
  124. <li class="md-nav__item md-nav__item--nested">
  125. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_6" >
  126. <label class="md-nav__link" for="__nav_6" id="__nav_6_label" tabindex="0">
  127. LLamaModel
  128. <span class="md-nav__icon md-icon"></span>
  129. </label>
  130. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_6_label" aria-expanded="false">
  131. <label class="md-nav__title" for="__nav_6">
  132. <span class="md-nav__icon md-icon"></span>
  133. LLamaModel
  134. </label>
  135. <ul class="md-nav__list" data-md-scrollfix>
  136. <li class="md-nav__item">
  137. <a href="../../LLamaModel/parameters/" class="md-nav__link">
  138. Model Parameters
  139. </a>
  140. </li>
  141. <li class="md-nav__item">
  142. <a href="../../LLamaModel/tokenization/" class="md-nav__link">
  143. Tokenization
  144. </a>
  145. </li>
  146. <li class="md-nav__item">
  147. <a href="../../LLamaModel/embeddings/" class="md-nav__link">
  148. Get Embeddings
  149. </a>
  150. </li>
  151. <li class="md-nav__item">
  152. <a href="../../LLamaModel/quantization/" class="md-nav__link">
  153. Quantization
  154. </a>
  155. </li>
  156. <li class="md-nav__item">
  157. <a href="../../LLamaModel/save-load-state/" class="md-nav__link">
  158. Save/Load State
  159. </a>
  160. </li>
  161. </ul>
  162. </nav>
  163. </li>
  164. <li class="md-nav__item md-nav__item--nested">
  165. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_7" >
  166. <label class="md-nav__link" for="__nav_7" id="__nav_7_label" tabindex="0">
  167. LLamaExecutors
  168. <span class="md-nav__icon md-icon"></span>
  169. </label>
  170. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_7_label" aria-expanded="false">
  171. <label class="md-nav__title" for="__nav_7">
  172. <span class="md-nav__icon md-icon"></span>
  173. LLamaExecutors
  174. </label>
  175. <ul class="md-nav__list" data-md-scrollfix>
  176. <li class="md-nav__item">
  177. <a href="../../LLamaExecutors/parameters/" class="md-nav__link">
  178. Inference Parameters
  179. </a>
  180. </li>
  181. <li class="md-nav__item">
  182. <a href="../../LLamaExecutors/text-to-text-apis/" class="md-nav__link">
  183. Text-to-Text APIs
  184. </a>
  185. </li>
  186. <li class="md-nav__item">
  187. <a href="../../LLamaExecutors/save-load-state/" class="md-nav__link">
  188. Save/Load State
  189. </a>
  190. </li>
  191. <li class="md-nav__item">
  192. <a href="../../LLamaExecutors/differences/" class="md-nav__link">
  193. Differences of Executors
  194. </a>
  195. </li>
  196. </ul>
  197. </nav>
  198. </li>
  199. <li class="md-nav__item md-nav__item--nested">
  200. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_8" >
  201. <label class="md-nav__link" for="__nav_8" id="__nav_8_label" tabindex="0">
  202. ChatSession
  203. <span class="md-nav__icon md-icon"></span>
  204. </label>
  205. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_8_label" aria-expanded="false">
  206. <label class="md-nav__title" for="__nav_8">
  207. <span class="md-nav__icon md-icon"></span>
  208. ChatSession
  209. </label>
  210. <ul class="md-nav__list" data-md-scrollfix>
  211. <li class="md-nav__item">
  212. <a href="../../ChatSession/basic-usages/" class="md-nav__link">
  213. Basic Usages
  214. </a>
  215. </li>
  216. <li class="md-nav__item">
  217. <a href="../../ChatSession/transforms/" class="md-nav__link">
  218. Transoforms
  219. </a>
  220. </li>
  221. <li class="md-nav__item">
  222. <a href="../../ChatSession/save-load-session/" class="md-nav__link">
  223. Save/Load Session
  224. </a>
  225. </li>
  226. </ul>
  227. </nav>
  228. </li>
  229. <li class="md-nav__item md-nav__item--nested">
  230. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_9" >
  231. <label class="md-nav__link" for="__nav_9" id="__nav_9_label" tabindex="0">
  232. Non-English Usages
  233. <span class="md-nav__icon md-icon"></span>
  234. </label>
  235. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_9_label" aria-expanded="false">
  236. <label class="md-nav__title" for="__nav_9">
  237. <span class="md-nav__icon md-icon"></span>
  238. Non-English Usages
  239. </label>
  240. <ul class="md-nav__list" data-md-scrollfix>
  241. <li class="md-nav__item">
  242. <a href="../../NonEnglishUsage/Chinese/" class="md-nav__link">
  243. Chinese
  244. </a>
  245. </li>
  246. </ul>
  247. </nav>
  248. </li>
  249. <li class="md-nav__item md-nav__item--nested">
  250. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_10" >
  251. <label class="md-nav__link" for="__nav_10" id="__nav_10_label" tabindex="0">
  252. High-level Applications
  253. <span class="md-nav__icon md-icon"></span>
  254. </label>
  255. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_10_label" aria-expanded="false">
  256. <label class="md-nav__title" for="__nav_10">
  257. <span class="md-nav__icon md-icon"></span>
  258. High-level Applications
  259. </label>
  260. <ul class="md-nav__list" data-md-scrollfix>
  261. <li class="md-nav__item">
  262. <a href="../../HighLevelApps/bot-sharp/" class="md-nav__link">
  263. BotSharp
  264. </a>
  265. </li>
  266. </ul>
  267. </nav>
  268. </li>
  269. <li class="md-nav__item md-nav__item--nested">
  270. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_11" >
  271. <label class="md-nav__link" for="__nav_11" id="__nav_11_label" tabindex="0">
  272. More
  273. <span class="md-nav__icon md-icon"></span>
  274. </label>
  275. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_11_label" aria-expanded="false">
  276. <label class="md-nav__title" for="__nav_11">
  277. <span class="md-nav__icon md-icon"></span>
  278. More
  279. </label>
  280. <ul class="md-nav__list" data-md-scrollfix>
  281. <li class="md-nav__item">
  282. <a href="../../More/log/" class="md-nav__link">
  283. Logger
  284. </a>
  285. </li>
  286. </ul>
  287. </nav>
  288. </li>
  289. <li class="md-nav__item md-nav__item--nested">
  290. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_12" >
  291. <label class="md-nav__link" for="__nav_12" id="__nav_12_label" tabindex="0">
  292. Examples
  293. <span class="md-nav__icon md-icon"></span>
  294. </label>
  295. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_12_label" aria-expanded="false">
  296. <label class="md-nav__title" for="__nav_12">
  297. <span class="md-nav__icon md-icon"></span>
  298. Examples
  299. </label>
  300. <ul class="md-nav__list" data-md-scrollfix>
  301. <li class="md-nav__item">
  302. <a href="../../Examples/ChatSessionStripRoleName/" class="md-nav__link">
  303. Chat session 1
  304. </a>
  305. </li>
  306. <li class="md-nav__item">
  307. <a href="../../Examples/ChatSessionWithRoleName/" class="md-nav__link">
  308. Chat session 2
  309. </a>
  310. </li>
  311. <li class="md-nav__item">
  312. <a href="../../Examples/GetEmbeddings/" class="md-nav__link">
  313. Get embeddings
  314. </a>
  315. </li>
  316. <li class="md-nav__item">
  317. <a href="../../Examples/InstructModeExecute/" class="md-nav__link">
  318. Instruct executor
  319. </a>
  320. </li>
  321. <li class="md-nav__item">
  322. <a href="../../Examples/InteractiveModeExecute/" class="md-nav__link">
  323. Interactive executor
  324. </a>
  325. </li>
  326. <li class="md-nav__item">
  327. <a href="../../Examples/StatelessModeExecute/" class="md-nav__link">
  328. Stateless exeutor
  329. </a>
  330. </li>
  331. <li class="md-nav__item">
  332. <a href="../../Examples/LoadAndSaveSession/" class="md-nav__link">
  333. Load/Save session
  334. </a>
  335. </li>
  336. <li class="md-nav__item">
  337. <a href="../../Examples/LoadAndSaveState/" class="md-nav__link">
  338. Load/Save state
  339. </a>
  340. </li>
  341. <li class="md-nav__item">
  342. <a href="../../Examples/QuantizeModel/" class="md-nav__link">
  343. Quantize model
  344. </a>
  345. </li>
  346. </ul>
  347. </nav>
  348. </li>
  349. <li class="md-nav__item md-nav__item--active md-nav__item--nested">
  350. <input class="md-nav__toggle md-toggle " type="checkbox" id="__nav_13" checked>
  351. <label class="md-nav__link" for="__nav_13" id="__nav_13_label" tabindex="0">
  352. API Reference
  353. <span class="md-nav__icon md-icon"></span>
  354. </label>
  355. <nav class="md-nav" data-md-level="1" aria-labelledby="__nav_13_label" aria-expanded="true">
  356. <label class="md-nav__title" for="__nav_13">
  357. <span class="md-nav__icon md-icon"></span>
  358. API Reference
  359. </label>
  360. <ul class="md-nav__list" data-md-scrollfix>
  361. <li class="md-nav__item">
  362. <a href="../" class="md-nav__link">
  363. index
  364. </a>
  365. </li>
  366. <li class="md-nav__item">
  367. <a href="../llama.abstractions.ihistorytransform/" class="md-nav__link">
  368. llama.abstractions.ihistorytransform
  369. </a>
  370. </li>
  371. <li class="md-nav__item">
  372. <a href="../llama.abstractions.illamaexecutor/" class="md-nav__link">
  373. llama.abstractions.illamaexecutor
  374. </a>
  375. </li>
  376. <li class="md-nav__item">
  377. <a href="../llama.abstractions.itextstreamtransform/" class="md-nav__link">
  378. llama.abstractions.itextstreamtransform
  379. </a>
  380. </li>
  381. <li class="md-nav__item">
  382. <a href="../llama.abstractions.itexttransform/" class="md-nav__link">
  383. llama.abstractions.itexttransform
  384. </a>
  385. </li>
  386. <li class="md-nav__item">
  387. <a href="../llama.chatsession/" class="md-nav__link">
  388. llama.chatsession
  389. </a>
  390. </li>
  391. <li class="md-nav__item">
  392. <a href="../llama.common.authorrole/" class="md-nav__link">
  393. llama.common.authorrole
  394. </a>
  395. </li>
  396. <li class="md-nav__item">
  397. <a href="../llama.common.chathistory/" class="md-nav__link">
  398. llama.common.chathistory
  399. </a>
  400. </li>
  401. <li class="md-nav__item">
  402. <a href="../llama.common.fixedsizequeue-1/" class="md-nav__link">
  403. llama.common.fixedsizequeue-1
  404. </a>
  405. </li>
  406. <li class="md-nav__item">
  407. <a href="../llama.common.illamalogger/" class="md-nav__link">
  408. llama.common.illamalogger
  409. </a>
  410. </li>
  411. <li class="md-nav__item">
  412. <a href="../llama.common.inferenceparams/" class="md-nav__link">
  413. llama.common.inferenceparams
  414. </a>
  415. </li>
  416. <li class="md-nav__item">
  417. <a href="../llama.common.llamadefaultlogger/" class="md-nav__link">
  418. llama.common.llamadefaultlogger
  419. </a>
  420. </li>
  421. <li class="md-nav__item">
  422. <a href="../llama.common.mirostatetype/" class="md-nav__link">
  423. llama.common.mirostatetype
  424. </a>
  425. </li>
  426. <li class="md-nav__item">
  427. <a href="../llama.common.modelparams/" class="md-nav__link">
  428. llama.common.modelparams
  429. </a>
  430. </li>
  431. <li class="md-nav__item">
  432. <a href="../llama.exceptions.runtimeerror/" class="md-nav__link">
  433. llama.exceptions.runtimeerror
  434. </a>
  435. </li>
  436. <li class="md-nav__item">
  437. <a href="../llama.extensions.dictionaryextension/" class="md-nav__link">
  438. llama.extensions.dictionaryextension
  439. </a>
  440. </li>
  441. <li class="md-nav__item">
  442. <a href="../llama.instructexecutor/" class="md-nav__link">
  443. llama.instructexecutor
  444. </a>
  445. </li>
  446. <li class="md-nav__item">
  447. <a href="../llama.interactiveexecutor/" class="md-nav__link">
  448. llama.interactiveexecutor
  449. </a>
  450. </li>
  451. <li class="md-nav__item">
  452. <a href="../llama.llamaembedder/" class="md-nav__link">
  453. llama.llamaembedder
  454. </a>
  455. </li>
  456. <li class="md-nav__item">
  457. <a href="../llama.llamamodel/" class="md-nav__link">
  458. llama.llamamodel
  459. </a>
  460. </li>
  461. <li class="md-nav__item">
  462. <a href="../llama.llamaquantizer/" class="md-nav__link">
  463. llama.llamaquantizer
  464. </a>
  465. </li>
  466. <li class="md-nav__item">
  467. <a href="../llama.llamatransforms/" class="md-nav__link">
  468. llama.llamatransforms
  469. </a>
  470. </li>
  471. <li class="md-nav__item">
  472. <a href="../llama.native.llamacontextparams/" class="md-nav__link">
  473. llama.native.llamacontextparams
  474. </a>
  475. </li>
  476. <li class="md-nav__item">
  477. <a href="../llama.native.llamaftype/" class="md-nav__link">
  478. llama.native.llamaftype
  479. </a>
  480. </li>
  481. <li class="md-nav__item">
  482. <a href="../llama.native.llamatokendata/" class="md-nav__link">
  483. llama.native.llamatokendata
  484. </a>
  485. </li>
  486. <li class="md-nav__item">
  487. <a href="../llama.native.llamatokendataarray/" class="md-nav__link">
  488. llama.native.llamatokendataarray
  489. </a>
  490. </li>
  491. <li class="md-nav__item">
  492. <a href="../llama.native.llamatokendataarraynative/" class="md-nav__link">
  493. llama.native.llamatokendataarraynative
  494. </a>
  495. </li>
  496. <li class="md-nav__item md-nav__item--active">
  497. <input class="md-nav__toggle md-toggle" type="checkbox" id="__toc">
  498. <label class="md-nav__link md-nav__link--active" for="__toc">
  499. llama.native.nativeapi
  500. <span class="md-nav__icon md-icon"></span>
  501. </label>
  502. <a href="./" class="md-nav__link md-nav__link--active">
  503. llama.native.nativeapi
  504. </a>
  505. <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  506. <label class="md-nav__title" for="__toc">
  507. <span class="md-nav__icon md-icon"></span>
  508. Table of contents
  509. </label>
  510. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
  511. <li class="md-nav__item">
  512. <a href="#constructors" class="md-nav__link">
  513. Constructors
  514. </a>
  515. <nav class="md-nav" aria-label="Constructors">
  516. <ul class="md-nav__list">
  517. <li class="md-nav__item">
  518. <a href="#nativeapi_1" class="md-nav__link">
  519. NativeApi()
  520. </a>
  521. </li>
  522. </ul>
  523. </nav>
  524. </li>
  525. <li class="md-nav__item">
  526. <a href="#methods" class="md-nav__link">
  527. Methods
  528. </a>
  529. <nav class="md-nav" aria-label="Methods">
  530. <ul class="md-nav__list">
  531. <li class="md-nav__item">
  532. <a href="#llama_print_timingssafellamacontexthandle" class="md-nav__link">
  533. llama_print_timings(SafeLLamaContextHandle)
  534. </a>
  535. <nav class="md-nav" aria-label="llama_print_timings(SafeLLamaContextHandle)">
  536. <ul class="md-nav__list">
  537. <li class="md-nav__item">
  538. <a href="#parameters" class="md-nav__link">
  539. Parameters
  540. </a>
  541. </li>
  542. </ul>
  543. </nav>
  544. </li>
  545. <li class="md-nav__item">
  546. <a href="#llama_reset_timingssafellamacontexthandle" class="md-nav__link">
  547. llama_reset_timings(SafeLLamaContextHandle)
  548. </a>
  549. <nav class="md-nav" aria-label="llama_reset_timings(SafeLLamaContextHandle)">
  550. <ul class="md-nav__list">
  551. <li class="md-nav__item">
  552. <a href="#parameters_1" class="md-nav__link">
  553. Parameters
  554. </a>
  555. </li>
  556. </ul>
  557. </nav>
  558. </li>
  559. <li class="md-nav__item">
  560. <a href="#llama_print_system_info" class="md-nav__link">
  561. llama_print_system_info()
  562. </a>
  563. <nav class="md-nav" aria-label="llama_print_system_info()">
  564. <ul class="md-nav__list">
  565. <li class="md-nav__item">
  566. <a href="#returns" class="md-nav__link">
  567. Returns
  568. </a>
  569. </li>
  570. </ul>
  571. </nav>
  572. </li>
  573. <li class="md-nav__item">
  574. <a href="#llama_model_quantizestring-string-llamaftype-int32" class="md-nav__link">
  575. llama_model_quantize(String, String, LLamaFtype, Int32)
  576. </a>
  577. <nav class="md-nav" aria-label="llama_model_quantize(String, String, LLamaFtype, Int32)">
  578. <ul class="md-nav__list">
  579. <li class="md-nav__item">
  580. <a href="#parameters_2" class="md-nav__link">
  581. Parameters
  582. </a>
  583. </li>
  584. <li class="md-nav__item">
  585. <a href="#returns_1" class="md-nav__link">
  586. Returns
  587. </a>
  588. </li>
  589. </ul>
  590. </nav>
  591. </li>
  592. <li class="md-nav__item">
  593. <a href="#llama_sample_repetition_penaltysafellamacontexthandle-intptr-int32-uint64-single" class="md-nav__link">
  594. llama_sample_repetition_penalty(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single)
  595. </a>
  596. <nav class="md-nav" aria-label="llama_sample_repetition_penalty(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single)">
  597. <ul class="md-nav__list">
  598. <li class="md-nav__item">
  599. <a href="#parameters_3" class="md-nav__link">
  600. Parameters
  601. </a>
  602. </li>
  603. </ul>
  604. </nav>
  605. </li>
  606. <li class="md-nav__item">
  607. <a href="#llama_sample_frequency_and_presence_penaltiessafellamacontexthandle-intptr-int32-uint64-single-single" class="md-nav__link">
  608. llama_sample_frequency_and_presence_penalties(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single, Single)
  609. </a>
  610. <nav class="md-nav" aria-label="llama_sample_frequency_and_presence_penalties(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single, Single)">
  611. <ul class="md-nav__list">
  612. <li class="md-nav__item">
  613. <a href="#parameters_4" class="md-nav__link">
  614. Parameters
  615. </a>
  616. </li>
  617. </ul>
  618. </nav>
  619. </li>
  620. <li class="md-nav__item">
  621. <a href="#llama_sample_softmaxsafellamacontexthandle-intptr" class="md-nav__link">
  622. llama_sample_softmax(SafeLLamaContextHandle, IntPtr)
  623. </a>
  624. <nav class="md-nav" aria-label="llama_sample_softmax(SafeLLamaContextHandle, IntPtr)">
  625. <ul class="md-nav__list">
  626. <li class="md-nav__item">
  627. <a href="#parameters_5" class="md-nav__link">
  628. Parameters
  629. </a>
  630. </li>
  631. </ul>
  632. </nav>
  633. </li>
  634. <li class="md-nav__item">
  635. <a href="#llama_sample_top_ksafellamacontexthandle-intptr-int32-uint64" class="md-nav__link">
  636. llama_sample_top_k(SafeLLamaContextHandle, IntPtr, Int32, UInt64)
  637. </a>
  638. <nav class="md-nav" aria-label="llama_sample_top_k(SafeLLamaContextHandle, IntPtr, Int32, UInt64)">
  639. <ul class="md-nav__list">
  640. <li class="md-nav__item">
  641. <a href="#parameters_6" class="md-nav__link">
  642. Parameters
  643. </a>
  644. </li>
  645. </ul>
  646. </nav>
  647. </li>
  648. <li class="md-nav__item">
  649. <a href="#llama_sample_top_psafellamacontexthandle-intptr-single-uint64" class="md-nav__link">
  650. llama_sample_top_p(SafeLLamaContextHandle, IntPtr, Single, UInt64)
  651. </a>
  652. <nav class="md-nav" aria-label="llama_sample_top_p(SafeLLamaContextHandle, IntPtr, Single, UInt64)">
  653. <ul class="md-nav__list">
  654. <li class="md-nav__item">
  655. <a href="#parameters_7" class="md-nav__link">
  656. Parameters
  657. </a>
  658. </li>
  659. </ul>
  660. </nav>
  661. </li>
  662. <li class="md-nav__item">
  663. <a href="#llama_sample_tail_freesafellamacontexthandle-intptr-single-uint64" class="md-nav__link">
  664. llama_sample_tail_free(SafeLLamaContextHandle, IntPtr, Single, UInt64)
  665. </a>
  666. <nav class="md-nav" aria-label="llama_sample_tail_free(SafeLLamaContextHandle, IntPtr, Single, UInt64)">
  667. <ul class="md-nav__list">
  668. <li class="md-nav__item">
  669. <a href="#parameters_8" class="md-nav__link">
  670. Parameters
  671. </a>
  672. </li>
  673. </ul>
  674. </nav>
  675. </li>
  676. <li class="md-nav__item">
  677. <a href="#llama_sample_typicalsafellamacontexthandle-intptr-single-uint64" class="md-nav__link">
  678. llama_sample_typical(SafeLLamaContextHandle, IntPtr, Single, UInt64)
  679. </a>
  680. <nav class="md-nav" aria-label="llama_sample_typical(SafeLLamaContextHandle, IntPtr, Single, UInt64)">
  681. <ul class="md-nav__list">
  682. <li class="md-nav__item">
  683. <a href="#parameters_9" class="md-nav__link">
  684. Parameters
  685. </a>
  686. </li>
  687. </ul>
  688. </nav>
  689. </li>
  690. <li class="md-nav__item">
  691. <a href="#llama_sample_temperaturesafellamacontexthandle-intptr-single" class="md-nav__link">
  692. llama_sample_temperature(SafeLLamaContextHandle, IntPtr, Single)
  693. </a>
  694. <nav class="md-nav" aria-label="llama_sample_temperature(SafeLLamaContextHandle, IntPtr, Single)">
  695. <ul class="md-nav__list">
  696. <li class="md-nav__item">
  697. <a href="#parameters_10" class="md-nav__link">
  698. Parameters
  699. </a>
  700. </li>
  701. </ul>
  702. </nav>
  703. </li>
  704. <li class="md-nav__item">
  705. <a href="#llama_sample_token_mirostatsafellamacontexthandle-intptr-single-single-int32-single" class="md-nav__link">
  706. llama_sample_token_mirostat(SafeLLamaContextHandle, IntPtr, Single, Single, Int32, Single*)
  707. </a>
  708. <nav class="md-nav" aria-label="llama_sample_token_mirostat(SafeLLamaContextHandle, IntPtr, Single, Single, Int32, Single*)">
  709. <ul class="md-nav__list">
  710. <li class="md-nav__item">
  711. <a href="#parameters_11" class="md-nav__link">
  712. Parameters
  713. </a>
  714. </li>
  715. <li class="md-nav__item">
  716. <a href="#returns_2" class="md-nav__link">
  717. Returns
  718. </a>
  719. </li>
  720. </ul>
  721. </nav>
  722. </li>
  723. <li class="md-nav__item">
  724. <a href="#llama_sample_token_mirostat_v2safellamacontexthandle-intptr-single-single-single" class="md-nav__link">
  725. llama_sample_token_mirostat_v2(SafeLLamaContextHandle, IntPtr, Single, Single, Single*)
  726. </a>
  727. <nav class="md-nav" aria-label="llama_sample_token_mirostat_v2(SafeLLamaContextHandle, IntPtr, Single, Single, Single*)">
  728. <ul class="md-nav__list">
  729. <li class="md-nav__item">
  730. <a href="#parameters_12" class="md-nav__link">
  731. Parameters
  732. </a>
  733. </li>
  734. <li class="md-nav__item">
  735. <a href="#returns_3" class="md-nav__link">
  736. Returns
  737. </a>
  738. </li>
  739. </ul>
  740. </nav>
  741. </li>
  742. <li class="md-nav__item">
  743. <a href="#llama_sample_token_greedysafellamacontexthandle-intptr" class="md-nav__link">
  744. llama_sample_token_greedy(SafeLLamaContextHandle, IntPtr)
  745. </a>
  746. <nav class="md-nav" aria-label="llama_sample_token_greedy(SafeLLamaContextHandle, IntPtr)">
  747. <ul class="md-nav__list">
  748. <li class="md-nav__item">
  749. <a href="#parameters_13" class="md-nav__link">
  750. Parameters
  751. </a>
  752. </li>
  753. <li class="md-nav__item">
  754. <a href="#returns_4" class="md-nav__link">
  755. Returns
  756. </a>
  757. </li>
  758. </ul>
  759. </nav>
  760. </li>
  761. <li class="md-nav__item">
  762. <a href="#llama_sample_tokensafellamacontexthandle-intptr" class="md-nav__link">
  763. llama_sample_token(SafeLLamaContextHandle, IntPtr)
  764. </a>
  765. <nav class="md-nav" aria-label="llama_sample_token(SafeLLamaContextHandle, IntPtr)">
  766. <ul class="md-nav__list">
  767. <li class="md-nav__item">
  768. <a href="#parameters_14" class="md-nav__link">
  769. Parameters
  770. </a>
  771. </li>
  772. <li class="md-nav__item">
  773. <a href="#returns_5" class="md-nav__link">
  774. Returns
  775. </a>
  776. </li>
  777. </ul>
  778. </nav>
  779. </li>
  780. <li class="md-nav__item">
  781. <a href="#llama_empty_call" class="md-nav__link">
  782. llama_empty_call()
  783. </a>
  784. <nav class="md-nav" aria-label="llama_empty_call()">
  785. <ul class="md-nav__list">
  786. <li class="md-nav__item">
  787. <a href="#returns_6" class="md-nav__link">
  788. Returns
  789. </a>
  790. </li>
  791. </ul>
  792. </nav>
  793. </li>
  794. <li class="md-nav__item">
  795. <a href="#llama_context_default_params" class="md-nav__link">
  796. llama_context_default_params()
  797. </a>
  798. <nav class="md-nav" aria-label="llama_context_default_params()">
  799. <ul class="md-nav__list">
  800. <li class="md-nav__item">
  801. <a href="#returns_7" class="md-nav__link">
  802. Returns
  803. </a>
  804. </li>
  805. </ul>
  806. </nav>
  807. </li>
  808. <li class="md-nav__item">
  809. <a href="#llama_mmap_supported" class="md-nav__link">
  810. llama_mmap_supported()
  811. </a>
  812. <nav class="md-nav" aria-label="llama_mmap_supported()">
  813. <ul class="md-nav__list">
  814. <li class="md-nav__item">
  815. <a href="#returns_8" class="md-nav__link">
  816. Returns
  817. </a>
  818. </li>
  819. </ul>
  820. </nav>
  821. </li>
  822. <li class="md-nav__item">
  823. <a href="#llama_mlock_supported" class="md-nav__link">
  824. llama_mlock_supported()
  825. </a>
  826. <nav class="md-nav" aria-label="llama_mlock_supported()">
  827. <ul class="md-nav__list">
  828. <li class="md-nav__item">
  829. <a href="#returns_9" class="md-nav__link">
  830. Returns
  831. </a>
  832. </li>
  833. </ul>
  834. </nav>
  835. </li>
  836. <li class="md-nav__item">
  837. <a href="#llama_init_from_filestring-llamacontextparams" class="md-nav__link">
  838. llama_init_from_file(String, LLamaContextParams)
  839. </a>
  840. <nav class="md-nav" aria-label="llama_init_from_file(String, LLamaContextParams)">
  841. <ul class="md-nav__list">
  842. <li class="md-nav__item">
  843. <a href="#parameters_15" class="md-nav__link">
  844. Parameters
  845. </a>
  846. </li>
  847. <li class="md-nav__item">
  848. <a href="#returns_10" class="md-nav__link">
  849. Returns
  850. </a>
  851. </li>
  852. </ul>
  853. </nav>
  854. </li>
  855. <li class="md-nav__item">
  856. <a href="#llama_init_backend" class="md-nav__link">
  857. llama_init_backend()
  858. </a>
  859. </li>
  860. <li class="md-nav__item">
  861. <a href="#llama_freeintptr" class="md-nav__link">
  862. llama_free(IntPtr)
  863. </a>
  864. <nav class="md-nav" aria-label="llama_free(IntPtr)">
  865. <ul class="md-nav__list">
  866. <li class="md-nav__item">
  867. <a href="#parameters_16" class="md-nav__link">
  868. Parameters
  869. </a>
  870. </li>
  871. </ul>
  872. </nav>
  873. </li>
  874. <li class="md-nav__item">
  875. <a href="#llama_apply_lora_from_filesafellamacontexthandle-string-string-int32" class="md-nav__link">
  876. llama_apply_lora_from_file(SafeLLamaContextHandle, String, String, Int32)
  877. </a>
  878. <nav class="md-nav" aria-label="llama_apply_lora_from_file(SafeLLamaContextHandle, String, String, Int32)">
  879. <ul class="md-nav__list">
  880. <li class="md-nav__item">
  881. <a href="#parameters_17" class="md-nav__link">
  882. Parameters
  883. </a>
  884. </li>
  885. <li class="md-nav__item">
  886. <a href="#returns_11" class="md-nav__link">
  887. Returns
  888. </a>
  889. </li>
  890. </ul>
  891. </nav>
  892. </li>
  893. <li class="md-nav__item">
  894. <a href="#llama_get_kv_cache_token_countsafellamacontexthandle" class="md-nav__link">
  895. llama_get_kv_cache_token_count(SafeLLamaContextHandle)
  896. </a>
  897. <nav class="md-nav" aria-label="llama_get_kv_cache_token_count(SafeLLamaContextHandle)">
  898. <ul class="md-nav__list">
  899. <li class="md-nav__item">
  900. <a href="#parameters_18" class="md-nav__link">
  901. Parameters
  902. </a>
  903. </li>
  904. <li class="md-nav__item">
  905. <a href="#returns_12" class="md-nav__link">
  906. Returns
  907. </a>
  908. </li>
  909. </ul>
  910. </nav>
  911. </li>
  912. <li class="md-nav__item">
  913. <a href="#llama_set_rng_seedsafellamacontexthandle-int32" class="md-nav__link">
  914. llama_set_rng_seed(SafeLLamaContextHandle, Int32)
  915. </a>
  916. <nav class="md-nav" aria-label="llama_set_rng_seed(SafeLLamaContextHandle, Int32)">
  917. <ul class="md-nav__list">
  918. <li class="md-nav__item">
  919. <a href="#parameters_19" class="md-nav__link">
  920. Parameters
  921. </a>
  922. </li>
  923. </ul>
  924. </nav>
  925. </li>
  926. <li class="md-nav__item">
  927. <a href="#llama_get_state_sizesafellamacontexthandle" class="md-nav__link">
  928. llama_get_state_size(SafeLLamaContextHandle)
  929. </a>
  930. <nav class="md-nav" aria-label="llama_get_state_size(SafeLLamaContextHandle)">
  931. <ul class="md-nav__list">
  932. <li class="md-nav__item">
  933. <a href="#parameters_20" class="md-nav__link">
  934. Parameters
  935. </a>
  936. </li>
  937. <li class="md-nav__item">
  938. <a href="#returns_13" class="md-nav__link">
  939. Returns
  940. </a>
  941. </li>
  942. </ul>
  943. </nav>
  944. </li>
  945. <li class="md-nav__item">
  946. <a href="#llama_copy_state_datasafellamacontexthandle-byte" class="md-nav__link">
  947. llama_copy_state_data(SafeLLamaContextHandle, Byte[])
  948. </a>
  949. <nav class="md-nav" aria-label="llama_copy_state_data(SafeLLamaContextHandle, Byte[])">
  950. <ul class="md-nav__list">
  951. <li class="md-nav__item">
  952. <a href="#parameters_21" class="md-nav__link">
  953. Parameters
  954. </a>
  955. </li>
  956. <li class="md-nav__item">
  957. <a href="#returns_14" class="md-nav__link">
  958. Returns
  959. </a>
  960. </li>
  961. </ul>
  962. </nav>
  963. </li>
  964. <li class="md-nav__item">
  965. <a href="#llama_set_state_datasafellamacontexthandle-byte" class="md-nav__link">
  966. llama_set_state_data(SafeLLamaContextHandle, Byte[])
  967. </a>
  968. <nav class="md-nav" aria-label="llama_set_state_data(SafeLLamaContextHandle, Byte[])">
  969. <ul class="md-nav__list">
  970. <li class="md-nav__item">
  971. <a href="#parameters_22" class="md-nav__link">
  972. Parameters
  973. </a>
  974. </li>
  975. <li class="md-nav__item">
  976. <a href="#returns_15" class="md-nav__link">
  977. Returns
  978. </a>
  979. </li>
  980. </ul>
  981. </nav>
  982. </li>
  983. <li class="md-nav__item">
  984. <a href="#llama_load_session_filesafellamacontexthandle-string-int32-uint64-uint64" class="md-nav__link">
  985. llama_load_session_file(SafeLLamaContextHandle, String, Int32[], UInt64, UInt64*)
  986. </a>
  987. <nav class="md-nav" aria-label="llama_load_session_file(SafeLLamaContextHandle, String, Int32[], UInt64, UInt64*)">
  988. <ul class="md-nav__list">
  989. <li class="md-nav__item">
  990. <a href="#parameters_23" class="md-nav__link">
  991. Parameters
  992. </a>
  993. </li>
  994. <li class="md-nav__item">
  995. <a href="#returns_16" class="md-nav__link">
  996. Returns
  997. </a>
  998. </li>
  999. </ul>
  1000. </nav>
  1001. </li>
  1002. <li class="md-nav__item">
  1003. <a href="#llama_save_session_filesafellamacontexthandle-string-int32-uint64" class="md-nav__link">
  1004. llama_save_session_file(SafeLLamaContextHandle, String, Int32[], UInt64)
  1005. </a>
  1006. <nav class="md-nav" aria-label="llama_save_session_file(SafeLLamaContextHandle, String, Int32[], UInt64)">
  1007. <ul class="md-nav__list">
  1008. <li class="md-nav__item">
  1009. <a href="#parameters_24" class="md-nav__link">
  1010. Parameters
  1011. </a>
  1012. </li>
  1013. <li class="md-nav__item">
  1014. <a href="#returns_17" class="md-nav__link">
  1015. Returns
  1016. </a>
  1017. </li>
  1018. </ul>
  1019. </nav>
  1020. </li>
  1021. <li class="md-nav__item">
  1022. <a href="#llama_evalsafellamacontexthandle-int32-int32-int32-int32" class="md-nav__link">
  1023. llama_eval(SafeLLamaContextHandle, Int32[], Int32, Int32, Int32)
  1024. </a>
  1025. <nav class="md-nav" aria-label="llama_eval(SafeLLamaContextHandle, Int32[], Int32, Int32, Int32)">
  1026. <ul class="md-nav__list">
  1027. <li class="md-nav__item">
  1028. <a href="#parameters_25" class="md-nav__link">
  1029. Parameters
  1030. </a>
  1031. </li>
  1032. <li class="md-nav__item">
  1033. <a href="#returns_18" class="md-nav__link">
  1034. Returns
  1035. </a>
  1036. </li>
  1037. </ul>
  1038. </nav>
  1039. </li>
  1040. <li class="md-nav__item">
  1041. <a href="#llama_eval_with_pointersafellamacontexthandle-int32-int32-int32-int32" class="md-nav__link">
  1042. llama_eval_with_pointer(SafeLLamaContextHandle, Int32*, Int32, Int32, Int32)
  1043. </a>
  1044. <nav class="md-nav" aria-label="llama_eval_with_pointer(SafeLLamaContextHandle, Int32*, Int32, Int32, Int32)">
  1045. <ul class="md-nav__list">
  1046. <li class="md-nav__item">
  1047. <a href="#parameters_26" class="md-nav__link">
  1048. Parameters
  1049. </a>
  1050. </li>
  1051. <li class="md-nav__item">
  1052. <a href="#returns_19" class="md-nav__link">
  1053. Returns
  1054. </a>
  1055. </li>
  1056. </ul>
  1057. </nav>
  1058. </li>
  1059. <li class="md-nav__item">
  1060. <a href="#llama_tokenizesafellamacontexthandle-string-encoding-int32-int32-boolean" class="md-nav__link">
  1061. llama_tokenize(SafeLLamaContextHandle, String, Encoding, Int32[], Int32, Boolean)
  1062. </a>
  1063. <nav class="md-nav" aria-label="llama_tokenize(SafeLLamaContextHandle, String, Encoding, Int32[], Int32, Boolean)">
  1064. <ul class="md-nav__list">
  1065. <li class="md-nav__item">
  1066. <a href="#parameters_27" class="md-nav__link">
  1067. Parameters
  1068. </a>
  1069. </li>
  1070. <li class="md-nav__item">
  1071. <a href="#returns_20" class="md-nav__link">
  1072. Returns
  1073. </a>
  1074. </li>
  1075. </ul>
  1076. </nav>
  1077. </li>
  1078. <li class="md-nav__item">
  1079. <a href="#llama_tokenize_nativesafellamacontexthandle-sbyte-int32-int32-boolean" class="md-nav__link">
  1080. llama_tokenize_native(SafeLLamaContextHandle, SByte[], Int32[], Int32, Boolean)
  1081. </a>
  1082. <nav class="md-nav" aria-label="llama_tokenize_native(SafeLLamaContextHandle, SByte[], Int32[], Int32, Boolean)">
  1083. <ul class="md-nav__list">
  1084. <li class="md-nav__item">
  1085. <a href="#parameters_28" class="md-nav__link">
  1086. Parameters
  1087. </a>
  1088. </li>
  1089. <li class="md-nav__item">
  1090. <a href="#returns_21" class="md-nav__link">
  1091. Returns
  1092. </a>
  1093. </li>
  1094. </ul>
  1095. </nav>
  1096. </li>
  1097. <li class="md-nav__item">
  1098. <a href="#llama_n_vocabsafellamacontexthandle" class="md-nav__link">
  1099. llama_n_vocab(SafeLLamaContextHandle)
  1100. </a>
  1101. <nav class="md-nav" aria-label="llama_n_vocab(SafeLLamaContextHandle)">
  1102. <ul class="md-nav__list">
  1103. <li class="md-nav__item">
  1104. <a href="#parameters_29" class="md-nav__link">
  1105. Parameters
  1106. </a>
  1107. </li>
  1108. <li class="md-nav__item">
  1109. <a href="#returns_22" class="md-nav__link">
  1110. Returns
  1111. </a>
  1112. </li>
  1113. </ul>
  1114. </nav>
  1115. </li>
  1116. <li class="md-nav__item">
  1117. <a href="#llama_n_ctxsafellamacontexthandle" class="md-nav__link">
  1118. llama_n_ctx(SafeLLamaContextHandle)
  1119. </a>
  1120. <nav class="md-nav" aria-label="llama_n_ctx(SafeLLamaContextHandle)">
  1121. <ul class="md-nav__list">
  1122. <li class="md-nav__item">
  1123. <a href="#parameters_30" class="md-nav__link">
  1124. Parameters
  1125. </a>
  1126. </li>
  1127. <li class="md-nav__item">
  1128. <a href="#returns_23" class="md-nav__link">
  1129. Returns
  1130. </a>
  1131. </li>
  1132. </ul>
  1133. </nav>
  1134. </li>
  1135. <li class="md-nav__item">
  1136. <a href="#llama_n_embdsafellamacontexthandle" class="md-nav__link">
  1137. llama_n_embd(SafeLLamaContextHandle)
  1138. </a>
  1139. <nav class="md-nav" aria-label="llama_n_embd(SafeLLamaContextHandle)">
  1140. <ul class="md-nav__list">
  1141. <li class="md-nav__item">
  1142. <a href="#parameters_31" class="md-nav__link">
  1143. Parameters
  1144. </a>
  1145. </li>
  1146. <li class="md-nav__item">
  1147. <a href="#returns_24" class="md-nav__link">
  1148. Returns
  1149. </a>
  1150. </li>
  1151. </ul>
  1152. </nav>
  1153. </li>
  1154. <li class="md-nav__item">
  1155. <a href="#llama_get_logitssafellamacontexthandle" class="md-nav__link">
  1156. llama_get_logits(SafeLLamaContextHandle)
  1157. </a>
  1158. <nav class="md-nav" aria-label="llama_get_logits(SafeLLamaContextHandle)">
  1159. <ul class="md-nav__list">
  1160. <li class="md-nav__item">
  1161. <a href="#parameters_32" class="md-nav__link">
  1162. Parameters
  1163. </a>
  1164. </li>
  1165. <li class="md-nav__item">
  1166. <a href="#returns_25" class="md-nav__link">
  1167. Returns
  1168. </a>
  1169. </li>
  1170. </ul>
  1171. </nav>
  1172. </li>
  1173. <li class="md-nav__item">
  1174. <a href="#llama_get_embeddingssafellamacontexthandle" class="md-nav__link">
  1175. llama_get_embeddings(SafeLLamaContextHandle)
  1176. </a>
  1177. <nav class="md-nav" aria-label="llama_get_embeddings(SafeLLamaContextHandle)">
  1178. <ul class="md-nav__list">
  1179. <li class="md-nav__item">
  1180. <a href="#parameters_33" class="md-nav__link">
  1181. Parameters
  1182. </a>
  1183. </li>
  1184. <li class="md-nav__item">
  1185. <a href="#returns_26" class="md-nav__link">
  1186. Returns
  1187. </a>
  1188. </li>
  1189. </ul>
  1190. </nav>
  1191. </li>
  1192. <li class="md-nav__item">
  1193. <a href="#llama_token_to_strsafellamacontexthandle-int32" class="md-nav__link">
  1194. llama_token_to_str(SafeLLamaContextHandle, Int32)
  1195. </a>
  1196. <nav class="md-nav" aria-label="llama_token_to_str(SafeLLamaContextHandle, Int32)">
  1197. <ul class="md-nav__list">
  1198. <li class="md-nav__item">
  1199. <a href="#parameters_34" class="md-nav__link">
  1200. Parameters
  1201. </a>
  1202. </li>
  1203. <li class="md-nav__item">
  1204. <a href="#returns_27" class="md-nav__link">
  1205. Returns
  1206. </a>
  1207. </li>
  1208. </ul>
  1209. </nav>
  1210. </li>
  1211. <li class="md-nav__item">
  1212. <a href="#llama_token_bos" class="md-nav__link">
  1213. llama_token_bos()
  1214. </a>
  1215. <nav class="md-nav" aria-label="llama_token_bos()">
  1216. <ul class="md-nav__list">
  1217. <li class="md-nav__item">
  1218. <a href="#returns_28" class="md-nav__link">
  1219. Returns
  1220. </a>
  1221. </li>
  1222. </ul>
  1223. </nav>
  1224. </li>
  1225. <li class="md-nav__item">
  1226. <a href="#llama_token_eos" class="md-nav__link">
  1227. llama_token_eos()
  1228. </a>
  1229. <nav class="md-nav" aria-label="llama_token_eos()">
  1230. <ul class="md-nav__list">
  1231. <li class="md-nav__item">
  1232. <a href="#returns_29" class="md-nav__link">
  1233. Returns
  1234. </a>
  1235. </li>
  1236. </ul>
  1237. </nav>
  1238. </li>
  1239. <li class="md-nav__item">
  1240. <a href="#llama_token_nl" class="md-nav__link">
  1241. llama_token_nl()
  1242. </a>
  1243. <nav class="md-nav" aria-label="llama_token_nl()">
  1244. <ul class="md-nav__list">
  1245. <li class="md-nav__item">
  1246. <a href="#returns_30" class="md-nav__link">
  1247. Returns
  1248. </a>
  1249. </li>
  1250. </ul>
  1251. </nav>
  1252. </li>
  1253. </ul>
  1254. </nav>
  1255. </li>
  1256. </ul>
  1257. </nav>
  1258. </li>
  1259. <li class="md-nav__item">
  1260. <a href="../llama.native.safellamacontexthandle/" class="md-nav__link">
  1261. llama.native.safellamacontexthandle
  1262. </a>
  1263. </li>
  1264. <li class="md-nav__item">
  1265. <a href="../llama.native.safellamahandlebase/" class="md-nav__link">
  1266. llama.native.safellamahandlebase
  1267. </a>
  1268. </li>
  1269. <li class="md-nav__item">
  1270. <a href="../llama.oldversion.chatcompletion/" class="md-nav__link">
  1271. llama.oldversion.chatcompletion
  1272. </a>
  1273. </li>
  1274. <li class="md-nav__item">
  1275. <a href="../llama.oldversion.chatcompletionchoice/" class="md-nav__link">
  1276. llama.oldversion.chatcompletionchoice
  1277. </a>
  1278. </li>
  1279. <li class="md-nav__item">
  1280. <a href="../llama.oldversion.chatcompletionchunk/" class="md-nav__link">
  1281. llama.oldversion.chatcompletionchunk
  1282. </a>
  1283. </li>
  1284. <li class="md-nav__item">
  1285. <a href="../llama.oldversion.chatcompletionchunkchoice/" class="md-nav__link">
  1286. llama.oldversion.chatcompletionchunkchoice
  1287. </a>
  1288. </li>
  1289. <li class="md-nav__item">
  1290. <a href="../llama.oldversion.chatcompletionchunkdelta/" class="md-nav__link">
  1291. llama.oldversion.chatcompletionchunkdelta
  1292. </a>
  1293. </li>
  1294. <li class="md-nav__item">
  1295. <a href="../llama.oldversion.chatcompletionmessage/" class="md-nav__link">
  1296. llama.oldversion.chatcompletionmessage
  1297. </a>
  1298. </li>
  1299. <li class="md-nav__item">
  1300. <a href="../llama.oldversion.chatmessagerecord/" class="md-nav__link">
  1301. llama.oldversion.chatmessagerecord
  1302. </a>
  1303. </li>
  1304. <li class="md-nav__item">
  1305. <a href="../llama.oldversion.chatrole/" class="md-nav__link">
  1306. llama.oldversion.chatrole
  1307. </a>
  1308. </li>
  1309. <li class="md-nav__item">
  1310. <a href="../llama.oldversion.chatsession-1/" class="md-nav__link">
  1311. llama.oldversion.chatsession-1
  1312. </a>
  1313. </li>
  1314. <li class="md-nav__item">
  1315. <a href="../llama.oldversion.completion/" class="md-nav__link">
  1316. llama.oldversion.completion
  1317. </a>
  1318. </li>
  1319. <li class="md-nav__item">
  1320. <a href="../llama.oldversion.completionchoice/" class="md-nav__link">
  1321. llama.oldversion.completionchoice
  1322. </a>
  1323. </li>
  1324. <li class="md-nav__item">
  1325. <a href="../llama.oldversion.completionchunk/" class="md-nav__link">
  1326. llama.oldversion.completionchunk
  1327. </a>
  1328. </li>
  1329. <li class="md-nav__item">
  1330. <a href="../llama.oldversion.completionlogprobs/" class="md-nav__link">
  1331. llama.oldversion.completionlogprobs
  1332. </a>
  1333. </li>
  1334. <li class="md-nav__item">
  1335. <a href="../llama.oldversion.completionusage/" class="md-nav__link">
  1336. llama.oldversion.completionusage
  1337. </a>
  1338. </li>
  1339. <li class="md-nav__item">
  1340. <a href="../llama.oldversion.embedding/" class="md-nav__link">
  1341. llama.oldversion.embedding
  1342. </a>
  1343. </li>
  1344. <li class="md-nav__item">
  1345. <a href="../llama.oldversion.embeddingdata/" class="md-nav__link">
  1346. llama.oldversion.embeddingdata
  1347. </a>
  1348. </li>
  1349. <li class="md-nav__item">
  1350. <a href="../llama.oldversion.embeddingusage/" class="md-nav__link">
  1351. llama.oldversion.embeddingusage
  1352. </a>
  1353. </li>
  1354. <li class="md-nav__item">
  1355. <a href="../llama.oldversion.ichatmodel/" class="md-nav__link">
  1356. llama.oldversion.ichatmodel
  1357. </a>
  1358. </li>
  1359. <li class="md-nav__item">
  1360. <a href="../llama.oldversion.llamaembedder/" class="md-nav__link">
  1361. llama.oldversion.llamaembedder
  1362. </a>
  1363. </li>
  1364. <li class="md-nav__item">
  1365. <a href="../llama.oldversion.llamamodel/" class="md-nav__link">
  1366. llama.oldversion.llamamodel
  1367. </a>
  1368. </li>
  1369. <li class="md-nav__item">
  1370. <a href="../llama.oldversion.llamaparams/" class="md-nav__link">
  1371. llama.oldversion.llamaparams
  1372. </a>
  1373. </li>
  1374. <li class="md-nav__item">
  1375. <a href="../llama.resettablellamamodel/" class="md-nav__link">
  1376. llama.resettablellamamodel
  1377. </a>
  1378. </li>
  1379. <li class="md-nav__item">
  1380. <a href="../llama.statefulexecutorbase/" class="md-nav__link">
  1381. llama.statefulexecutorbase
  1382. </a>
  1383. </li>
  1384. <li class="md-nav__item">
  1385. <a href="../llama.statelessexecutor/" class="md-nav__link">
  1386. llama.statelessexecutor
  1387. </a>
  1388. </li>
  1389. </ul>
  1390. </nav>
  1391. </li>
  1392. </ul>
  1393. </nav>
  1394. </div>
  1395. </div>
  1396. </div>
  1397. <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
  1398. <div class="md-sidebar__scrollwrap">
  1399. <div class="md-sidebar__inner">
  1400. <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  1401. <label class="md-nav__title" for="__toc">
  1402. <span class="md-nav__icon md-icon"></span>
  1403. Table of contents
  1404. </label>
  1405. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
  1406. <li class="md-nav__item">
  1407. <a href="#constructors" class="md-nav__link">
  1408. Constructors
  1409. </a>
  1410. <nav class="md-nav" aria-label="Constructors">
  1411. <ul class="md-nav__list">
  1412. <li class="md-nav__item">
  1413. <a href="#nativeapi_1" class="md-nav__link">
  1414. NativeApi()
  1415. </a>
  1416. </li>
  1417. </ul>
  1418. </nav>
  1419. </li>
  1420. <li class="md-nav__item">
  1421. <a href="#methods" class="md-nav__link">
  1422. Methods
  1423. </a>
  1424. <nav class="md-nav" aria-label="Methods">
  1425. <ul class="md-nav__list">
  1426. <li class="md-nav__item">
  1427. <a href="#llama_print_timingssafellamacontexthandle" class="md-nav__link">
  1428. llama_print_timings(SafeLLamaContextHandle)
  1429. </a>
  1430. <nav class="md-nav" aria-label="llama_print_timings(SafeLLamaContextHandle)">
  1431. <ul class="md-nav__list">
  1432. <li class="md-nav__item">
  1433. <a href="#parameters" class="md-nav__link">
  1434. Parameters
  1435. </a>
  1436. </li>
  1437. </ul>
  1438. </nav>
  1439. </li>
  1440. <li class="md-nav__item">
  1441. <a href="#llama_reset_timingssafellamacontexthandle" class="md-nav__link">
  1442. llama_reset_timings(SafeLLamaContextHandle)
  1443. </a>
  1444. <nav class="md-nav" aria-label="llama_reset_timings(SafeLLamaContextHandle)">
  1445. <ul class="md-nav__list">
  1446. <li class="md-nav__item">
  1447. <a href="#parameters_1" class="md-nav__link">
  1448. Parameters
  1449. </a>
  1450. </li>
  1451. </ul>
  1452. </nav>
  1453. </li>
  1454. <li class="md-nav__item">
  1455. <a href="#llama_print_system_info" class="md-nav__link">
  1456. llama_print_system_info()
  1457. </a>
  1458. <nav class="md-nav" aria-label="llama_print_system_info()">
  1459. <ul class="md-nav__list">
  1460. <li class="md-nav__item">
  1461. <a href="#returns" class="md-nav__link">
  1462. Returns
  1463. </a>
  1464. </li>
  1465. </ul>
  1466. </nav>
  1467. </li>
  1468. <li class="md-nav__item">
  1469. <a href="#llama_model_quantizestring-string-llamaftype-int32" class="md-nav__link">
  1470. llama_model_quantize(String, String, LLamaFtype, Int32)
  1471. </a>
  1472. <nav class="md-nav" aria-label="llama_model_quantize(String, String, LLamaFtype, Int32)">
  1473. <ul class="md-nav__list">
  1474. <li class="md-nav__item">
  1475. <a href="#parameters_2" class="md-nav__link">
  1476. Parameters
  1477. </a>
  1478. </li>
  1479. <li class="md-nav__item">
  1480. <a href="#returns_1" class="md-nav__link">
  1481. Returns
  1482. </a>
  1483. </li>
  1484. </ul>
  1485. </nav>
  1486. </li>
  1487. <li class="md-nav__item">
  1488. <a href="#llama_sample_repetition_penaltysafellamacontexthandle-intptr-int32-uint64-single" class="md-nav__link">
  1489. llama_sample_repetition_penalty(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single)
  1490. </a>
  1491. <nav class="md-nav" aria-label="llama_sample_repetition_penalty(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single)">
  1492. <ul class="md-nav__list">
  1493. <li class="md-nav__item">
  1494. <a href="#parameters_3" class="md-nav__link">
  1495. Parameters
  1496. </a>
  1497. </li>
  1498. </ul>
  1499. </nav>
  1500. </li>
  1501. <li class="md-nav__item">
  1502. <a href="#llama_sample_frequency_and_presence_penaltiessafellamacontexthandle-intptr-int32-uint64-single-single" class="md-nav__link">
  1503. llama_sample_frequency_and_presence_penalties(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single, Single)
  1504. </a>
  1505. <nav class="md-nav" aria-label="llama_sample_frequency_and_presence_penalties(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single, Single)">
  1506. <ul class="md-nav__list">
  1507. <li class="md-nav__item">
  1508. <a href="#parameters_4" class="md-nav__link">
  1509. Parameters
  1510. </a>
  1511. </li>
  1512. </ul>
  1513. </nav>
  1514. </li>
  1515. <li class="md-nav__item">
  1516. <a href="#llama_sample_softmaxsafellamacontexthandle-intptr" class="md-nav__link">
  1517. llama_sample_softmax(SafeLLamaContextHandle, IntPtr)
  1518. </a>
  1519. <nav class="md-nav" aria-label="llama_sample_softmax(SafeLLamaContextHandle, IntPtr)">
  1520. <ul class="md-nav__list">
  1521. <li class="md-nav__item">
  1522. <a href="#parameters_5" class="md-nav__link">
  1523. Parameters
  1524. </a>
  1525. </li>
  1526. </ul>
  1527. </nav>
  1528. </li>
  1529. <li class="md-nav__item">
  1530. <a href="#llama_sample_top_ksafellamacontexthandle-intptr-int32-uint64" class="md-nav__link">
  1531. llama_sample_top_k(SafeLLamaContextHandle, IntPtr, Int32, UInt64)
  1532. </a>
  1533. <nav class="md-nav" aria-label="llama_sample_top_k(SafeLLamaContextHandle, IntPtr, Int32, UInt64)">
  1534. <ul class="md-nav__list">
  1535. <li class="md-nav__item">
  1536. <a href="#parameters_6" class="md-nav__link">
  1537. Parameters
  1538. </a>
  1539. </li>
  1540. </ul>
  1541. </nav>
  1542. </li>
  1543. <li class="md-nav__item">
  1544. <a href="#llama_sample_top_psafellamacontexthandle-intptr-single-uint64" class="md-nav__link">
  1545. llama_sample_top_p(SafeLLamaContextHandle, IntPtr, Single, UInt64)
  1546. </a>
  1547. <nav class="md-nav" aria-label="llama_sample_top_p(SafeLLamaContextHandle, IntPtr, Single, UInt64)">
  1548. <ul class="md-nav__list">
  1549. <li class="md-nav__item">
  1550. <a href="#parameters_7" class="md-nav__link">
  1551. Parameters
  1552. </a>
  1553. </li>
  1554. </ul>
  1555. </nav>
  1556. </li>
  1557. <li class="md-nav__item">
  1558. <a href="#llama_sample_tail_freesafellamacontexthandle-intptr-single-uint64" class="md-nav__link">
  1559. llama_sample_tail_free(SafeLLamaContextHandle, IntPtr, Single, UInt64)
  1560. </a>
  1561. <nav class="md-nav" aria-label="llama_sample_tail_free(SafeLLamaContextHandle, IntPtr, Single, UInt64)">
  1562. <ul class="md-nav__list">
  1563. <li class="md-nav__item">
  1564. <a href="#parameters_8" class="md-nav__link">
  1565. Parameters
  1566. </a>
  1567. </li>
  1568. </ul>
  1569. </nav>
  1570. </li>
  1571. <li class="md-nav__item">
  1572. <a href="#llama_sample_typicalsafellamacontexthandle-intptr-single-uint64" class="md-nav__link">
  1573. llama_sample_typical(SafeLLamaContextHandle, IntPtr, Single, UInt64)
  1574. </a>
  1575. <nav class="md-nav" aria-label="llama_sample_typical(SafeLLamaContextHandle, IntPtr, Single, UInt64)">
  1576. <ul class="md-nav__list">
  1577. <li class="md-nav__item">
  1578. <a href="#parameters_9" class="md-nav__link">
  1579. Parameters
  1580. </a>
  1581. </li>
  1582. </ul>
  1583. </nav>
  1584. </li>
  1585. <li class="md-nav__item">
  1586. <a href="#llama_sample_temperaturesafellamacontexthandle-intptr-single" class="md-nav__link">
  1587. llama_sample_temperature(SafeLLamaContextHandle, IntPtr, Single)
  1588. </a>
  1589. <nav class="md-nav" aria-label="llama_sample_temperature(SafeLLamaContextHandle, IntPtr, Single)">
  1590. <ul class="md-nav__list">
  1591. <li class="md-nav__item">
  1592. <a href="#parameters_10" class="md-nav__link">
  1593. Parameters
  1594. </a>
  1595. </li>
  1596. </ul>
  1597. </nav>
  1598. </li>
  1599. <li class="md-nav__item">
  1600. <a href="#llama_sample_token_mirostatsafellamacontexthandle-intptr-single-single-int32-single" class="md-nav__link">
  1601. llama_sample_token_mirostat(SafeLLamaContextHandle, IntPtr, Single, Single, Int32, Single*)
  1602. </a>
  1603. <nav class="md-nav" aria-label="llama_sample_token_mirostat(SafeLLamaContextHandle, IntPtr, Single, Single, Int32, Single*)">
  1604. <ul class="md-nav__list">
  1605. <li class="md-nav__item">
  1606. <a href="#parameters_11" class="md-nav__link">
  1607. Parameters
  1608. </a>
  1609. </li>
  1610. <li class="md-nav__item">
  1611. <a href="#returns_2" class="md-nav__link">
  1612. Returns
  1613. </a>
  1614. </li>
  1615. </ul>
  1616. </nav>
  1617. </li>
  1618. <li class="md-nav__item">
  1619. <a href="#llama_sample_token_mirostat_v2safellamacontexthandle-intptr-single-single-single" class="md-nav__link">
  1620. llama_sample_token_mirostat_v2(SafeLLamaContextHandle, IntPtr, Single, Single, Single*)
  1621. </a>
  1622. <nav class="md-nav" aria-label="llama_sample_token_mirostat_v2(SafeLLamaContextHandle, IntPtr, Single, Single, Single*)">
  1623. <ul class="md-nav__list">
  1624. <li class="md-nav__item">
  1625. <a href="#parameters_12" class="md-nav__link">
  1626. Parameters
  1627. </a>
  1628. </li>
  1629. <li class="md-nav__item">
  1630. <a href="#returns_3" class="md-nav__link">
  1631. Returns
  1632. </a>
  1633. </li>
  1634. </ul>
  1635. </nav>
  1636. </li>
  1637. <li class="md-nav__item">
  1638. <a href="#llama_sample_token_greedysafellamacontexthandle-intptr" class="md-nav__link">
  1639. llama_sample_token_greedy(SafeLLamaContextHandle, IntPtr)
  1640. </a>
  1641. <nav class="md-nav" aria-label="llama_sample_token_greedy(SafeLLamaContextHandle, IntPtr)">
  1642. <ul class="md-nav__list">
  1643. <li class="md-nav__item">
  1644. <a href="#parameters_13" class="md-nav__link">
  1645. Parameters
  1646. </a>
  1647. </li>
  1648. <li class="md-nav__item">
  1649. <a href="#returns_4" class="md-nav__link">
  1650. Returns
  1651. </a>
  1652. </li>
  1653. </ul>
  1654. </nav>
  1655. </li>
  1656. <li class="md-nav__item">
  1657. <a href="#llama_sample_tokensafellamacontexthandle-intptr" class="md-nav__link">
  1658. llama_sample_token(SafeLLamaContextHandle, IntPtr)
  1659. </a>
  1660. <nav class="md-nav" aria-label="llama_sample_token(SafeLLamaContextHandle, IntPtr)">
  1661. <ul class="md-nav__list">
  1662. <li class="md-nav__item">
  1663. <a href="#parameters_14" class="md-nav__link">
  1664. Parameters
  1665. </a>
  1666. </li>
  1667. <li class="md-nav__item">
  1668. <a href="#returns_5" class="md-nav__link">
  1669. Returns
  1670. </a>
  1671. </li>
  1672. </ul>
  1673. </nav>
  1674. </li>
  1675. <li class="md-nav__item">
  1676. <a href="#llama_empty_call" class="md-nav__link">
  1677. llama_empty_call()
  1678. </a>
  1679. <nav class="md-nav" aria-label="llama_empty_call()">
  1680. <ul class="md-nav__list">
  1681. <li class="md-nav__item">
  1682. <a href="#returns_6" class="md-nav__link">
  1683. Returns
  1684. </a>
  1685. </li>
  1686. </ul>
  1687. </nav>
  1688. </li>
  1689. <li class="md-nav__item">
  1690. <a href="#llama_context_default_params" class="md-nav__link">
  1691. llama_context_default_params()
  1692. </a>
  1693. <nav class="md-nav" aria-label="llama_context_default_params()">
  1694. <ul class="md-nav__list">
  1695. <li class="md-nav__item">
  1696. <a href="#returns_7" class="md-nav__link">
  1697. Returns
  1698. </a>
  1699. </li>
  1700. </ul>
  1701. </nav>
  1702. </li>
  1703. <li class="md-nav__item">
  1704. <a href="#llama_mmap_supported" class="md-nav__link">
  1705. llama_mmap_supported()
  1706. </a>
  1707. <nav class="md-nav" aria-label="llama_mmap_supported()">
  1708. <ul class="md-nav__list">
  1709. <li class="md-nav__item">
  1710. <a href="#returns_8" class="md-nav__link">
  1711. Returns
  1712. </a>
  1713. </li>
  1714. </ul>
  1715. </nav>
  1716. </li>
  1717. <li class="md-nav__item">
  1718. <a href="#llama_mlock_supported" class="md-nav__link">
  1719. llama_mlock_supported()
  1720. </a>
  1721. <nav class="md-nav" aria-label="llama_mlock_supported()">
  1722. <ul class="md-nav__list">
  1723. <li class="md-nav__item">
  1724. <a href="#returns_9" class="md-nav__link">
  1725. Returns
  1726. </a>
  1727. </li>
  1728. </ul>
  1729. </nav>
  1730. </li>
  1731. <li class="md-nav__item">
  1732. <a href="#llama_init_from_filestring-llamacontextparams" class="md-nav__link">
  1733. llama_init_from_file(String, LLamaContextParams)
  1734. </a>
  1735. <nav class="md-nav" aria-label="llama_init_from_file(String, LLamaContextParams)">
  1736. <ul class="md-nav__list">
  1737. <li class="md-nav__item">
  1738. <a href="#parameters_15" class="md-nav__link">
  1739. Parameters
  1740. </a>
  1741. </li>
  1742. <li class="md-nav__item">
  1743. <a href="#returns_10" class="md-nav__link">
  1744. Returns
  1745. </a>
  1746. </li>
  1747. </ul>
  1748. </nav>
  1749. </li>
  1750. <li class="md-nav__item">
  1751. <a href="#llama_init_backend" class="md-nav__link">
  1752. llama_init_backend()
  1753. </a>
  1754. </li>
  1755. <li class="md-nav__item">
  1756. <a href="#llama_freeintptr" class="md-nav__link">
  1757. llama_free(IntPtr)
  1758. </a>
  1759. <nav class="md-nav" aria-label="llama_free(IntPtr)">
  1760. <ul class="md-nav__list">
  1761. <li class="md-nav__item">
  1762. <a href="#parameters_16" class="md-nav__link">
  1763. Parameters
  1764. </a>
  1765. </li>
  1766. </ul>
  1767. </nav>
  1768. </li>
  1769. <li class="md-nav__item">
  1770. <a href="#llama_apply_lora_from_filesafellamacontexthandle-string-string-int32" class="md-nav__link">
  1771. llama_apply_lora_from_file(SafeLLamaContextHandle, String, String, Int32)
  1772. </a>
  1773. <nav class="md-nav" aria-label="llama_apply_lora_from_file(SafeLLamaContextHandle, String, String, Int32)">
  1774. <ul class="md-nav__list">
  1775. <li class="md-nav__item">
  1776. <a href="#parameters_17" class="md-nav__link">
  1777. Parameters
  1778. </a>
  1779. </li>
  1780. <li class="md-nav__item">
  1781. <a href="#returns_11" class="md-nav__link">
  1782. Returns
  1783. </a>
  1784. </li>
  1785. </ul>
  1786. </nav>
  1787. </li>
  1788. <li class="md-nav__item">
  1789. <a href="#llama_get_kv_cache_token_countsafellamacontexthandle" class="md-nav__link">
  1790. llama_get_kv_cache_token_count(SafeLLamaContextHandle)
  1791. </a>
  1792. <nav class="md-nav" aria-label="llama_get_kv_cache_token_count(SafeLLamaContextHandle)">
  1793. <ul class="md-nav__list">
  1794. <li class="md-nav__item">
  1795. <a href="#parameters_18" class="md-nav__link">
  1796. Parameters
  1797. </a>
  1798. </li>
  1799. <li class="md-nav__item">
  1800. <a href="#returns_12" class="md-nav__link">
  1801. Returns
  1802. </a>
  1803. </li>
  1804. </ul>
  1805. </nav>
  1806. </li>
  1807. <li class="md-nav__item">
  1808. <a href="#llama_set_rng_seedsafellamacontexthandle-int32" class="md-nav__link">
  1809. llama_set_rng_seed(SafeLLamaContextHandle, Int32)
  1810. </a>
  1811. <nav class="md-nav" aria-label="llama_set_rng_seed(SafeLLamaContextHandle, Int32)">
  1812. <ul class="md-nav__list">
  1813. <li class="md-nav__item">
  1814. <a href="#parameters_19" class="md-nav__link">
  1815. Parameters
  1816. </a>
  1817. </li>
  1818. </ul>
  1819. </nav>
  1820. </li>
  1821. <li class="md-nav__item">
  1822. <a href="#llama_get_state_sizesafellamacontexthandle" class="md-nav__link">
  1823. llama_get_state_size(SafeLLamaContextHandle)
  1824. </a>
  1825. <nav class="md-nav" aria-label="llama_get_state_size(SafeLLamaContextHandle)">
  1826. <ul class="md-nav__list">
  1827. <li class="md-nav__item">
  1828. <a href="#parameters_20" class="md-nav__link">
  1829. Parameters
  1830. </a>
  1831. </li>
  1832. <li class="md-nav__item">
  1833. <a href="#returns_13" class="md-nav__link">
  1834. Returns
  1835. </a>
  1836. </li>
  1837. </ul>
  1838. </nav>
  1839. </li>
  1840. <li class="md-nav__item">
  1841. <a href="#llama_copy_state_datasafellamacontexthandle-byte" class="md-nav__link">
  1842. llama_copy_state_data(SafeLLamaContextHandle, Byte[])
  1843. </a>
  1844. <nav class="md-nav" aria-label="llama_copy_state_data(SafeLLamaContextHandle, Byte[])">
  1845. <ul class="md-nav__list">
  1846. <li class="md-nav__item">
  1847. <a href="#parameters_21" class="md-nav__link">
  1848. Parameters
  1849. </a>
  1850. </li>
  1851. <li class="md-nav__item">
  1852. <a href="#returns_14" class="md-nav__link">
  1853. Returns
  1854. </a>
  1855. </li>
  1856. </ul>
  1857. </nav>
  1858. </li>
  1859. <li class="md-nav__item">
  1860. <a href="#llama_set_state_datasafellamacontexthandle-byte" class="md-nav__link">
  1861. llama_set_state_data(SafeLLamaContextHandle, Byte[])
  1862. </a>
  1863. <nav class="md-nav" aria-label="llama_set_state_data(SafeLLamaContextHandle, Byte[])">
  1864. <ul class="md-nav__list">
  1865. <li class="md-nav__item">
  1866. <a href="#parameters_22" class="md-nav__link">
  1867. Parameters
  1868. </a>
  1869. </li>
  1870. <li class="md-nav__item">
  1871. <a href="#returns_15" class="md-nav__link">
  1872. Returns
  1873. </a>
  1874. </li>
  1875. </ul>
  1876. </nav>
  1877. </li>
  1878. <li class="md-nav__item">
  1879. <a href="#llama_load_session_filesafellamacontexthandle-string-int32-uint64-uint64" class="md-nav__link">
  1880. llama_load_session_file(SafeLLamaContextHandle, String, Int32[], UInt64, UInt64*)
  1881. </a>
  1882. <nav class="md-nav" aria-label="llama_load_session_file(SafeLLamaContextHandle, String, Int32[], UInt64, UInt64*)">
  1883. <ul class="md-nav__list">
  1884. <li class="md-nav__item">
  1885. <a href="#parameters_23" class="md-nav__link">
  1886. Parameters
  1887. </a>
  1888. </li>
  1889. <li class="md-nav__item">
  1890. <a href="#returns_16" class="md-nav__link">
  1891. Returns
  1892. </a>
  1893. </li>
  1894. </ul>
  1895. </nav>
  1896. </li>
  1897. <li class="md-nav__item">
  1898. <a href="#llama_save_session_filesafellamacontexthandle-string-int32-uint64" class="md-nav__link">
  1899. llama_save_session_file(SafeLLamaContextHandle, String, Int32[], UInt64)
  1900. </a>
  1901. <nav class="md-nav" aria-label="llama_save_session_file(SafeLLamaContextHandle, String, Int32[], UInt64)">
  1902. <ul class="md-nav__list">
  1903. <li class="md-nav__item">
  1904. <a href="#parameters_24" class="md-nav__link">
  1905. Parameters
  1906. </a>
  1907. </li>
  1908. <li class="md-nav__item">
  1909. <a href="#returns_17" class="md-nav__link">
  1910. Returns
  1911. </a>
  1912. </li>
  1913. </ul>
  1914. </nav>
  1915. </li>
  1916. <li class="md-nav__item">
  1917. <a href="#llama_evalsafellamacontexthandle-int32-int32-int32-int32" class="md-nav__link">
  1918. llama_eval(SafeLLamaContextHandle, Int32[], Int32, Int32, Int32)
  1919. </a>
  1920. <nav class="md-nav" aria-label="llama_eval(SafeLLamaContextHandle, Int32[], Int32, Int32, Int32)">
  1921. <ul class="md-nav__list">
  1922. <li class="md-nav__item">
  1923. <a href="#parameters_25" class="md-nav__link">
  1924. Parameters
  1925. </a>
  1926. </li>
  1927. <li class="md-nav__item">
  1928. <a href="#returns_18" class="md-nav__link">
  1929. Returns
  1930. </a>
  1931. </li>
  1932. </ul>
  1933. </nav>
  1934. </li>
  1935. <li class="md-nav__item">
  1936. <a href="#llama_eval_with_pointersafellamacontexthandle-int32-int32-int32-int32" class="md-nav__link">
  1937. llama_eval_with_pointer(SafeLLamaContextHandle, Int32*, Int32, Int32, Int32)
  1938. </a>
  1939. <nav class="md-nav" aria-label="llama_eval_with_pointer(SafeLLamaContextHandle, Int32*, Int32, Int32, Int32)">
  1940. <ul class="md-nav__list">
  1941. <li class="md-nav__item">
  1942. <a href="#parameters_26" class="md-nav__link">
  1943. Parameters
  1944. </a>
  1945. </li>
  1946. <li class="md-nav__item">
  1947. <a href="#returns_19" class="md-nav__link">
  1948. Returns
  1949. </a>
  1950. </li>
  1951. </ul>
  1952. </nav>
  1953. </li>
  1954. <li class="md-nav__item">
  1955. <a href="#llama_tokenizesafellamacontexthandle-string-encoding-int32-int32-boolean" class="md-nav__link">
  1956. llama_tokenize(SafeLLamaContextHandle, String, Encoding, Int32[], Int32, Boolean)
  1957. </a>
  1958. <nav class="md-nav" aria-label="llama_tokenize(SafeLLamaContextHandle, String, Encoding, Int32[], Int32, Boolean)">
  1959. <ul class="md-nav__list">
  1960. <li class="md-nav__item">
  1961. <a href="#parameters_27" class="md-nav__link">
  1962. Parameters
  1963. </a>
  1964. </li>
  1965. <li class="md-nav__item">
  1966. <a href="#returns_20" class="md-nav__link">
  1967. Returns
  1968. </a>
  1969. </li>
  1970. </ul>
  1971. </nav>
  1972. </li>
  1973. <li class="md-nav__item">
  1974. <a href="#llama_tokenize_nativesafellamacontexthandle-sbyte-int32-int32-boolean" class="md-nav__link">
  1975. llama_tokenize_native(SafeLLamaContextHandle, SByte[], Int32[], Int32, Boolean)
  1976. </a>
  1977. <nav class="md-nav" aria-label="llama_tokenize_native(SafeLLamaContextHandle, SByte[], Int32[], Int32, Boolean)">
  1978. <ul class="md-nav__list">
  1979. <li class="md-nav__item">
  1980. <a href="#parameters_28" class="md-nav__link">
  1981. Parameters
  1982. </a>
  1983. </li>
  1984. <li class="md-nav__item">
  1985. <a href="#returns_21" class="md-nav__link">
  1986. Returns
  1987. </a>
  1988. </li>
  1989. </ul>
  1990. </nav>
  1991. </li>
  1992. <li class="md-nav__item">
  1993. <a href="#llama_n_vocabsafellamacontexthandle" class="md-nav__link">
  1994. llama_n_vocab(SafeLLamaContextHandle)
  1995. </a>
  1996. <nav class="md-nav" aria-label="llama_n_vocab(SafeLLamaContextHandle)">
  1997. <ul class="md-nav__list">
  1998. <li class="md-nav__item">
  1999. <a href="#parameters_29" class="md-nav__link">
  2000. Parameters
  2001. </a>
  2002. </li>
  2003. <li class="md-nav__item">
  2004. <a href="#returns_22" class="md-nav__link">
  2005. Returns
  2006. </a>
  2007. </li>
  2008. </ul>
  2009. </nav>
  2010. </li>
  2011. <li class="md-nav__item">
  2012. <a href="#llama_n_ctxsafellamacontexthandle" class="md-nav__link">
  2013. llama_n_ctx(SafeLLamaContextHandle)
  2014. </a>
  2015. <nav class="md-nav" aria-label="llama_n_ctx(SafeLLamaContextHandle)">
  2016. <ul class="md-nav__list">
  2017. <li class="md-nav__item">
  2018. <a href="#parameters_30" class="md-nav__link">
  2019. Parameters
  2020. </a>
  2021. </li>
  2022. <li class="md-nav__item">
  2023. <a href="#returns_23" class="md-nav__link">
  2024. Returns
  2025. </a>
  2026. </li>
  2027. </ul>
  2028. </nav>
  2029. </li>
  2030. <li class="md-nav__item">
  2031. <a href="#llama_n_embdsafellamacontexthandle" class="md-nav__link">
  2032. llama_n_embd(SafeLLamaContextHandle)
  2033. </a>
  2034. <nav class="md-nav" aria-label="llama_n_embd(SafeLLamaContextHandle)">
  2035. <ul class="md-nav__list">
  2036. <li class="md-nav__item">
  2037. <a href="#parameters_31" class="md-nav__link">
  2038. Parameters
  2039. </a>
  2040. </li>
  2041. <li class="md-nav__item">
  2042. <a href="#returns_24" class="md-nav__link">
  2043. Returns
  2044. </a>
  2045. </li>
  2046. </ul>
  2047. </nav>
  2048. </li>
  2049. <li class="md-nav__item">
  2050. <a href="#llama_get_logitssafellamacontexthandle" class="md-nav__link">
  2051. llama_get_logits(SafeLLamaContextHandle)
  2052. </a>
  2053. <nav class="md-nav" aria-label="llama_get_logits(SafeLLamaContextHandle)">
  2054. <ul class="md-nav__list">
  2055. <li class="md-nav__item">
  2056. <a href="#parameters_32" class="md-nav__link">
  2057. Parameters
  2058. </a>
  2059. </li>
  2060. <li class="md-nav__item">
  2061. <a href="#returns_25" class="md-nav__link">
  2062. Returns
  2063. </a>
  2064. </li>
  2065. </ul>
  2066. </nav>
  2067. </li>
  2068. <li class="md-nav__item">
  2069. <a href="#llama_get_embeddingssafellamacontexthandle" class="md-nav__link">
  2070. llama_get_embeddings(SafeLLamaContextHandle)
  2071. </a>
  2072. <nav class="md-nav" aria-label="llama_get_embeddings(SafeLLamaContextHandle)">
  2073. <ul class="md-nav__list">
  2074. <li class="md-nav__item">
  2075. <a href="#parameters_33" class="md-nav__link">
  2076. Parameters
  2077. </a>
  2078. </li>
  2079. <li class="md-nav__item">
  2080. <a href="#returns_26" class="md-nav__link">
  2081. Returns
  2082. </a>
  2083. </li>
  2084. </ul>
  2085. </nav>
  2086. </li>
  2087. <li class="md-nav__item">
  2088. <a href="#llama_token_to_strsafellamacontexthandle-int32" class="md-nav__link">
  2089. llama_token_to_str(SafeLLamaContextHandle, Int32)
  2090. </a>
  2091. <nav class="md-nav" aria-label="llama_token_to_str(SafeLLamaContextHandle, Int32)">
  2092. <ul class="md-nav__list">
  2093. <li class="md-nav__item">
  2094. <a href="#parameters_34" class="md-nav__link">
  2095. Parameters
  2096. </a>
  2097. </li>
  2098. <li class="md-nav__item">
  2099. <a href="#returns_27" class="md-nav__link">
  2100. Returns
  2101. </a>
  2102. </li>
  2103. </ul>
  2104. </nav>
  2105. </li>
  2106. <li class="md-nav__item">
  2107. <a href="#llama_token_bos" class="md-nav__link">
  2108. llama_token_bos()
  2109. </a>
  2110. <nav class="md-nav" aria-label="llama_token_bos()">
  2111. <ul class="md-nav__list">
  2112. <li class="md-nav__item">
  2113. <a href="#returns_28" class="md-nav__link">
  2114. Returns
  2115. </a>
  2116. </li>
  2117. </ul>
  2118. </nav>
  2119. </li>
  2120. <li class="md-nav__item">
  2121. <a href="#llama_token_eos" class="md-nav__link">
  2122. llama_token_eos()
  2123. </a>
  2124. <nav class="md-nav" aria-label="llama_token_eos()">
  2125. <ul class="md-nav__list">
  2126. <li class="md-nav__item">
  2127. <a href="#returns_29" class="md-nav__link">
  2128. Returns
  2129. </a>
  2130. </li>
  2131. </ul>
  2132. </nav>
  2133. </li>
  2134. <li class="md-nav__item">
  2135. <a href="#llama_token_nl" class="md-nav__link">
  2136. llama_token_nl()
  2137. </a>
  2138. <nav class="md-nav" aria-label="llama_token_nl()">
  2139. <ul class="md-nav__list">
  2140. <li class="md-nav__item">
  2141. <a href="#returns_30" class="md-nav__link">
  2142. Returns
  2143. </a>
  2144. </li>
  2145. </ul>
  2146. </nav>
  2147. </li>
  2148. </ul>
  2149. </nav>
  2150. </li>
  2151. </ul>
  2152. </nav>
  2153. </div>
  2154. </div>
  2155. </div>
  2156. <div class="md-content" data-md-component="content">
  2157. <article class="md-content__inner md-typeset">
  2158. <h1 id="nativeapi">NativeApi</h1>
  2159. <p>Namespace: LLama.Native</p>
  2160. <pre><code class="language-csharp">public class NativeApi
  2161. </code></pre>
  2162. <p>Inheritance <a href="https://docs.microsoft.com/en-us/dotnet/api/system.object">Object</a> → <a href="./">NativeApi</a></p>
  2163. <h2 id="constructors">Constructors</h2>
  2164. <h3 id="nativeapi_1"><strong>NativeApi()</strong></h3>
  2165. <pre><code class="language-csharp">public NativeApi()
  2166. </code></pre>
  2167. <h2 id="methods">Methods</h2>
  2168. <h3 id="llama_print_timingssafellamacontexthandle"><strong>llama_print_timings(SafeLLamaContextHandle)</strong></h3>
  2169. <pre><code class="language-csharp">public static void llama_print_timings(SafeLLamaContextHandle ctx)
  2170. </code></pre>
  2171. <h4 id="parameters">Parameters</h4>
  2172. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2173. <h3 id="llama_reset_timingssafellamacontexthandle"><strong>llama_reset_timings(SafeLLamaContextHandle)</strong></h3>
  2174. <pre><code class="language-csharp">public static void llama_reset_timings(SafeLLamaContextHandle ctx)
  2175. </code></pre>
  2176. <h4 id="parameters_1">Parameters</h4>
  2177. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2178. <h3 id="llama_print_system_info"><strong>llama_print_system_info()</strong></h3>
  2179. <p>Print system information</p>
  2180. <pre><code class="language-csharp">public static IntPtr llama_print_system_info()
  2181. </code></pre>
  2182. <h4 id="returns">Returns</h4>
  2183. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br></p>
  2184. <h3 id="llama_model_quantizestring-string-llamaftype-int32"><strong>llama_model_quantize(String, String, LLamaFtype, Int32)</strong></h3>
  2185. <pre><code class="language-csharp">public static int llama_model_quantize(string fname_inp, string fname_out, LLamaFtype ftype, int nthread)
  2186. </code></pre>
  2187. <h4 id="parameters_2">Parameters</h4>
  2188. <p><code>fname_inp</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a><br></p>
  2189. <p><code>fname_out</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a><br></p>
  2190. <p><code>ftype</code> <a href="../llama.native.llamaftype/">LLamaFtype</a><br></p>
  2191. <p><code>nthread</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2192. <h4 id="returns_1">Returns</h4>
  2193. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2194. <h3 id="llama_sample_repetition_penaltysafellamacontexthandle-intptr-int32-uint64-single"><strong>llama_sample_repetition_penalty(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single)</strong></h3>
  2195. <p>Repetition penalty described in CTRL academic paper https://arxiv.org/abs/1909.05858, with negative logit fix.</p>
  2196. <pre><code class="language-csharp">public static void llama_sample_repetition_penalty(SafeLLamaContextHandle ctx, IntPtr candidates, Int32[] last_tokens, ulong last_tokens_size, float penalty)
  2197. </code></pre>
  2198. <h4 id="parameters_3">Parameters</h4>
  2199. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2200. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2201. Pointer to LLamaTokenDataArray</p>
  2202. <p><code>last_tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32[]</a><br></p>
  2203. <p><code>last_tokens_size</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2204. <p><code>penalty</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br></p>
  2205. <h3 id="llama_sample_frequency_and_presence_penaltiessafellamacontexthandle-intptr-int32-uint64-single-single"><strong>llama_sample_frequency_and_presence_penalties(SafeLLamaContextHandle, IntPtr, Int32[], UInt64, Single, Single)</strong></h3>
  2206. <p>Frequency and presence penalties described in OpenAI API https://platform.openai.com/docs/api-reference/parameter-details.</p>
  2207. <pre><code class="language-csharp">public static void llama_sample_frequency_and_presence_penalties(SafeLLamaContextHandle ctx, IntPtr candidates, Int32[] last_tokens, ulong last_tokens_size, float alpha_frequency, float alpha_presence)
  2208. </code></pre>
  2209. <h4 id="parameters_4">Parameters</h4>
  2210. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2211. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2212. Pointer to LLamaTokenDataArray</p>
  2213. <p><code>last_tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32[]</a><br></p>
  2214. <p><code>last_tokens_size</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2215. <p><code>alpha_frequency</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br></p>
  2216. <p><code>alpha_presence</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br></p>
  2217. <h3 id="llama_sample_softmaxsafellamacontexthandle-intptr"><strong>llama_sample_softmax(SafeLLamaContextHandle, IntPtr)</strong></h3>
  2218. <p>Sorts candidate tokens by their logits in descending order and calculate probabilities based on logits.</p>
  2219. <pre><code class="language-csharp">public static void llama_sample_softmax(SafeLLamaContextHandle ctx, IntPtr candidates)
  2220. </code></pre>
  2221. <h4 id="parameters_5">Parameters</h4>
  2222. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2223. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2224. Pointer to LLamaTokenDataArray</p>
  2225. <h3 id="llama_sample_top_ksafellamacontexthandle-intptr-int32-uint64"><strong>llama_sample_top_k(SafeLLamaContextHandle, IntPtr, Int32, UInt64)</strong></h3>
  2226. <p>Top-K sampling described in academic paper "The Curious Case of Neural Text Degeneration" https://arxiv.org/abs/1904.09751</p>
  2227. <pre><code class="language-csharp">public static void llama_sample_top_k(SafeLLamaContextHandle ctx, IntPtr candidates, int k, ulong min_keep)
  2228. </code></pre>
  2229. <h4 id="parameters_6">Parameters</h4>
  2230. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2231. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2232. Pointer to LLamaTokenDataArray</p>
  2233. <p><code>k</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2234. <p><code>min_keep</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2235. <h3 id="llama_sample_top_psafellamacontexthandle-intptr-single-uint64"><strong>llama_sample_top_p(SafeLLamaContextHandle, IntPtr, Single, UInt64)</strong></h3>
  2236. <p>Nucleus sampling described in academic paper "The Curious Case of Neural Text Degeneration" https://arxiv.org/abs/1904.09751</p>
  2237. <pre><code class="language-csharp">public static void llama_sample_top_p(SafeLLamaContextHandle ctx, IntPtr candidates, float p, ulong min_keep)
  2238. </code></pre>
  2239. <h4 id="parameters_7">Parameters</h4>
  2240. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2241. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2242. Pointer to LLamaTokenDataArray</p>
  2243. <p><code>p</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br></p>
  2244. <p><code>min_keep</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2245. <h3 id="llama_sample_tail_freesafellamacontexthandle-intptr-single-uint64"><strong>llama_sample_tail_free(SafeLLamaContextHandle, IntPtr, Single, UInt64)</strong></h3>
  2246. <p>Tail Free Sampling described in https://www.trentonbricken.com/Tail-Free-Sampling/.</p>
  2247. <pre><code class="language-csharp">public static void llama_sample_tail_free(SafeLLamaContextHandle ctx, IntPtr candidates, float z, ulong min_keep)
  2248. </code></pre>
  2249. <h4 id="parameters_8">Parameters</h4>
  2250. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2251. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2252. Pointer to LLamaTokenDataArray</p>
  2253. <p><code>z</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br></p>
  2254. <p><code>min_keep</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2255. <h3 id="llama_sample_typicalsafellamacontexthandle-intptr-single-uint64"><strong>llama_sample_typical(SafeLLamaContextHandle, IntPtr, Single, UInt64)</strong></h3>
  2256. <p>Locally Typical Sampling implementation described in the paper https://arxiv.org/abs/2202.00666.</p>
  2257. <pre><code class="language-csharp">public static void llama_sample_typical(SafeLLamaContextHandle ctx, IntPtr candidates, float p, ulong min_keep)
  2258. </code></pre>
  2259. <h4 id="parameters_9">Parameters</h4>
  2260. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2261. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2262. Pointer to LLamaTokenDataArray</p>
  2263. <p><code>p</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br></p>
  2264. <p><code>min_keep</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2265. <h3 id="llama_sample_temperaturesafellamacontexthandle-intptr-single"><strong>llama_sample_temperature(SafeLLamaContextHandle, IntPtr, Single)</strong></h3>
  2266. <pre><code class="language-csharp">public static void llama_sample_temperature(SafeLLamaContextHandle ctx, IntPtr candidates, float temp)
  2267. </code></pre>
  2268. <h4 id="parameters_10">Parameters</h4>
  2269. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2270. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br></p>
  2271. <p><code>temp</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br></p>
  2272. <h3 id="llama_sample_token_mirostatsafellamacontexthandle-intptr-single-single-int32-single"><strong>llama_sample_token_mirostat(SafeLLamaContextHandle, IntPtr, Single, Single, Int32, Single*)</strong></h3>
  2273. <p>Mirostat 1.0 algorithm described in the paper https://arxiv.org/abs/2007.14966. Uses tokens instead of words.</p>
  2274. <pre><code class="language-csharp">public static int llama_sample_token_mirostat(SafeLLamaContextHandle ctx, IntPtr candidates, float tau, float eta, int m, Single* mu)
  2275. </code></pre>
  2276. <h4 id="parameters_11">Parameters</h4>
  2277. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2278. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2279. A vector of <code>llama_token_data</code> containing the candidate tokens, their probabilities (p), and log-odds (logit) for the current position in the generated text.</p>
  2280. <p><code>tau</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br>
  2281. The target cross-entropy (or surprise) value you want to achieve for the generated text. A higher value corresponds to more surprising or less predictable text, while a lower value corresponds to less surprising or more predictable text.</p>
  2282. <p><code>eta</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br>
  2283. The learning rate used to update <code>mu</code> based on the error between the target and observed surprisal of the sampled word. A larger learning rate will cause <code>mu</code> to be updated more quickly, while a smaller learning rate will result in slower updates.</p>
  2284. <p><code>m</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br>
  2285. The number of tokens considered in the estimation of <code>s_hat</code>. This is an arbitrary value that is used to calculate <code>s_hat</code>, which in turn helps to calculate the value of <code>k</code>. In the paper, they use <code>m = 100</code>, but you can experiment with different values to see how it affects the performance of the algorithm.</p>
  2286. <p><code>mu</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single*">Single*</a><br>
  2287. Maximum cross-entropy. This value is initialized to be twice the target cross-entropy (<code>2 * tau</code>) and is updated in the algorithm based on the error between the target and observed surprisal.</p>
  2288. <h4 id="returns_2">Returns</h4>
  2289. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2290. <h3 id="llama_sample_token_mirostat_v2safellamacontexthandle-intptr-single-single-single"><strong>llama_sample_token_mirostat_v2(SafeLLamaContextHandle, IntPtr, Single, Single, Single*)</strong></h3>
  2291. <p>Mirostat 2.0 algorithm described in the paper https://arxiv.org/abs/2007.14966. Uses tokens instead of words.</p>
  2292. <pre><code class="language-csharp">public static int llama_sample_token_mirostat_v2(SafeLLamaContextHandle ctx, IntPtr candidates, float tau, float eta, Single* mu)
  2293. </code></pre>
  2294. <h4 id="parameters_12">Parameters</h4>
  2295. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2296. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2297. A vector of <code>llama_token_data</code> containing the candidate tokens, their probabilities (p), and log-odds (logit) for the current position in the generated text.</p>
  2298. <p><code>tau</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br>
  2299. The target cross-entropy (or surprise) value you want to achieve for the generated text. A higher value corresponds to more surprising or less predictable text, while a lower value corresponds to less surprising or more predictable text.</p>
  2300. <p><code>eta</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single">Single</a><br>
  2301. The learning rate used to update <code>mu</code> based on the error between the target and observed surprisal of the sampled word. A larger learning rate will cause <code>mu</code> to be updated more quickly, while a smaller learning rate will result in slower updates.</p>
  2302. <p><code>mu</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.single*">Single*</a><br>
  2303. Maximum cross-entropy. This value is initialized to be twice the target cross-entropy (<code>2 * tau</code>) and is updated in the algorithm based on the error between the target and observed surprisal.</p>
  2304. <h4 id="returns_3">Returns</h4>
  2305. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2306. <h3 id="llama_sample_token_greedysafellamacontexthandle-intptr"><strong>llama_sample_token_greedy(SafeLLamaContextHandle, IntPtr)</strong></h3>
  2307. <p>Selects the token with the highest probability.</p>
  2308. <pre><code class="language-csharp">public static int llama_sample_token_greedy(SafeLLamaContextHandle ctx, IntPtr candidates)
  2309. </code></pre>
  2310. <h4 id="parameters_13">Parameters</h4>
  2311. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2312. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2313. Pointer to LLamaTokenDataArray</p>
  2314. <h4 id="returns_4">Returns</h4>
  2315. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2316. <h3 id="llama_sample_tokensafellamacontexthandle-intptr"><strong>llama_sample_token(SafeLLamaContextHandle, IntPtr)</strong></h3>
  2317. <p>Randomly selects a token from the candidates based on their probabilities.</p>
  2318. <pre><code class="language-csharp">public static int llama_sample_token(SafeLLamaContextHandle ctx, IntPtr candidates)
  2319. </code></pre>
  2320. <h4 id="parameters_14">Parameters</h4>
  2321. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2322. <p><code>candidates</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2323. Pointer to LLamaTokenDataArray</p>
  2324. <h4 id="returns_5">Returns</h4>
  2325. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2326. <h3 id="llama_empty_call"><strong>llama_empty_call()</strong></h3>
  2327. <pre><code class="language-csharp">public static bool llama_empty_call()
  2328. </code></pre>
  2329. <h4 id="returns_6">Returns</h4>
  2330. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">Boolean</a><br></p>
  2331. <h3 id="llama_context_default_params"><strong>llama_context_default_params()</strong></h3>
  2332. <pre><code class="language-csharp">public static LLamaContextParams llama_context_default_params()
  2333. </code></pre>
  2334. <h4 id="returns_7">Returns</h4>
  2335. <p><a href="../llama.native.llamacontextparams/">LLamaContextParams</a><br></p>
  2336. <h3 id="llama_mmap_supported"><strong>llama_mmap_supported()</strong></h3>
  2337. <pre><code class="language-csharp">public static bool llama_mmap_supported()
  2338. </code></pre>
  2339. <h4 id="returns_8">Returns</h4>
  2340. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">Boolean</a><br></p>
  2341. <h3 id="llama_mlock_supported"><strong>llama_mlock_supported()</strong></h3>
  2342. <pre><code class="language-csharp">public static bool llama_mlock_supported()
  2343. </code></pre>
  2344. <h4 id="returns_9">Returns</h4>
  2345. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">Boolean</a><br></p>
  2346. <h3 id="llama_init_from_filestring-llamacontextparams"><strong>llama_init_from_file(String, LLamaContextParams)</strong></h3>
  2347. <p>Various functions for loading a ggml llama model.
  2348. Allocate (almost) all memory needed for the model.
  2349. Return NULL on failure</p>
  2350. <pre><code class="language-csharp">public static IntPtr llama_init_from_file(string path_model, LLamaContextParams params_)
  2351. </code></pre>
  2352. <h4 id="parameters_15">Parameters</h4>
  2353. <p><code>path_model</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a><br></p>
  2354. <p><code>params_</code> <a href="../llama.native.llamacontextparams/">LLamaContextParams</a><br></p>
  2355. <h4 id="returns_10">Returns</h4>
  2356. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br></p>
  2357. <h3 id="llama_init_backend"><strong>llama_init_backend()</strong></h3>
  2358. <p>not great API - very likely to change.
  2359. Initialize the llama + ggml backend
  2360. Call once at the start of the program</p>
  2361. <pre><code class="language-csharp">public static void llama_init_backend()
  2362. </code></pre>
  2363. <h3 id="llama_freeintptr"><strong>llama_free(IntPtr)</strong></h3>
  2364. <p>Frees all allocated memory</p>
  2365. <pre><code class="language-csharp">public static void llama_free(IntPtr ctx)
  2366. </code></pre>
  2367. <h4 id="parameters_16">Parameters</h4>
  2368. <p><code>ctx</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br></p>
  2369. <h3 id="llama_apply_lora_from_filesafellamacontexthandle-string-string-int32"><strong>llama_apply_lora_from_file(SafeLLamaContextHandle, String, String, Int32)</strong></h3>
  2370. <p>Apply a LoRA adapter to a loaded model
  2371. path_base_model is the path to a higher quality model to use as a base for
  2372. the layers modified by the adapter. Can be NULL to use the current loaded model.
  2373. The model needs to be reloaded before applying a new adapter, otherwise the adapter
  2374. will be applied on top of the previous one</p>
  2375. <pre><code class="language-csharp">public static int llama_apply_lora_from_file(SafeLLamaContextHandle ctx, string path_lora, string path_base_model, int n_threads)
  2376. </code></pre>
  2377. <h4 id="parameters_17">Parameters</h4>
  2378. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2379. <p><code>path_lora</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a><br></p>
  2380. <p><code>path_base_model</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a><br></p>
  2381. <p><code>n_threads</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2382. <h4 id="returns_11">Returns</h4>
  2383. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br>
  2384. Returns 0 on success</p>
  2385. <h3 id="llama_get_kv_cache_token_countsafellamacontexthandle"><strong>llama_get_kv_cache_token_count(SafeLLamaContextHandle)</strong></h3>
  2386. <p>Returns the number of tokens in the KV cache</p>
  2387. <pre><code class="language-csharp">public static int llama_get_kv_cache_token_count(SafeLLamaContextHandle ctx)
  2388. </code></pre>
  2389. <h4 id="parameters_18">Parameters</h4>
  2390. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2391. <h4 id="returns_12">Returns</h4>
  2392. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2393. <h3 id="llama_set_rng_seedsafellamacontexthandle-int32"><strong>llama_set_rng_seed(SafeLLamaContextHandle, Int32)</strong></h3>
  2394. <p>Sets the current rng seed.</p>
  2395. <pre><code class="language-csharp">public static void llama_set_rng_seed(SafeLLamaContextHandle ctx, int seed)
  2396. </code></pre>
  2397. <h4 id="parameters_19">Parameters</h4>
  2398. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2399. <p><code>seed</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2400. <h3 id="llama_get_state_sizesafellamacontexthandle"><strong>llama_get_state_size(SafeLLamaContextHandle)</strong></h3>
  2401. <p>Returns the maximum size in bytes of the state (rng, logits, embedding
  2402. and kv_cache) - will often be smaller after compacting tokens</p>
  2403. <pre><code class="language-csharp">public static ulong llama_get_state_size(SafeLLamaContextHandle ctx)
  2404. </code></pre>
  2405. <h4 id="parameters_20">Parameters</h4>
  2406. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2407. <h4 id="returns_13">Returns</h4>
  2408. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2409. <h3 id="llama_copy_state_datasafellamacontexthandle-byte"><strong>llama_copy_state_data(SafeLLamaContextHandle, Byte[])</strong></h3>
  2410. <p>Copies the state to the specified destination address.
  2411. Destination needs to have allocated enough memory.
  2412. Returns the number of bytes copied</p>
  2413. <pre><code class="language-csharp">public static ulong llama_copy_state_data(SafeLLamaContextHandle ctx, Byte[] dest)
  2414. </code></pre>
  2415. <h4 id="parameters_21">Parameters</h4>
  2416. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2417. <p><code>dest</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.byte">Byte[]</a><br></p>
  2418. <h4 id="returns_14">Returns</h4>
  2419. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2420. <h3 id="llama_set_state_datasafellamacontexthandle-byte"><strong>llama_set_state_data(SafeLLamaContextHandle, Byte[])</strong></h3>
  2421. <p>Set the state reading from the specified address
  2422. Returns the number of bytes read</p>
  2423. <pre><code class="language-csharp">public static ulong llama_set_state_data(SafeLLamaContextHandle ctx, Byte[] src)
  2424. </code></pre>
  2425. <h4 id="parameters_22">Parameters</h4>
  2426. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2427. <p><code>src</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.byte">Byte[]</a><br></p>
  2428. <h4 id="returns_15">Returns</h4>
  2429. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2430. <h3 id="llama_load_session_filesafellamacontexthandle-string-int32-uint64-uint64"><strong>llama_load_session_file(SafeLLamaContextHandle, String, Int32[], UInt64, UInt64*)</strong></h3>
  2431. <p>Load session file</p>
  2432. <pre><code class="language-csharp">public static bool llama_load_session_file(SafeLLamaContextHandle ctx, string path_session, Int32[] tokens_out, ulong n_token_capacity, UInt64* n_token_count_out)
  2433. </code></pre>
  2434. <h4 id="parameters_23">Parameters</h4>
  2435. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2436. <p><code>path_session</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a><br></p>
  2437. <p><code>tokens_out</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32[]</a><br></p>
  2438. <p><code>n_token_capacity</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2439. <p><code>n_token_count_out</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64*">UInt64*</a><br></p>
  2440. <h4 id="returns_16">Returns</h4>
  2441. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">Boolean</a><br></p>
  2442. <h3 id="llama_save_session_filesafellamacontexthandle-string-int32-uint64"><strong>llama_save_session_file(SafeLLamaContextHandle, String, Int32[], UInt64)</strong></h3>
  2443. <p>Save session file</p>
  2444. <pre><code class="language-csharp">public static bool llama_save_session_file(SafeLLamaContextHandle ctx, string path_session, Int32[] tokens, ulong n_token_count)
  2445. </code></pre>
  2446. <h4 id="parameters_24">Parameters</h4>
  2447. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2448. <p><code>path_session</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a><br></p>
  2449. <p><code>tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32[]</a><br></p>
  2450. <p><code>n_token_count</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint64">UInt64</a><br></p>
  2451. <h4 id="returns_17">Returns</h4>
  2452. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">Boolean</a><br></p>
  2453. <h3 id="llama_evalsafellamacontexthandle-int32-int32-int32-int32"><strong>llama_eval(SafeLLamaContextHandle, Int32[], Int32, Int32, Int32)</strong></h3>
  2454. <p>Run the llama inference to obtain the logits and probabilities for the next token.
  2455. tokens + n_tokens is the provided batch of new tokens to process
  2456. n_past is the number of tokens to use from previous eval calls</p>
  2457. <pre><code class="language-csharp">public static int llama_eval(SafeLLamaContextHandle ctx, Int32[] tokens, int n_tokens, int n_past, int n_threads)
  2458. </code></pre>
  2459. <h4 id="parameters_25">Parameters</h4>
  2460. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2461. <p><code>tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32[]</a><br></p>
  2462. <p><code>n_tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2463. <p><code>n_past</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2464. <p><code>n_threads</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2465. <h4 id="returns_18">Returns</h4>
  2466. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br>
  2467. Returns 0 on success</p>
  2468. <h3 id="llama_eval_with_pointersafellamacontexthandle-int32-int32-int32-int32"><strong>llama_eval_with_pointer(SafeLLamaContextHandle, Int32*, Int32, Int32, Int32)</strong></h3>
  2469. <pre><code class="language-csharp">public static int llama_eval_with_pointer(SafeLLamaContextHandle ctx, Int32* tokens, int n_tokens, int n_past, int n_threads)
  2470. </code></pre>
  2471. <h4 id="parameters_26">Parameters</h4>
  2472. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2473. <p><code>tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32*">Int32*</a><br></p>
  2474. <p><code>n_tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2475. <p><code>n_past</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2476. <p><code>n_threads</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2477. <h4 id="returns_19">Returns</h4>
  2478. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2479. <h3 id="llama_tokenizesafellamacontexthandle-string-encoding-int32-int32-boolean"><strong>llama_tokenize(SafeLLamaContextHandle, String, Encoding, Int32[], Int32, Boolean)</strong></h3>
  2480. <p>Convert the provided text into tokens.
  2481. The tokens pointer must be large enough to hold the resulting tokens.
  2482. Returns the number of tokens on success, no more than n_max_tokens
  2483. Returns a negative number on failure - the number of tokens that would have been returned</p>
  2484. <pre><code class="language-csharp">public static int llama_tokenize(SafeLLamaContextHandle ctx, string text, Encoding encoding, Int32[] tokens, int n_max_tokens, bool add_bos)
  2485. </code></pre>
  2486. <h4 id="parameters_27">Parameters</h4>
  2487. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2488. <p><code>text</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.string">String</a><br></p>
  2489. <p><code>encoding</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.text.encoding">Encoding</a><br></p>
  2490. <p><code>tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32[]</a><br></p>
  2491. <p><code>n_max_tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2492. <p><code>add_bos</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">Boolean</a><br></p>
  2493. <h4 id="returns_20">Returns</h4>
  2494. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2495. <h3 id="llama_tokenize_nativesafellamacontexthandle-sbyte-int32-int32-boolean"><strong>llama_tokenize_native(SafeLLamaContextHandle, SByte[], Int32[], Int32, Boolean)</strong></h3>
  2496. <pre><code class="language-csharp">public static int llama_tokenize_native(SafeLLamaContextHandle ctx, SByte[] text, Int32[] tokens, int n_max_tokens, bool add_bos)
  2497. </code></pre>
  2498. <h4 id="parameters_28">Parameters</h4>
  2499. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2500. <p><code>text</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.sbyte">SByte[]</a><br></p>
  2501. <p><code>tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32[]</a><br></p>
  2502. <p><code>n_max_tokens</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2503. <p><code>add_bos</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.boolean">Boolean</a><br></p>
  2504. <h4 id="returns_21">Returns</h4>
  2505. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2506. <h3 id="llama_n_vocabsafellamacontexthandle"><strong>llama_n_vocab(SafeLLamaContextHandle)</strong></h3>
  2507. <pre><code class="language-csharp">public static int llama_n_vocab(SafeLLamaContextHandle ctx)
  2508. </code></pre>
  2509. <h4 id="parameters_29">Parameters</h4>
  2510. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2511. <h4 id="returns_22">Returns</h4>
  2512. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2513. <h3 id="llama_n_ctxsafellamacontexthandle"><strong>llama_n_ctx(SafeLLamaContextHandle)</strong></h3>
  2514. <pre><code class="language-csharp">public static int llama_n_ctx(SafeLLamaContextHandle ctx)
  2515. </code></pre>
  2516. <h4 id="parameters_30">Parameters</h4>
  2517. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2518. <h4 id="returns_23">Returns</h4>
  2519. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2520. <h3 id="llama_n_embdsafellamacontexthandle"><strong>llama_n_embd(SafeLLamaContextHandle)</strong></h3>
  2521. <pre><code class="language-csharp">public static int llama_n_embd(SafeLLamaContextHandle ctx)
  2522. </code></pre>
  2523. <h4 id="parameters_31">Parameters</h4>
  2524. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2525. <h4 id="returns_24">Returns</h4>
  2526. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2527. <h3 id="llama_get_logitssafellamacontexthandle"><strong>llama_get_logits(SafeLLamaContextHandle)</strong></h3>
  2528. <p>Token logits obtained from the last call to llama_eval()
  2529. The logits for the last token are stored in the last row
  2530. Can be mutated in order to change the probabilities of the next token
  2531. Rows: n_tokens
  2532. Cols: n_vocab</p>
  2533. <pre><code class="language-csharp">public static Single* llama_get_logits(SafeLLamaContextHandle ctx)
  2534. </code></pre>
  2535. <h4 id="parameters_32">Parameters</h4>
  2536. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2537. <h4 id="returns_25">Returns</h4>
  2538. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.single*">Single*</a><br></p>
  2539. <h3 id="llama_get_embeddingssafellamacontexthandle"><strong>llama_get_embeddings(SafeLLamaContextHandle)</strong></h3>
  2540. <p>Get the embeddings for the input
  2541. shape: [n_embd] (1-dimensional)</p>
  2542. <pre><code class="language-csharp">public static Single* llama_get_embeddings(SafeLLamaContextHandle ctx)
  2543. </code></pre>
  2544. <h4 id="parameters_33">Parameters</h4>
  2545. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2546. <h4 id="returns_26">Returns</h4>
  2547. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.single*">Single*</a><br></p>
  2548. <h3 id="llama_token_to_strsafellamacontexthandle-int32"><strong>llama_token_to_str(SafeLLamaContextHandle, Int32)</strong></h3>
  2549. <p>Token Id -&gt; String. Uses the vocabulary in the provided context</p>
  2550. <pre><code class="language-csharp">public static IntPtr llama_token_to_str(SafeLLamaContextHandle ctx, int token)
  2551. </code></pre>
  2552. <h4 id="parameters_34">Parameters</h4>
  2553. <p><code>ctx</code> <a href="../llama.native.safellamacontexthandle/">SafeLLamaContextHandle</a><br></p>
  2554. <p><code>token</code> <a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2555. <h4 id="returns_27">Returns</h4>
  2556. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.intptr">IntPtr</a><br>
  2557. Pointer to a string.</p>
  2558. <h3 id="llama_token_bos"><strong>llama_token_bos()</strong></h3>
  2559. <pre><code class="language-csharp">public static int llama_token_bos()
  2560. </code></pre>
  2561. <h4 id="returns_28">Returns</h4>
  2562. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2563. <h3 id="llama_token_eos"><strong>llama_token_eos()</strong></h3>
  2564. <pre><code class="language-csharp">public static int llama_token_eos()
  2565. </code></pre>
  2566. <h4 id="returns_29">Returns</h4>
  2567. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2568. <h3 id="llama_token_nl"><strong>llama_token_nl()</strong></h3>
  2569. <pre><code class="language-csharp">public static int llama_token_nl()
  2570. </code></pre>
  2571. <h4 id="returns_30">Returns</h4>
  2572. <p><a href="https://docs.microsoft.com/en-us/dotnet/api/system.int32">Int32</a><br></p>
  2573. </article>
  2574. </div>
  2575. </div>
  2576. </main>
  2577. <footer class="md-footer">
  2578. <div class="md-footer-meta md-typeset">
  2579. <div class="md-footer-meta__inner md-grid">
  2580. <div class="md-copyright">
  2581. Made with
  2582. <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
  2583. Material for MkDocs
  2584. </a>
  2585. </div>
  2586. </div>
  2587. </div>
  2588. </footer>
  2589. </div>
  2590. <div class="md-dialog" data-md-component="dialog">
  2591. <div class="md-dialog__inner md-typeset"></div>
  2592. </div>
  2593. <script id="__config" type="application/json">{"base": "../..", "features": [], "search": "../../assets/javascripts/workers/search.208ed371.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version": "Select version"}, "version": {"provider": "mike"}}</script>
  2594. <script src="../../assets/javascripts/bundle.a51614de.min.js"></script>
  2595. </body>
  2596. </html>

C#/.NET上易用的LLM高性能推理框架,支持LLaMA和LLaVA系列模型。

Contributors (1)