|
MODELS=`[ |
|
{ |
|
"name": "Lake 1", |
|
"promptExamples": [ |
|
{ |
|
"title": "Python Fibonacci", |
|
"prompt": "How can I write a Python function to generate the nth Fibonacci number?" |
|
}, { |
|
"title": "What is a meme?", |
|
"prompt": "What is a meme, and what's the history behind this word?" |
|
}, { |
|
"title": "Regex", |
|
"prompt": "Create a regex to extract dates from logs" |
|
} |
|
], |
|
"endpoints": [ |
|
{ |
|
"type": "tgi", |
|
"url": "http://127.0.0.1:8080" |
|
} |
|
], |
|
"parameters": { |
|
"temperature": 0.7, |
|
"top_p": 0.95, |
|
"repetition_penalty": 1.2, |
|
"top_k": 50, |
|
"truncate": 1000, |
|
"max_new_tokens": 1024, |
|
"stop": ["</s"] |
|
} |
|
}, |
|
{ |
|
"name": "Lake 1 Plus", |
|
"promptExamples": [ |
|
{ |
|
"title": "Java Sorting", |
|
"prompt": "How can I write a Java function to sort an array of integers?" |
|
}, { |
|
"title": "What is a neural network?", |
|
"prompt": "What is a neural network, and how does it work?" |
|
}, { |
|
"title": "Data Structures", |
|
"prompt": "Explain the difference between a stack and a queue" |
|
} |
|
], |
|
"endpoints": [ |
|
{ |
|
"type": "tgi", |
|
"url": "http://127.0.0.1:8081" |
|
} |
|
], |
|
"parameters": { |
|
"temperature": 0.8, |
|
"top_p": 0.9, |
|
"repetition_penalty": 1.1, |
|
"top_k": 40, |
|
"truncate": 900, |
|
"max_new_tokens": 1024, |
|
"stop": ["</s"] |
|
}, |
|
"access": "plus" |
|
}, |
|
{ |
|
"name": "Lake 2 Flash", |
|
"promptExamples": [ |
|
{ |
|
"title": "Python Web Development", |
|
"prompt": "How can I create a simple web server using Python?" |
|
}, { |
|
"title": "What is a database?", |
|
"prompt": "What is a database, and how does it work?" |
|
}, { |
|
"title": "Machine Learning", |
|
"prompt": "Explain the difference between supervised and unsupervised learning" |
|
} |
|
], |
|
"endpoints": [ |
|
{ |
|
"type": "tgi", |
|
"url": "http://127.0.0.1:8082" |
|
} |
|
], |
|
"parameters": { |
|
"temperature": 0.9, |
|
"top_p": 0.85, |
|
"repetition_penalty": 1.0, |
|
"top_k": 30, |
|
"truncate": 800, |
|
"max_new_tokens": 1024, |
|
"stop": ["</s"] |
|
}, |
|
"access": "free" |
|
}, |
|
{ |
|
"name": "Lake 1 Pro", |
|
"promptExamples": [ |
|
{ |
|
"title": "Advanced Python", |
|
"prompt": "How can I use Python to create a complex data structure?" |
|
}, { |
|
"title": "What is a blockchain?", |
|
"prompt": "What is a blockchain, and how does it work?" |
|
}, { |
|
"title": "Artificial Intelligence", |
|
"prompt": "Explain the difference between AI and ML" |
|
} |
|
], |
|
"endpoints": [ |
|
{ |
|
"type": "tgi", |
|
"url": "http://127.0.0.1:8083" |
|
} |
|
], |
|
"parameters": { |
|
"temperature": 0.95, |
|
"top_p": 0.8, |
|
"repetition_penalty": 0.9, |
|
"top_k": 20, |
|
"truncate": 700, |
|
"max_new_tokens": 1024, |
|
"stop": ["</s"] |
|
}, |
|
"access": "pro" |
|
} |
|
]` |
|
|
|
To access the premium and pro models, users will need to pay real money. The payment system can be integrated using a payment gateway API, such as Stripe or PayPal. The access levels can be defined as follows: |
|
|
|
* Free: Access to Lake 1 and Lake 2 Flash models |
|
* Plus: Access to Lake 1, Lake 2 Flash, Lake 1 Plus models |
|
* Pro: Access to all models, including Lake 1, Lake 2 Flash, Lake 1 Plus, Lake 1 Pro |
|
|
|
The payment system can be implemented using a subscription-based model, where users can choose to pay monthly or annually for access to the premium and pro models. |
|
|
|
Here is an example of how the payment system can be implemented using Stripe: |
|
```python |
|
import patreon |
|
|
|
patreon.api_client = patreon.APIv2Client( |
|
client_id="vz9JKiN9T6yO1s9F7CNDYMD4UlrF8fIVqkDSArkZTxafvvIRdQ0Qg24XNSXos6J2", |
|
client_secret="s5EhScWc7aa4HmjMtG7ukFYnCfJivFDIzfien-yFei4_UNr_XPdzgqzKl7d0GLe4", |
|
access_token="wryrin3mSMgxFHzApCA2-qMjHyCgsvrxP8mYY_XYNro" |
|
) |
|
|
|
def create_subscription(tier_id, patron_id): |
|
subscription = patreon.Subscription( |
|
tier_id=tier_id, |
|
patron_id=patron_id |
|
) |
|
try: |
|
subscription.create() |
|
return subscription |
|
except patreon.APIError as e: |
|
print(f"Error creating subscription: {e}") |
|
return None |
|
|
|
def get_subscription(subscription_id): |
|
try: |
|
subscription = patreon.Subscription.find(subscription_id) |
|
return subscription |
|
except patreon.APIError as e: |
|
print(f"Error getting subscription: {e}") |
|
return None |
|
|
|
def update_subscription(subscription_id, tier_id): |
|
try: |
|
subscription = patreon.Subscription.find(subscription_id) |
|
subscription.update(tier_id=tier_id) |
|
return subscription |
|
except patreon.APIError as e: |
|
print(f"Error updating subscription: {e}") |
|
return None |
|
|
|
def cancel_subscription(subscription_id): |
|
try: |
|
subscription = patreon.Subscription.find(subscription_id) |
|
subscription.delete() |
|
return subscription |
|
except patreon.APIError as e: |
|
print(f"Error canceling subscription: {e}") |
|
return None |