Instructions to use Scantrack/Agora with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Scantrack/Agora with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Scantrack/Agora", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("Scantrack/Agora", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Scantrack/Agora with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Scantrack/Agora" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Scantrack/Agora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Scantrack/Agora
- SGLang
How to use Scantrack/Agora with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Scantrack/Agora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Scantrack/Agora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Scantrack/Agora" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Scantrack/Agora", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Scantrack/Agora with Docker Model Runner:
docker model run hf.co/Scantrack/Agora
| from transformers import PretrainedConfig | |
| class AgoraConfig(PretrainedConfig): | |
| r""" | |
| Configuration class for the Agora model. | |
| Args: | |
| vocab_size (`int`, *optional*, defaults to 32000): | |
| Vocabulary size of the Agora model. | |
| hidden_size (`int`, *optional*, defaults to 2048): | |
| Dimensionality of the embeddings and hidden states. | |
| intermediate_size (`int`, *optional*, defaults to 8192): | |
| Dimensionality of the MLP representations. | |
| num_hidden_layers (`int`, *optional*, defaults to 24): | |
| Number of hidden layers in the Transformer encoder. | |
| num_attention_heads (`int`, *optional*, defaults to 16): | |
| Number of attention heads for each attention layer. | |
| num_key_value_heads (`int`, *optional*, defaults to 8): | |
| Number of key/value heads (Grouped Query Attention). | |
| head_dim (`int`, *optional*, defaults to 128): | |
| Dimension per attention head. | |
| max_position_embeddings (`int`, *optional*, defaults to 4096): | |
| Maximum sequence length. | |
| rope_theta (`float`, *optional*, defaults to 10000.0): | |
| Base period for RoPE embeddings. | |
| hidden_act (`str`, *optional*, defaults to `"silu"`): | |
| Activation function in MLP layers. | |
| rms_norm_eps (`float`, *optional*, defaults to 1e-5): | |
| Epsilon value for RMSNorm. | |
| use_cache (`bool`, *optional*, defaults to `True`): | |
| Whether to use KV cache during generation. | |
| tie_word_embeddings (`bool`, *optional*, defaults to `False`): | |
| Whether to tie input/output embeddings. | |
| attention_dropout (`float`, *optional*, defaults to 0.0): | |
| Dropout probability for attention weights. | |
| """ | |
| model_type = "agora" | |
| keys_to_ignore_at_inference = ["past_key_values"] | |
| def __init__( | |
| self, | |
| vocab_size=32000, | |
| hidden_size=2048, | |
| intermediate_size=8192, | |
| num_hidden_layers=24, | |
| num_attention_heads=16, | |
| num_key_value_heads=8, | |
| head_dim=128, | |
| max_position_embeddings=4096, | |
| rope_theta=10000.0, | |
| rope_scaling=None, | |
| hidden_act="silu", | |
| initializer_range=0.02, | |
| rms_norm_eps=1e-5, | |
| use_cache=True, | |
| tie_word_embeddings=False, | |
| attention_bias=False, | |
| attention_dropout=0.0, | |
| mlp_bias=False, | |
| pad_token_id=0, | |
| bos_token_id=1, | |
| eos_token_id=2, | |
| **kwargs, | |
| ): | |
| self.vocab_size = vocab_size | |
| self.hidden_size = hidden_size | |
| self.intermediate_size = intermediate_size | |
| self.num_hidden_layers = num_hidden_layers | |
| self.num_attention_heads = num_attention_heads | |
| self.num_key_value_heads = num_key_value_heads | |
| self.head_dim = head_dim | |
| self.max_position_embeddings = max_position_embeddings | |
| self.rope_theta = rope_theta | |
| self.rope_scaling = rope_scaling | |
| self.hidden_act = hidden_act | |
| self.initializer_range = initializer_range | |
| self.rms_norm_eps = rms_norm_eps | |
| self.use_cache = use_cache | |
| self.attention_bias = attention_bias | |
| self.attention_dropout = attention_dropout | |
| self.mlp_bias = mlp_bias | |
| super().__init__( | |
| pad_token_id=pad_token_id, | |
| bos_token_id=bos_token_id, | |
| eos_token_id=eos_token_id, | |
| tie_word_embeddings=tie_word_embeddings, | |
| **kwargs, | |
| ) | |