+
    iHàj²	  ã                  ó^   € R t ^ RIHt ^ RIHt ^ RIHt ^ RIHt R R lt	R R lt
R	 R
 ltR# )z@llama.cpp context-window probes (sibling of ``model_metadata``).)Úannotations)Úpairwise)ÚOptional)Úquotec               ó   € V ^8„  d   QhRR/# )é   ÚreturnÚdict© )Úformats   "ÚB/home/ubuntu/.hermes/hermes-agent/agent/model_metadata_llamacpp.pyÚ__annotate__r   
   s   € ÷ 2ñ 2˜$ñ 2ó    c                ó~   €  V P                  4       p\        T\        4      '       d   T# / #   \         d    / u # i ; i)z?The response body when it is a JSON object, else an empty dict.)ÚjsonÚ
ValueErrorÚ
isinstancer	   )ÚrespÚbodys   & r   Ú_json_objectr   
   sA   € ðØ�y‰y‹{ˆô ˜d¤D×)Ò)ˆ4Ð1¨rÐ1øô ô ØŠ	ðús   ‚, ¬<»<c               ó$   € V ^8„  d   QhRRRRRR/# ©r   Ú
server_urlÚstrÚmodelr   zOptional[int]r
   )r   s   "r   r   r      s!   € ÷ 8ñ 8¨ð 8°Sð 8¸]ñ 8r   c                ó„  € ^ RI p^ RIHp R\        V4       R2R3 F}  p V P	                  V V 24      pTP                  ^È8w  d   K,  \        T4      P	                  R4      p\        T\        4      '       d   T! TP	                  R4      4      MRpTf   K{  Tu # 	  \        WV4      #   TP
                   d      R# i ; i)aO  llama.cpp's RUNTIME n_ctx: /props for a loaded model, else the ``--ctx-size`` the router will
launch it with (its /models entry), so a lazily-loaded model doesn't fall to a family catch-all.
The /props read passes autoload=false: the router loads any model a request names, and a context
probe must not undo an Eject or an idle unload.N)Ú_positive_intz/props?model=z&autoload=falsez/propsÚdefault_generation_settingsÚn_ctx)ÚhttpxÚagent.model_metadatar   r   ÚgetÚ	HTTPErrorÚstatus_coder   r   r	   Úrouter_launch_ctx)	Úclientr   r   r   r   Ú
props_pathr   Úsettingsr   s	   &&&      r   Úllamacpp_contextr(      sÀ   € ó
 å2à&¤u¨U£| n°OÐDÀhÓOˆ
ð	Ø—:‘:  ¨Z¨LÐ9Ó:ˆDð ×Ñ˜sÔ"ÙÜ Ó%×)Ñ)Ð*GÓHˆÜ8BÀ8ÌT×8RÒ8R‘˜hŸl™l¨7Ó3Ô4ÐX\ˆØÔØŠLñ Pô ˜V°Ó7Ð7øð �‰ô 	Ûð	ús    B)Â)B?Â>B?c               ó$   € V ^8„  d   QhRRRRRR/# r   r
   )r   s   "r   r   r   *   s!   € ÷ ñ ¨#ð °cð ¸mñ r   c           	     ó   € ^ RI p^ RIHp  V P                  V R24      pTP
                  ^È8w  d   R# \        T4      P                  R4      p\        T\        4      '       d   TM.  EF  p\        T\        4      '       d)   T! \        TP                  RR4      4      T4      '       g   KD  TP                  R4      p\        T\        4      '       d   TP                  R4      MRp	\        T	\        4      '       d   T	 U
u. uF  p
\        T
4      NK  	  up
M. p\        T4       FE  w  rÍTR	9   g   K  TP                  4       '       g   K&  \        T4      ^ 8”  g   K8  \        T4      u u # 	  EK  	  R#   TP                   d     R# i ; iu up
i )
zP``--ctx-size`` from the router's launch args for *model* (GET /models), or None.N)Ú_model_id_matchesz/modelsÚdataÚidÚ ÚstatusÚargs)z
--ctx-sizez-c)r   r    r+   r!   r"   r#   r   r   Úlistr	   r   r   ÚisdigitÚint)r%   r   r   r   r+   r   ÚentriesÚentryr/   Úraw_argsÚar0   ÚflagÚvalues   &&&           r   r$   r$   *   s=  € ãå6ðØ�z‰z˜Z˜L¨Ð0Ó1ˆð ×Ñ˜3ÔÙÜ˜4Ó ×$Ñ$ VÓ,€GÜ& w´×5Ò5‘¸2Ó=ˆÜ˜%¤×&Ò&Ñ.?ÄÀEÇIÁIÈdÐTVÓDWÓ@XÐZ_×.`Ò.`ÙØ—‘˜8Ó$ˆÜ)3°F¼D×)AÒ)A�6—:‘:˜fÔ%ÀtˆÜ-7¸Ä$×-GÒ-G¡Ó)¡˜1”�A–¡Ò)ÈRˆÜ# Dž>‰KˆDØÐ+Ö+°·±·´ÄCÈÃJÐQRÆNÜ˜5“zÔ!ô *ñ >ñ øð �?‰?ô Úðüò *s   ŒE3 Ã?FÅ3FÆFN)Ú__doc__Ú
__future__r   Ú	itertoolsr   Útypingr   Úurllib.parser   r   r(   r$   r
   r   r   Ú<module>r?      s#   ðÙ Få "å Ý Ý õ2õ8÷.r   