Text Generation
Transformers
Safetensors
English
llama
Moderation
Safety
Filter
guardrail
prompt-injection
conversational
text-generation-inference
Instructions to use GeneralAnalysis/GA_Guard_1B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GeneralAnalysis/GA_Guard_1B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GeneralAnalysis/GA_Guard_1B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GeneralAnalysis/GA_Guard_1B") model = AutoModelForCausalLM.from_pretrained("GeneralAnalysis/GA_Guard_1B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use GeneralAnalysis/GA_Guard_1B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GeneralAnalysis/GA_Guard_1B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneralAnalysis/GA_Guard_1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GeneralAnalysis/GA_Guard_1B
- SGLang
How to use GeneralAnalysis/GA_Guard_1B 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 "GeneralAnalysis/GA_Guard_1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneralAnalysis/GA_Guard_1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "GeneralAnalysis/GA_Guard_1B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GeneralAnalysis/GA_Guard_1B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GeneralAnalysis/GA_Guard_1B with Docker Model Runner:
docker model run hf.co/GeneralAnalysis/GA_Guard_1B
Add evaluation-only license
Browse files
LICENSE
ADDED
|
@@ -0,0 +1,111 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
General Analysis Evaluation License
|
| 2 |
+
|
| 3 |
+
Copyright (c) General Analysis. All rights reserved.
|
| 4 |
+
|
| 5 |
+
This license governs access to and use of this repository and any associated
|
| 6 |
+
software, model weights, configuration, documentation, prompts, evaluation
|
| 7 |
+
artifacts, and other materials made available by General Analysis (the
|
| 8 |
+
"Materials").
|
| 9 |
+
|
| 10 |
+
1. Evaluation License
|
| 11 |
+
|
| 12 |
+
Subject to your compliance with this license, General Analysis grants you a
|
| 13 |
+
limited, revocable, non-exclusive, non-transferable, non-sublicensable license
|
| 14 |
+
to use the Materials solely for internal, non-production testing, research, and
|
| 15 |
+
evaluation.
|
| 16 |
+
|
| 17 |
+
2. No Production Use
|
| 18 |
+
|
| 19 |
+
You may not use the Materials for Production Use unless you have entered into a
|
| 20 |
+
separate written commercial license agreement with General Analysis.
|
| 21 |
+
|
| 22 |
+
"Production Use" means any use of the Materials, or any output or derivative of
|
| 23 |
+
the Materials, in or for:
|
| 24 |
+
|
| 25 |
+
- any product, service, application, workflow, system, or feature made available
|
| 26 |
+
to customers, end users, clients, or other third parties;
|
| 27 |
+
- any revenue-generating, commercial, paid, sponsored, or monetized activity;
|
| 28 |
+
- any internal business operation where the Materials make or support decisions
|
| 29 |
+
affecting customers, employees, users, partners, or third parties;
|
| 30 |
+
- any hosted service, API, software-as-a-service offering, marketplace listing,
|
| 31 |
+
managed service, or production deployment;
|
| 32 |
+
- any safety, security, compliance, moderation, legal, medical, financial,
|
| 33 |
+
employment, education, or other high-impact decisioning workflow; or
|
| 34 |
+
- any use beyond temporary internal evaluation.
|
| 35 |
+
|
| 36 |
+
3. Restrictions
|
| 37 |
+
|
| 38 |
+
You may not:
|
| 39 |
+
|
| 40 |
+
- sell, rent, lease, sublicense, distribute, provide access to, or otherwise make
|
| 41 |
+
the Materials available to any third party;
|
| 42 |
+
- use the Materials to provide a hosted service, API, or managed service to
|
| 43 |
+
third parties;
|
| 44 |
+
- use the Materials in production or for commercial purposes without a separate
|
| 45 |
+
written commercial license from General Analysis;
|
| 46 |
+
- remove, alter, or obscure any copyright, attribution, license, or proprietary
|
| 47 |
+
notices;
|
| 48 |
+
- use the Materials in violation of applicable law or any third-party acceptable
|
| 49 |
+
use policy that applies to underlying materials;
|
| 50 |
+
- use the Materials to train, improve, benchmark, or evaluate a competing model
|
| 51 |
+
or service, except as part of your internal evaluation of whether to obtain a
|
| 52 |
+
commercial license from General Analysis; or
|
| 53 |
+
- represent that General Analysis has approved or certified your use, product,
|
| 54 |
+
service, or deployment.
|
| 55 |
+
|
| 56 |
+
4. Third-Party Materials
|
| 57 |
+
|
| 58 |
+
The Materials may include, derive from, interoperate with, or be distributed
|
| 59 |
+
alongside third-party software, model weights, datasets, or other materials,
|
| 60 |
+
including materials governed by separate open source or source-available
|
| 61 |
+
licenses. Those third-party materials remain subject to their own license terms,
|
| 62 |
+
not this license.
|
| 63 |
+
|
| 64 |
+
If any Materials are based on, derived from, or distributed with Meta Llama
|
| 65 |
+
materials, your use is also subject to the applicable Meta Llama license and
|
| 66 |
+
acceptable use policy. You are responsible for complying with those terms,
|
| 67 |
+
including any attribution, notice, naming, and acceptable-use requirements. This
|
| 68 |
+
license does not replace, sublicense, or override Meta's license or any other
|
| 69 |
+
third-party license.
|
| 70 |
+
|
| 71 |
+
5. Ownership
|
| 72 |
+
|
| 73 |
+
General Analysis and its licensors retain all right, title, and interest in and
|
| 74 |
+
to the Materials. Except for the limited evaluation license expressly granted
|
| 75 |
+
above, no rights are granted by implication, estoppel, or otherwise.
|
| 76 |
+
|
| 77 |
+
6. Feedback
|
| 78 |
+
|
| 79 |
+
If you provide suggestions, comments, bug reports, evaluation results, or other
|
| 80 |
+
feedback regarding the Materials, you grant General Analysis a perpetual,
|
| 81 |
+
irrevocable, worldwide, royalty-free license to use, reproduce, modify,
|
| 82 |
+
distribute, and otherwise exploit that feedback without restriction or
|
| 83 |
+
compensation.
|
| 84 |
+
|
| 85 |
+
7. Termination
|
| 86 |
+
|
| 87 |
+
This license terminates automatically if you breach any term. Upon termination,
|
| 88 |
+
you must immediately stop using the Materials and delete all copies in your
|
| 89 |
+
possession or control.
|
| 90 |
+
|
| 91 |
+
8. No Warranty
|
| 92 |
+
|
| 93 |
+
THE MATERIALS ARE PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTIES OF
|
| 94 |
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS
|
| 95 |
+
FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, ACCURACY, SECURITY, OR
|
| 96 |
+
RELIABILITY.
|
| 97 |
+
|
| 98 |
+
9. Limitation of Liability
|
| 99 |
+
|
| 100 |
+
TO THE MAXIMUM EXTENT PERMITTED BY LAW, GENERAL ANALYSIS AND ITS LICENSORS WILL
|
| 101 |
+
NOT BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, EXEMPLARY,
|
| 102 |
+
PUNITIVE, OR OTHER DAMAGES, OR FOR ANY LOSS OF PROFITS, REVENUE, DATA, GOODWILL,
|
| 103 |
+
OR BUSINESS OPPORTUNITY, ARISING OUT OF OR RELATED TO THE MATERIALS OR THIS
|
| 104 |
+
LICENSE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
| 105 |
+
|
| 106 |
+
10. Commercial Licensing
|
| 107 |
+
|
| 108 |
+
Production Use requires a separate written commercial license from General
|
| 109 |
+
Analysis. The evaluation license granted here does not include any right to
|
| 110 |
+
deploy, commercialize, resell, host, or otherwise use the Materials in
|
| 111 |
+
production.
|